Categorygithub.com/lab5e/at
modulepackage
0.0.0-20230824114242-3db7c047b3cc
Repository: https://github.com/lab5e/at.git
Documentation: pkg.go.dev

# README

AT command library

This is a work in progress. Use at your own risk

GoDoc

The AT command library is a Go library for communicating with mobile network IoT modules via their AT command set. Currently only the uBlox Sara N210/N211 is supported, but this library might work with the uBlox N310 too.

As mentioned above this is a work in progress so expect things to change around and maintainance of this library to be somewhat episodic.

If you want to contribute or you have suggestions, please do not hesitate to contact @borud.

Sample code

package main

import (
	"log"
	"os"

	"github.com/lab5e/at/n211"
)

const baudRate = 9600

func main() {
	if len(os.Args) < 2 {
		log.Fatalf("Usage %s <serial device>", os.Args[0])
	}

	device := n211.New(os.Args[1], baudRate)
	if err := device.Start(); err != nil {
		log.Fatalf("Error opening device: %v", err)
	}
	defer device.Close()

	// Turn on debugging so you can see the interaction with the device
	device.SetDebug(true)

	// Just send a blank AT command to verify the device is there
	if err := device.AT(); err != nil {
		log.Fatalf("Error speaking to device on '%s': %v", os.Args[1], err)
	}
	log.Printf("Device seems to be responsive")
}

# Packages

No description provided by the author
No description provided by the author
Package n211 implements interface to uBlox SARA N211 module .
Package nrf91 contains the modem code for the soft serial modem.

# Functions

No description provided by the author
No description provided by the author

# Constants

No description provided by the author

# Variables

CCIDRegex is a regexp that matches an CCID.
ErrATError ...
ErrReadTimeout read from device timed out.
IMEIRegex is a regexp that matches an IMEI number.
IMSIRegex is a regexp that matches an IMSI number.

# Structs

APN contains data about the APN.
CommandInterface is a helper type for modems.
DefeaultImplementation is a default implementation.
ReceivedData contains the data received from an UDP connection.
Stats contains basic operational statistics.

# Interfaces

Device is a generic interface for mobile network devices with AT command interfaces.