pkg

package
v0.0.0-...-5900fef Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2020 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GSM

type GSM struct {
	ComPort  string
	BaudRate int
	Port     *serial.Port
	DeviceId string
}

*-------------------------------------------------------------------------- * GSM attributes *-------------------------------------------------------------------------- * * GMS struct defines the config attributes of the external device, * to make a connection between the core-engine/system and external device. * * @var string ComPort | Serial port communication (hardware interface) * @var int BaudRate | Serial port transferring - * (rate information transferred in maximum 'x' bits per second) * @var os Port | External device port * @var string DeviceId | External device id/name

func NewGSMModem

func NewGSMModem(ComPort string, BaudRate int, DeviceId string) (modem *GSM)

*-------------------------------------------------------------------------- * Set The Config *-------------------------------------------------------------------------- * * Here we will set the environment configuration. * * @return struct GSM

func (*GSM) Connect

func (modem *GSM) Connect() (err error)

*-------------------------------------------------------------------------- * Make a connection *-------------------------------------------------------------------------- * * Here we will be trying to connect with the core device, * the serial port configuration is needed and will be applying * to opens a serial port with the specified configuration. * * @var tarm/serial.Config config * * @do initialized * @return error if !initialized

func (*GSM) Expect

func (modem *GSM) Expect(possibilities []string) (string, error)

*-------------------------------------------------------------------------- * *-------------------------------------------------------------------------- * * * * @return string

func (*GSM) Read

func (modem *GSM) Read(number int) string

*-------------------------------------------------------------------------- * *-------------------------------------------------------------------------- * * * * @return string

func (*GSM) Send

func (modem *GSM) Send(command string)

*-------------------------------------------------------------------------- * *-------------------------------------------------------------------------- * * * * @return string

func (*GSM) WriteCommand

func (modem *GSM) WriteCommand(command string, waitCallback bool) string

*-------------------------------------------------------------------------- * *-------------------------------------------------------------------------- * * * * @return string

func (*GSM) WriteMessage

func (modem *GSM) WriteMessage(number string, message string) string

*-------------------------------------------------------------------------- * *-------------------------------------------------------------------------- * * * * @return string

Jump to

Keyboard shortcuts

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