atmodem

package module
v0.0.0-...-b359178 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 22, 2020 License: MIT Imports: 8 Imported by: 0

README

atmodem Linux Test Status GoDoc Go Report Card

Package atmodem provides a high-level interface for controlling modems using the AT command set. MIT Licensed.

Documentation

Overview

Package atmodem provides a high-level interface for controlling modems using the AT command set.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	// contains filtered or unexported fields
}

A Device is a modem which communicates using AT commands.

func Dial

func Dial(port string, baud int, timeout time.Duration) (*Device, error)

Dial dials a serial connection to a modem with the specified port, baud rate, and timeout.

func Open

func Open(rw io.ReadWriter, timeout time.Duration) (*Device, error)

Open opens a connection to a modem using an existing io.ReadWriter. If rw also implements io.Closer, its Close method will be called on Device.Close.

func (*Device) Close

func (d *Device) Close() error

Close closes the underlying io.ReadWriter if it also implements io.Closer, or is a no-op otherwise.

func (*Device) Info

func (d *Device) Info() (*Info, error)

Info requests device information from the modem.

func (*Device) Status

func (d *Device) Status() (*Status, error)

Status returns the current status of the modem.

type Info

type Info struct {
	Manufacturer, Model, Revision, IMEI, MEID, FSN string
	IMEISV                                         int
	GCAP                                           []string
}

Info contains device information about a modem.

type Status

type Status struct {
	CurrentTime                                 time.Duration
	Temperature, ResetCounter                   int
	Mode, SystemMode, PSState, LTEBand          string
	LTEBandwidthMHz                             float64
	LTEReceiveChannel, LTETransmitChannel       int
	LTECAState, EMMState, RRCState, IMSRegState string
	PCCRXMRSSI, RSRPRXMdBm                      int
	PCCRXDRSSI, RSRPRXDdBm                      int
	TransmitPower                               int
	TAC, CellID                                 string
	RSRQdB, SINRdB                              float64
	// contains filtered or unexported fields
}

Status contains the modem's current radio status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL