Documentation ¶
Overview ¶
Package gmodem provides simple primitives to open a connection to a serial modem device and communicate with it by AT-Commands
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Modem ¶
type Modem struct { // DevFile is the absolute path to the device file (e. g. /dev/ttyUSB1) DevFile string // Baudrate is the speed for data transfer between the you and the modem device (e. g. 115200) Baudrate int64 // ReadTimeout is the timeout which is used for reading operations on the serial device. Some AT-Commands // needs longer to execute than others. ReadTimeout time.Duration // contains filtered or unexported fields }
Modem holds the parameters which are needed for the serial communication with the modem device
func (*Modem) Open ¶
Open opens the connection to ther serial interface with the defined parameters. The function configures the default read timeout for the serial interface
func (*Modem) SendAt ¶
SendAt sends a AT command over the serial line to the and returns the answer to the caller. The command will return an error if the Write or Read operation will fail. It doesn't return an error if the AT command fails. The function appends the closing <CR> automatically to the command.