Documentation
¶
Index ¶
- Constants
- type SIM900
- func (s *SIM900) CheckSMSTextMode(mode int) error
- func (s *SIM900) Connect(port string, baud int) error
- func (s *SIM900) DeleteSMS(id string) error
- func (sim *SIM900) Disconnect() error
- func (s *SIM900) Ping() error
- func (s *SIM900) ReadSMS(id string) (msg string, err error)
- func (s *SIM900) SMSMode() (mode string, err error)
- func (s *SIM900) SendSMS(number, msg string) error
- func (s *SIM900) SetSMSMode(mode string) error
- func (s *SIM900) WaitSMS(timeout time.Duration) (id string, err error)
Constants ¶
View Source
const ( CMD_AT string = "AT" CMD_OK string = "(^OK$)" CMD_ERROR string = "(^ERROR$)" CMD_CMGF string = "AT+CMGF?" CMD_CMGF_SET string = "AT+CMGF=%s" CMD_CMGF_REGEXP string = "(^[+]CMGF[:] [0-9]+$)" CMD_CMGF_RX string = "+CMGF: " CMD_CTRL_Z string = "\x1A" CMD_CMGS string = "AT+CMGS=\"%s\"" CMD_CMGS_RX_REGEXP string = "(^[+]CMGS[:] [0-9]+$)" CMD_CMGD string = "AT+CMGD=%s" CMD_CMGR string = "AT+CMGR=%s" CMD_CMGR_REGEXP string = "(^[+]CMGR[:] .*)" CMD_CMGR_RX string = "+CMGR: " CMD_CMTI_REGEXP string = "(^[+]CMTI[:] \"SM\",[0-9]+$)" CMD_CMTI_RX string = "+CMTI: \"SM\"," )
AT commands
View Source
const ( PDU_MODE string = "0" TEXT_MODE string = "1" )
SMS Message Format
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type SIM900 ¶
type SIM900 struct {
// contains filtered or unexported fields
}
A SIM900 is the representation of a SIM900 GSM modem with several utility features.
func (*SIM900) CheckSMSTextMode ¶
SetSMSMode selects SMS Message Format (0 = PDU mode, 1 = Text mode)
func (*SIM900) Connect ¶
Connect creates a connection with the SIM900 modem via serial port and test communications.
func (*SIM900) Disconnect ¶
func (*SIM900) SetSMSMode ¶
SetSMSMode selects SMS Message Format ("0" = PDU mode, "1" = Text mode)
Click to show internal directories.
Click to hide internal directories.