gogsm

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: BSD-3-Clause Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gogsm

A Golang library for interfacing with a GSM module using generic AT commands

Examples

Examples can be found in the examples folder.

Documentation

Index

Constants

View Source
const (
	OK    = "OK"
	ERROR = "ERROR"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultGSMDevice

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

func (*DefaultGSMDevice) Capabilities

func (d *DefaultGSMDevice) Capabilities() ([]parsing.CommandSetCapability, error)

func (*DefaultGSMDevice) CharacterSet

func (d *DefaultGSMDevice) CharacterSet() (parsing.CharacterSet, error)

func (*DefaultGSMDevice) Check

func (d *DefaultGSMDevice) Check() error

func (*DefaultGSMDevice) Close

func (d *DefaultGSMDevice) Close() error

func (*DefaultGSMDevice) DeleteAllSMSMessages

func (d *DefaultGSMDevice) DeleteAllSMSMessages(storage parsing.MessageStorage, filter parsing.MessageDeleteFilter) error

func (*DefaultGSMDevice) DeleteSMSMessage

func (d *DefaultGSMDevice) DeleteSMSMessage(storage parsing.MessageStorage, index int) error

func (*DefaultGSMDevice) ExecuteCommand

func (d *DefaultGSMDevice) ExecuteCommand(s string) (resp string, err error)

func (*DefaultGSMDevice) IncomingSMSMessage

func (d *DefaultGSMDevice) IncomingSMSMessage() <-chan parsing.SMSMessage

func (*DefaultGSMDevice) Manufacturer

func (d *DefaultGSMDevice) Manufacturer() (string, error)

func (*DefaultGSMDevice) MessageFormat

func (d *DefaultGSMDevice) MessageFormat() (parsing.MessageFormat, error)

func (*DefaultGSMDevice) Model

func (d *DefaultGSMDevice) Model() (string, error)

func (*DefaultGSMDevice) NetworkOperator

func (d *DefaultGSMDevice) NetworkOperator() (string, error)

func (*DefaultGSMDevice) ProductIdentification

func (d *DefaultGSMDevice) ProductIdentification() (string, error)

func (*DefaultGSMDevice) Revision

func (d *DefaultGSMDevice) Revision() (string, error)

func (*DefaultGSMDevice) SMSMessage

func (d *DefaultGSMDevice) SMSMessage(storage parsing.MessageStorage, index int) (parsing.SMSMessage, error)

func (*DefaultGSMDevice) SMSMessages

func (d *DefaultGSMDevice) SMSMessages(storage parsing.MessageStorage, filter parsing.MessageFilter) ([]parsing.SMSMessage, error)

func (*DefaultGSMDevice) SerialNumber

func (d *DefaultGSMDevice) SerialNumber() (string, error)

func (*DefaultGSMDevice) SetCharacterSet

func (d *DefaultGSMDevice) SetCharacterSet(set parsing.CharacterSet) error

func (*DefaultGSMDevice) SetMessageFormat

func (d *DefaultGSMDevice) SetMessageFormat(format parsing.MessageFormat) error

func (*DefaultGSMDevice) SetPreferredMessageStorage

func (d *DefaultGSMDevice) SetPreferredMessageStorage(storage parsing.MessageStorage) error

func (*DefaultGSMDevice) SignalQuality

func (d *DefaultGSMDevice) SignalQuality() (parsing.SignalQuality, error)

func (*DefaultGSMDevice) SubscriberId

func (d *DefaultGSMDevice) SubscriberId() (string, error)

func (*DefaultGSMDevice) WriteString

func (d *DefaultGSMDevice) WriteString(s string) (n int, err error)

type GSMDevice

type GSMDevice interface {
	io.Closer

	IncomingSMSMessage() <-chan parsing.SMSMessage

	// Check sends a basic "AT" command to see if the device is operational.
	Check() error
	// SignalQuality returns the current signal quality by values:
	// RSSI (https://en.wikipedia.org/wiki/RSSI) and BER (https://en.wikipedia.org/wiki/Bit_error_rate).
	SignalQuality() (parsing.SignalQuality, error)
	// Model returns the model of the GSM module.
	Model() (string, error)
	// Manufacturer returns the manufacturer of the GSM module.
	Manufacturer() (string, error)
	// Revision returns the revision of the GSM module.
	Revision() (string, error)
	// SerialNumber returns the serial number of the GSM module.
	SerialNumber() (string, error)
	// SubscriberId returns the IMSI (International Mobile Subscriber Identity) of the SIM inserted into the GSM module.
	SubscriberId() (string, error)
	// ProductIdentification sends a basic "ATI" command for product identification information.
	ProductIdentification() (string, error)
	// Capabilities returns a list of the capabilities this GSM module may have.
	Capabilities() ([]parsing.CommandSetCapability, error)
	// CharacterSet returns the current character set selected.
	CharacterSet() (parsing.CharacterSet, error)
	// SetCharacterSet sets the current character set to the provided one.
	SetCharacterSet(set parsing.CharacterSet) error
	// NetworkOperator returns the current network operator providing service to the GSM module.
	NetworkOperator() (string, error)
	// SetPreferredMessageStorage sets the preferred message storage for incoming SMS/MMS messages.
	SetPreferredMessageStorage(storage parsing.MessageStorage) error
	// MessageFormat returns the message format used to encode/decode SMS/MMS messages.
	MessageFormat() (parsing.MessageFormat, error)
	// SetMessageFormat sets the message format used to encode/decode SMS/MMS messages.
	SetMessageFormat(format parsing.MessageFormat) error
	// SMSMessages returns all messages from the provided parsing.MessageFilter in the parsing.MessageStorage.
	SMSMessages(storage parsing.MessageStorage, filter parsing.MessageFilter) ([]parsing.SMSMessage, error)
	// SMSMessage returns a message from the provided index in the parsing.MessageStorage.
	SMSMessage(storage parsing.MessageStorage, index int) (parsing.SMSMessage, error)
	// DeleteAllSMSMessages deletes all messages with the provided parsing.MessageDeleteFilter in the parsing.MessageStorage.
	DeleteAllSMSMessages(storage parsing.MessageStorage, filter parsing.MessageDeleteFilter) error
	// DeleteSMSMessage deletes a message with the provided index in the parsing.MessageStorage.
	DeleteSMSMessage(storage parsing.MessageStorage, index int) error
}

func FromSerial

func FromSerial(port string) (GSMDevice, error)

func NewGSMDevice

func NewGSMDevice(socket io.ReadWriteCloser) (GSMDevice, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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