Documentation ¶
Index ¶
- Constants
- Variables
- func MakeSeparatedText(s string, id byte) (ud []UserData, cs Charset)
- func MarshalUDHs(h []UserDataHdr) []byte
- func NextMsgReference() byte
- func NextTranssactionID() byte
- type AbsentDiag
- type Address
- type CPDU
- type Charset
- type Command
- func (d Command) MarshalCP() []byte
- func (d Command) MarshalJSON() ([]byte, error)
- func (d Command) MarshalRP() []byte
- func (d Command) MarshalTP() []byte
- func (d Command) String() string
- func (d *Command) UnmarshalCP(b []byte) (e error)
- func (d *Command) UnmarshalJSON(b []byte) error
- func (d *Command) UnmarshalRP(b []byte) (e error)
- func (d *Command) UnmarshalTP(b []byte) (e error)
- type ConcatenatedSM
- type ConcatenatedSM16bit
- type CpAck
- type CpError
- type DataCoding
- type DataCodingMessage
- type Deliver
- func (d Deliver) MarshalCP() []byte
- func (d Deliver) MarshalJSON() ([]byte, error)
- func (d Deliver) MarshalRP() []byte
- func (d Deliver) MarshalTP() []byte
- func (d Deliver) String() string
- func (d *Deliver) UnmarshalCP(b []byte) (e error)
- func (d *Deliver) UnmarshalJSON(b []byte) error
- func (d *Deliver) UnmarshalRP(b []byte) (e error)
- func (d *Deliver) UnmarshalTP(b []byte) (e error)
- type DeliverReport
- func (d DeliverReport) MarshalCP() []byte
- func (d DeliverReport) MarshalJSON() ([]byte, error)
- func (d DeliverReport) MarshalRP() []byte
- func (d DeliverReport) MarshalTP() []byte
- func (d DeliverReport) String() string
- func (d *DeliverReport) UnmarshalCP(b []byte) (e error)
- func (d *DeliverReport) UnmarshalJSON(b []byte) error
- func (d *DeliverReport) UnmarshalRP(b []byte) (e error)
- func (d *DeliverReport) UnmarshalTP(b []byte) (e error)
- type GSM7bitString
- type GeneralDataCoding
- type GenericIEI
- type MemoryAvailable
- type MessageWaiting
- type RPDU
- type RpAck
- type RpAckMO
- type RpAckMT
- type RpError
- type RpErrorMO
- type RpErrorMT
- type SMC
- type SMR
- type StatusReport
- func (d StatusReport) MarshalCP() []byte
- func (d StatusReport) MarshalJSON() ([]byte, error)
- func (d StatusReport) MarshalRP() []byte
- func (d StatusReport) MarshalTP() []byte
- func (d StatusReport) String() string
- func (d *StatusReport) UnmarshalCP(b []byte) (e error)
- func (d *StatusReport) UnmarshalJSON(b []byte) error
- func (d *StatusReport) UnmarshalRP(b []byte) (e error)
- func (d *StatusReport) UnmarshalTP(b []byte) (e error)
- type Submit
- func (d Submit) MarshalCP() []byte
- func (d Submit) MarshalJSON() ([]byte, error)
- func (d Submit) MarshalRP() []byte
- func (d Submit) MarshalTP() []byte
- func (d Submit) String() string
- func (d *Submit) UnmarshalCP(b []byte) (e error)
- func (d *Submit) UnmarshalJSON(b []byte) error
- func (d *Submit) UnmarshalRP(b []byte) (e error)
- func (d *Submit) UnmarshalTP(b []byte) (e error)
- type SubmitReport
- func (d SubmitReport) MarshalCP() []byte
- func (d SubmitReport) MarshalJSON() ([]byte, error)
- func (d SubmitReport) MarshalRP() []byte
- func (d SubmitReport) MarshalTP() []byte
- func (d SubmitReport) String() string
- func (d *SubmitReport) UnmarshalCP(b []byte) (e error)
- func (d *SubmitReport) UnmarshalJSON(b []byte) error
- func (d *SubmitReport) UnmarshalRP(b []byte) (e error)
- func (d *SubmitReport) UnmarshalTP(b []byte) (e error)
- type TPDU
- type UnexpectedInformationElementError
- type UnexpectedMessageTypeError
- type UnknownDataCodingError
- type UnknownGSM7bitRuneError
- type UnknownMessageTypeError
- type UnmarshalerCP
- type UnmarshalerRP
- type UnmarshalerTP
- type UserData
- type UserDataHdr
- type VPAbsolute
- type VPEnhanced
- type VPRelative
- type ValidityPeriod
Constants ¶
const ( // TypeUnknown of TON TypeUnknown byte = 0 // TypeInternational of TON TypeInternational byte = 1 // TypeNational of TON TypeNational byte = 2 // TypeNetworkSpecific of TON TypeNetworkSpecific byte = 3 // TypeSubscriber of TON TypeSubscriber byte = 4 // TypeAlphanumeric of TON TypeAlphanumeric byte = 5 // TypeAbbreviated of TON TypeAbbreviated byte = 6 // PlanUnknown of NPI PlanUnknown byte = 0 // PlanISDNTelephone of NPI PlanISDNTelephone byte = 1 // PlanData of NPI PlanData byte = 3 // PlanTelex of NPI PlanTelex byte = 4 // PlanSCSpecific1 of NPI PlanSCSpecific1 byte = 5 // PlanSCSpecific2 of NPI PlanSCSpecific2 byte = 6 // PlanNational of NPI PlanNational byte = 8 // PlanPrivate of NPI PlanPrivate byte = 9 // PlanERMES of NPI PlanERMES byte = 10 )
const ( // NoMessageClass means no message class NoMessageClass msgClass = 0x00 // MessageClass0 means message class 0 MessageClass0 msgClass = 0x10 // MessageClass1 means message class 1 MessageClass1 msgClass = 0x11 // MessageClass2 means message class 2 MessageClass2 msgClass = 0x12 // MessageClass3 means message class 3 MessageClass3 msgClass = 0x13 // CharsetGSM7bit means GSM 7 bit default alphabet charset CharsetGSM7bit Charset = 0x00 // Charset8bitData means 8 bit data charset Charset8bitData Charset = 0x04 // CharsetUCS2 means UCS2 charset CharsetUCS2 Charset = 0x08 )
const ( // VoicemailMessageWaiting means waiting type VoicemailMessageWaiting waitType = 0x00 // FaxMessageWaiting means waiting type FaxMessageWaiting waitType = 0x01 // ElectronicMailMessageWaiting means waiting type ElectronicMailMessageWaiting waitType = 0x02 // OtherMessageWaiting means waiting type OtherMessageWaiting waitType = 0x03 // DiscardMessageGSM7bit means discard the contents DiscardMessageGSM7bit waitBehavior = 0x00 // StoreMessageGSM7bit means store the contents GSM 7bit alphabet StoreMessageGSM7bit waitBehavior = 0x10 // StoreMessageUCS2 means store the contents UCS2 StoreMessageUCS2 waitBehavior = 0x20 )
Variables ¶
var ( // ErrInvalidLength show invalid length for SMS PDU data ErrInvalidLength = errors.New("invalid data length") // ErrExtraData show extra data for SMS PDU ErrExtraData = errors.New("extra data") )
var (
// Indent for String() output for each TPDU
Indent = " | "
)
var ( // TR1M timer waiting time TR1M = time.Duration(35 * time.Second) )
Functions ¶
func MakeSeparatedText ¶
MakeSeparatedText generate splited data
func MarshalUDHs ¶
func MarshalUDHs(h []UserDataHdr) []byte
MarshalUDHs ganerate binary data of this UDHs
func NextTranssactionID ¶
func NextTranssactionID() byte
NextTranssactionID make Message Transaction ID
Types ¶
type AbsentDiag ¶
type AbsentDiag int
AbsentDiag indicate Absent-User-Diagnostic-SM
const ( // NoAbsentDiag is "no diag data" NoAbsentDiag AbsentDiag = iota // NoPagingRespMSC is "no paging response via the MSC" NoPagingRespMSC // IMSIDetached is "IMSI detached" IMSIDetached // RoamingRestrict is "roaming restriction" RoamingRestrict // DeregisteredNonGPRS is "deregistered in the HLR for non GPRS" DeregisteredNonGPRS // PurgedNonGPRS is "MS purged for non GPRS" PurgedNonGPRS // NoPagingRespSGSN is "no paging response via the SGSN" NoPagingRespSGSN // GPRSDetached is "GPRS detached" GPRSDetached // DeregisteredGPRS is "deregistered in the HLR for GPRS" DeregisteredGPRS // PurgedGPRS is "MS purged for GPRS" PurgedGPRS // UnidentifiedSubsMSC is "Unidentified subscriber via the MSC" UnidentifiedSubsMSC // UnidentifiedSubsSGSN is "Unidentified subscriber via the SGSN" UnidentifiedSubsSGSN // DeregisteredIMS is "deregistered in the HSS/HLR for IMS" DeregisteredIMS // NoRespIPSMGW is "no response via the IP-SM-GW" NoRespIPSMGW TempUnavailable )
func (AbsentDiag) String ¶
func (a AbsentDiag) String() string
type Address ¶
Address is SMS originator/destination address
func UnmarshalAddress ¶
UnmarshalAddress make Address from binary data and semi-octet length
func (Address) MarshalJSON ¶
MarshalJSON provide custom marshaller
func (Address) RegexpMatch ¶
RegexpMatch check matching text of address
func (*Address) UnmarshalJSON ¶
UnmarshalJSON provide custom marshaller
type CPDU ¶
CPDU represents a SMS CP PDU
func UnmarshalCPMO ¶
UnmarshalCPMO parse byte data to CPDU.
func UnmarshalCPMT ¶
UnmarshalCPMT parse byte data to CPDU.
type Command ¶
type Command struct { SRR bool `json:"srr"` // O / Status Report Request TMR byte `json:"tmr"` // M / Message Reference for TP PID byte `json:"pid"` // M / Protocol Identifier CT byte `json:"ct"` // M / Command Type MN byte `json:"mn"` // M / Message Number DA Address `json:"da"` // M / Destination Address CD UserData `json:"cd,omitempty"` // O / Command Data // contains filtered or unexported fields }
Command is TPDU message from MS to SC
func UnmarshalCommand ¶
UnmarshalCommand decode Submit from bytes
func (Command) MarshalJSON ¶
MarshalJSON provide custom marshaller
func (*Command) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
func (*Command) UnmarshalJSON ¶
UnmarshalJSON provide custom marshaller
func (*Command) UnmarshalRP ¶
UnmarshalRP get data of this RPDU
func (*Command) UnmarshalTP ¶
UnmarshalTP get data of this TPDU
type ConcatenatedSM ¶
ConcatenatedSM is User Data Header
func UnmarshalConcatenatedSM ¶
func UnmarshalConcatenatedSM(b []byte) (h ConcatenatedSM)
UnmarshalConcatenatedSM make ConcatenatedSM UDH
func (ConcatenatedSM) Equal ¶
func (h ConcatenatedSM) Equal(b UserDataHdr) bool
Equal reports a and b are same
func (ConcatenatedSM) Marshal ¶
func (h ConcatenatedSM) Marshal() []byte
Marshal generate binary data of this UDH
func (ConcatenatedSM) String ¶
func (h ConcatenatedSM) String() string
type ConcatenatedSM16bit ¶
ConcatenatedSM16bit is User Data Header
func UnmarshalConcatenatedSM16bit ¶
func UnmarshalConcatenatedSM16bit(b []byte) (h ConcatenatedSM16bit)
UnmarshalConcatenatedSM16bit make ConcatenatedSM16bit UDH
func (ConcatenatedSM16bit) Equal ¶
func (h ConcatenatedSM16bit) Equal(b UserDataHdr) bool
Equal reports a and b are same
func (ConcatenatedSM16bit) Marshal ¶
func (h ConcatenatedSM16bit) Marshal() []byte
Marshal generate binary data of this UDH
func (ConcatenatedSM16bit) String ¶
func (h ConcatenatedSM16bit) String() string
type CpAck ¶
type CpAck struct {
TI byte `json:"ti"` // M / Transaction identifier
}
CpAck is CP-ACK CPDU
func UnmarshalAck ¶
UnmarshalAck decode Ack MT from bytes
func (*CpAck) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
type CpError ¶
type CpError struct { TI byte `json:"ti"` // M / Transaction identifier CS byte `json:"cs"` // M / Cause }
CpError is CP-ERROR CPDU
func UnmarshalError ¶
UnmarshalError decode Ack MT from bytes
func (*CpError) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
type DataCoding ¶
DataCoding indicate Data Coding Scheme
func UnmarshalDataCoding ¶
func UnmarshalDataCoding(b byte) DataCoding
UnmarshalDataCoding make DataCoding from byte data
type DataCodingMessage ¶
type DataCodingMessage struct { IsData bool MsgClass msgClass }
DataCodingMessage is group of SMS Data Coding Scheme
func (DataCodingMessage) Charset ¶
func (c DataCodingMessage) Charset() Charset
Charset returns text data charset
func (DataCodingMessage) Equal ¶
func (c DataCodingMessage) Equal(b DataCoding) bool
Equal reports a and b are same
func (DataCodingMessage) Marshal ¶
func (c DataCodingMessage) Marshal() (b byte)
Marshal make byte data
func (DataCodingMessage) String ¶
func (c DataCodingMessage) String() string
type Deliver ¶
type Deliver struct { MMS bool `json:"mms"` // M / More Messages to Send (true=more messages) LP bool `json:"lp"` // O / Loop Prevention SRI bool `json:"sri"` // O / Status Report Indication (true=status report shall be returned) RP bool `json:"rp"` // M / Reply Path OA Address `json:"oa"` // M / Originating Address PID byte `json:"pid"` // M / Protocol Identifier DCS DataCoding `json:"dcs"` // M / Data Coding Scheme SCTS time.Time `json:"scts"` // M / Service Centre Time Stamp UD UserData `json:"ud,omitempty"` // O / User Data // contains filtered or unexported fields }
Deliver is TPDU message from SC to MS
func UnmarshalDeliver ¶
UnmarshalDeliver decode Deliver from bytes
func (Deliver) MarshalJSON ¶
MarshalJSON provide custom marshaller
func (*Deliver) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
func (*Deliver) UnmarshalJSON ¶
UnmarshalJSON provide custom marshaller
func (*Deliver) UnmarshalRP ¶
UnmarshalRP get data of this RPDU
func (*Deliver) UnmarshalTP ¶
UnmarshalTP get data of this TPDU
type DeliverReport ¶
type DeliverReport struct { RMR byte `json:"rmr"` // M / Message Reference CS byte `json:"cs"` // M / Cause DIAG *byte `json:"diag,omitempty"` // O / Diagnostics FCS byte `json:"fcs,omitempty"` // C / Failure Cause PID *byte `json:"pid,omitempty"` // O / Protocol Identifier DCS DataCoding `json:"dcs,omitempty"` // O / Data Coding Scheme UD UserData `json:"ud,omitempty"` // O / User Data // contains filtered or unexported fields }
DeliverReport is TPDU message from MS to SC
func UnmarshalDeliverReport ¶
func UnmarshalDeliverReport(b []byte) (d DeliverReport, e error)
UnmarshalDeliverReport decode DeliverReport from bytes
func (DeliverReport) MarshalCP ¶
func (d DeliverReport) MarshalCP() []byte
MarshalCP output byte data of this CPDU
func (DeliverReport) MarshalJSON ¶
func (d DeliverReport) MarshalJSON() ([]byte, error)
MarshalJSON provide custom marshaller
func (DeliverReport) MarshalRP ¶
func (d DeliverReport) MarshalRP() []byte
MarshalRP output byte data of this RPDU
func (DeliverReport) MarshalTP ¶
func (d DeliverReport) MarshalTP() []byte
MarshalTP output byte data of this TPDU
func (DeliverReport) String ¶
func (d DeliverReport) String() string
func (*DeliverReport) UnmarshalCP ¶
func (d *DeliverReport) UnmarshalCP(b []byte) (e error)
UnmarshalCP get data of this CPDU
func (*DeliverReport) UnmarshalJSON ¶
func (d *DeliverReport) UnmarshalJSON(b []byte) error
UnmarshalJSON provide custom marshaller
func (*DeliverReport) UnmarshalRP ¶
func (d *DeliverReport) UnmarshalRP(b []byte) (e error)
UnmarshalRP get data of this RPDU
func (*DeliverReport) UnmarshalTP ¶
func (d *DeliverReport) UnmarshalTP(b []byte) (e error)
UnmarshalTP get data of this TPDU
type GSM7bitString ¶
type GSM7bitString []rune
GSM7bitString is GSM 7-bit default alphabet of 3GPP TS23.038
func StringToGSM7bit ¶
func StringToGSM7bit(s string) (GSM7bitString, error)
StringToGSM7bit generate GSM7bitString from string
func UnmarshalGSM7bitString ¶
func UnmarshalGSM7bitString(o, l int, b []byte) GSM7bitString
UnmarshalGSM7bitString generate GSM7bitString from byte slice with offset
func (GSM7bitString) Equal ¶
func (s GSM7bitString) Equal(b GSM7bitString) bool
Equal reports a and b are same
func (GSM7bitString) Length ¶
func (s GSM7bitString) Length() int
Length return length of the GSM 7bit String
func (GSM7bitString) Marshal ¶
func (s GSM7bitString) Marshal(o int) []byte
Marshal return byte data with offset shift
func (GSM7bitString) String ¶
func (s GSM7bitString) String() string
type GeneralDataCoding ¶
type GeneralDataCoding struct { AutoDelete bool Compressed bool MsgClass msgClass MsgCharset Charset }
GeneralDataCoding is group of SMS Data Coding Scheme
func (GeneralDataCoding) Charset ¶
func (c GeneralDataCoding) Charset() Charset
Charset returns text data charset
func (GeneralDataCoding) Equal ¶
func (c GeneralDataCoding) Equal(b DataCoding) bool
Equal reports a and b are same
func (GeneralDataCoding) Marshal ¶
func (c GeneralDataCoding) Marshal() (b byte)
Marshal make byte data
func (GeneralDataCoding) String ¶
func (c GeneralDataCoding) String() string
type GenericIEI ¶
GenericIEI is User Data Header
func UnmarshalGeneric ¶
func UnmarshalGeneric(b []byte) (h GenericIEI)
UnmarshalGeneric make Generic UDH
func (GenericIEI) Equal ¶
func (h GenericIEI) Equal(b UserDataHdr) bool
Equal reports a and b are same
func (GenericIEI) Marshal ¶
func (h GenericIEI) Marshal() []byte
Marshal generate binary data of this UDH
func (GenericIEI) String ¶
func (h GenericIEI) String() string
type MemoryAvailable ¶
type MemoryAvailable struct { RMR byte `json:"rmr"` // M / Message Reference // contains filtered or unexported fields }
MemoryAvailable is RP-SMMA RPDU
func UnmarshalMemoryAvailable ¶
func UnmarshalMemoryAvailable(b []byte) (a MemoryAvailable, e error)
UnmarshalMemoryAvailable decode MemoryAvailable MO from bytes
func (MemoryAvailable) MarshalCP ¶
func (d MemoryAvailable) MarshalCP() []byte
MarshalCP output byte data of this CPDU
func (MemoryAvailable) MarshalRP ¶
func (d MemoryAvailable) MarshalRP() []byte
MarshalRP output byte data of this RPDU
func (MemoryAvailable) String ¶
func (d MemoryAvailable) String() string
func (*MemoryAvailable) UnmarshalCP ¶
func (d *MemoryAvailable) UnmarshalCP(b []byte) (e error)
UnmarshalCP get data of this CPDU
func (*MemoryAvailable) UnmarshalRP ¶
func (d *MemoryAvailable) UnmarshalRP(b []byte) (e error)
UnmarshalRP get data of this RPDU
type MessageWaiting ¶
type MessageWaiting struct { Behavior waitBehavior Active bool WaitingType waitType }
MessageWaiting is group of SMS Data Coding Scheme
func (MessageWaiting) Charset ¶
func (c MessageWaiting) Charset() Charset
Charset returns text data charset
func (MessageWaiting) Equal ¶
func (c MessageWaiting) Equal(b DataCoding) bool
Equal reports a and b are same
func (MessageWaiting) String ¶
func (c MessageWaiting) String() string
type RPDU ¶
RPDU represents a SMS RP PDU
func UnmarshalRPMO ¶
UnmarshalRPMO parse byte data to TPDU as SC.
func UnmarshalRPMT ¶
UnmarshalRPMT parse byte data to TPDU as MS.
type RpAck ¶
type RpAck struct { RMR byte `json:"rmr"` // M / Message Reference // contains filtered or unexported fields }
RpAck is RP-ACK RPDU
type RpAckMO ¶
type RpAckMO RpAck
RpAckMO is MO RP-ACK RPDU
func UnmarshalRpAckMO ¶
UnmarshalRpAckMO decode Ack MO from bytes
func (*RpAckMO) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
func (*RpAckMO) UnmarshalRP ¶
UnmarshalRP get data of this RPDU
type RpAckMT ¶
type RpAckMT RpAck
RpAckMT is MT RP-ACK RPDU
func UnmarshalRpAckMT ¶
UnmarshalRpAckMT decode Ack MT from bytes
func (*RpAckMT) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
func (*RpAckMT) UnmarshalRP ¶
UnmarshalRP get data of this RPDU
type RpError ¶
type RpError struct { RMR byte `json:"rmr"` // M / Message Reference CS byte `json:"cs"` // M / Cause DIAG *byte `json:"diag,omitempty"` // O / Diagnostics // contains filtered or unexported fields }
RpError is RP-ERROR RPDU
type RpErrorMO ¶
type RpErrorMO RpError
RpErrorMO is MO RP-ERROR RPDU
func UnmarshalRpErrorMO ¶
UnmarshalRpErrorMO decode Error MO from bytes
func (*RpErrorMO) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
func (*RpErrorMO) UnmarshalRP ¶
UnmarshalRP get data of this RPDU
type RpErrorMT ¶
type RpErrorMT RpError
RpErrorMT is MT RP-ERROR RPDU
func UnmarshalRpErrorMT ¶
UnmarshalRpErrorMT decode Error MO from bytes
func (*RpErrorMT) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
func (*RpErrorMT) UnmarshalRP ¶
UnmarshalRP get data of this RPDU
type SMC ¶
type SMC struct { SCAddress Address CtrlReq func(CPDU) TranspInd func(TPDU) (TPDU, error) MemAvailInd func() error // contains filtered or unexported fields }
SMC is SM-CP handler
type SMR ¶
type SMR struct { SCAddress Address RelayReq func(RPDU) error TranspInd func(TPDU) (TPDU, error) MemAvailInd func() error // contains filtered or unexported fields }
SMR is SM-RP handler
type StatusReport ¶
type StatusReport struct { MMS bool `json:"mms"` // M / More Messages to Send (true=more messages) LP bool `json:"lp"` // O / Loop Prevention SRQ bool `json:"srq"` // M / Status Report Qualifier (true=status report shall be returned) TMR byte `json:"tmr"` // M / Message Reference RA Address `json:"ra"` // M / Destination Address SCTS time.Time `json:"scts"` // M / Service Centre Time Stamp DT time.Time `json:"dt"` // M / Discharge Time ST byte `json:"st"` // M / Status PID *byte `json:"pid,omitempty"` // O / Protocol Identifier DCS DataCoding `json:"dcs,omitempty"` // O / Data Coding Scheme UD UserData `json:"ud,omitempty"` // O / User Data // contains filtered or unexported fields }
StatusReport is TPDU message from SC to MS
func UnmarshalStatusReport ¶
func UnmarshalStatusReport(b []byte) (d StatusReport, e error)
UnmarshalStatusReport decode StatusReport from bytes
func (StatusReport) MarshalCP ¶
func (d StatusReport) MarshalCP() []byte
MarshalCP output byte data of this CPDU
func (StatusReport) MarshalJSON ¶
func (d StatusReport) MarshalJSON() ([]byte, error)
MarshalJSON provide custom marshaller
func (StatusReport) MarshalRP ¶
func (d StatusReport) MarshalRP() []byte
MarshalRP output byte data of this RPDU
func (StatusReport) MarshalTP ¶
func (d StatusReport) MarshalTP() []byte
MarshalTP output byte data of this TPDU
func (StatusReport) String ¶
func (d StatusReport) String() string
func (*StatusReport) UnmarshalCP ¶
func (d *StatusReport) UnmarshalCP(b []byte) (e error)
UnmarshalCP get data of this CPDU
func (*StatusReport) UnmarshalJSON ¶
func (d *StatusReport) UnmarshalJSON(b []byte) error
UnmarshalJSON provide custom marshaller
func (*StatusReport) UnmarshalRP ¶
func (d *StatusReport) UnmarshalRP(b []byte) (e error)
UnmarshalRP get data of this RPDU
func (*StatusReport) UnmarshalTP ¶
func (d *StatusReport) UnmarshalTP(b []byte) (e error)
UnmarshalTP get data of this TPDU
type Submit ¶
type Submit struct { RD bool `json:"rd"` // M / Reject Duplicates SRR bool `json:"srr"` // O / Status Report Request RP bool `json:"rp"` // M / Reply Path TMR byte `json:"tmr"` // M / Message Reference for TP DA Address `json:"da"` // M / Destination Address PID byte `json:"pid"` // M / Protocol Identifier DCS DataCoding `json:"dcs"` // M / Data Coding Scheme VP ValidityPeriod `json:"vp,omitempty"` // O / Validity Period UD UserData `json:"ud,omitempty"` // O / User Data // contains filtered or unexported fields }
Submit is TPDU message from MS to SC
func UnmarshalSubmit ¶
UnmarshalSubmit decode Submit from bytes
func (Submit) MarshalJSON ¶
MarshalJSON provide custom marshaller
func (*Submit) UnmarshalCP ¶
UnmarshalCP get data of this CPDU
func (*Submit) UnmarshalJSON ¶
UnmarshalJSON provide custom marshaller
func (*Submit) UnmarshalRP ¶
UnmarshalRP get data of this RPDU
func (*Submit) UnmarshalTP ¶
UnmarshalTP get data of this TPDU
type SubmitReport ¶
type SubmitReport struct { RMR byte `json:"rmr"` // M / Message Reference CS byte `json:"cs"` // M / Cause DIAG *byte `json:"diag,omitempty"` // O / Diagnostics FCS byte `json:"fcs,omitempty"` // C / Failure Cause SCTS time.Time `json:"scts"` // M / Service Centre Time Stamp PID *byte `json:"pid,omitempty"` // O / Protocol Identifier DCS DataCoding `json:"dcs,omitempty"` // O / Data Coding Scheme UD UserData `json:"uid,omitempty"` // O / User Data // contains filtered or unexported fields }
SubmitReport is TPDU message from SC to MS
func UnmarshalSubmitReport ¶
func UnmarshalSubmitReport(b []byte) (d SubmitReport, e error)
UnmarshalSubmitReport decode SubmitReport from bytes
func (SubmitReport) MarshalCP ¶
func (d SubmitReport) MarshalCP() []byte
MarshalCP output byte data of this CPDU
func (SubmitReport) MarshalJSON ¶
func (d SubmitReport) MarshalJSON() ([]byte, error)
MarshalJSON provide custom marshaller
func (SubmitReport) MarshalRP ¶
func (d SubmitReport) MarshalRP() []byte
MarshalRP output byte data of this RPDU
func (SubmitReport) MarshalTP ¶
func (d SubmitReport) MarshalTP() []byte
MarshalTP output byte data of this TPDU
func (SubmitReport) String ¶
func (d SubmitReport) String() string
func (*SubmitReport) UnmarshalCP ¶
func (d *SubmitReport) UnmarshalCP(b []byte) (e error)
UnmarshalCP get data of this CPDU
func (*SubmitReport) UnmarshalJSON ¶
func (d *SubmitReport) UnmarshalJSON(b []byte) error
UnmarshalJSON provide custom marshaller
func (*SubmitReport) UnmarshalRP ¶
func (d *SubmitReport) UnmarshalRP(b []byte) (e error)
UnmarshalRP get data of this RPDU
func (*SubmitReport) UnmarshalTP ¶
func (d *SubmitReport) UnmarshalTP(b []byte) (e error)
UnmarshalTP get data of this TPDU
type TPDU ¶
TPDU represents a SMS TP PDU
func UnmarshalTPMO ¶
UnmarshalTPMO parse byte data to TPDU as SC.
func UnmarshalTPMT ¶
UnmarshalTPMT parse byte data to TPDU as MS.
type UnexpectedInformationElementError ¶
type UnexpectedInformationElementError struct {
Expected, Actual byte
}
UnexpectedInformationElementError show invalid SMS IE
func (UnexpectedInformationElementError) Error ¶
func (e UnexpectedInformationElementError) Error() string
type UnexpectedMessageTypeError ¶
type UnexpectedMessageTypeError struct {
Expected, Actual byte
}
UnexpectedMessageTypeError show invalid SMS PDU type
func (UnexpectedMessageTypeError) Error ¶
func (e UnexpectedMessageTypeError) Error() string
type UnknownDataCodingError ¶
type UnknownDataCodingError struct {
DCS byte
}
UnknownDataCodingError show invalid DCS
func (UnknownDataCodingError) Error ¶
func (e UnknownDataCodingError) Error() string
type UnknownGSM7bitRuneError ¶
type UnknownGSM7bitRuneError struct {
R rune
}
UnknownGSM7bitRuneError show invalid rune for GSM 7bit string
func (UnknownGSM7bitRuneError) Error ¶
func (e UnknownGSM7bitRuneError) Error() string
type UnknownMessageTypeError ¶
type UnknownMessageTypeError struct {
Actual byte
}
UnknownMessageTypeError show invalid SMS PDU type
func (UnknownMessageTypeError) Error ¶
func (e UnknownMessageTypeError) Error() string
type UnmarshalerCP ¶
UnmarshalerCP is the interface implemented by types that can unmarshal a CPDU
type UnmarshalerRP ¶
UnmarshalerRP is the interface implemented by types that can unmarshal a RPDU
type UnmarshalerTP ¶
UnmarshalerTP is the interface implemented by types that can unmarshal a TPDU
type UserData ¶
type UserData struct { Text string `json:"text,omitempty"` UDH []UserDataHdr `json:"hdr,omitempty"` }
UserData is TP-UD
func (UserData) Get8bitData ¶
Get8bitData set binary data as UD
func (UserData) MarshalJSON ¶
MarshalJSON provide custom marshaller
func (*UserData) Set8bitData ¶
Set8bitData set binary data as UD
func (*UserData) UnmarshalJSON ¶
UnmarshalJSON provide custom marshaller
type UserDataHdr ¶
type UserDataHdr interface { Marshal() []byte // unmarshal([]byte) fmt.Stringer Key() byte Value() []byte Equal(UserDataHdr) bool }
UserDataHdr is user data header
type VPAbsolute ¶
type VPAbsolute [7]byte
VPAbsolute is absolute format VP value
func (VPAbsolute) Duration ¶
func (f VPAbsolute) Duration() time.Duration
Duration return duration to expire time
func (VPAbsolute) Equal ¶
func (f VPAbsolute) Equal(b ValidityPeriod) bool
Equal reports a and b are same
func (VPAbsolute) ExpireTime ¶
func (f VPAbsolute) ExpireTime(t time.Time) time.Time
ExpireTime return expire time
func (VPAbsolute) SingleAttempt ¶
func (f VPAbsolute) SingleAttempt() bool
SingleAttempt return single attempt is required or not
func (VPAbsolute) String ¶
func (f VPAbsolute) String() string
type VPEnhanced ¶
type VPEnhanced [7]byte
VPEnhanced is enhanced format VP value
func (VPEnhanced) Duration ¶
func (f VPEnhanced) Duration() time.Duration
Duration return duration to expire time
func (VPEnhanced) Equal ¶
func (f VPEnhanced) Equal(b ValidityPeriod) bool
Equal reports a and b are same
func (VPEnhanced) ExpireTime ¶
func (f VPEnhanced) ExpireTime(t time.Time) time.Time
ExpireTime return expire time
func (VPEnhanced) SingleAttempt ¶
func (f VPEnhanced) SingleAttempt() bool
SingleAttempt return single attempt is required or not
func (VPEnhanced) String ¶
func (f VPEnhanced) String() string
type VPRelative ¶
type VPRelative byte
VPRelative is relative format VP value
func (VPRelative) Duration ¶
func (f VPRelative) Duration() time.Duration
Duration return duration to expire time
func (VPRelative) Equal ¶
func (f VPRelative) Equal(b ValidityPeriod) bool
Equal reports a and b are same
func (VPRelative) ExpireTime ¶
func (f VPRelative) ExpireTime(t time.Time) time.Time
ExpireTime return expire time
func (VPRelative) SingleAttempt ¶
func (f VPRelative) SingleAttempt() bool
SingleAttempt return single attempt is required or not
func (VPRelative) String ¶
func (f VPRelative) String() string
type ValidityPeriod ¶
type ValidityPeriod interface { fmt.Stringer ExpireTime(t time.Time) time.Time Duration() time.Duration SingleAttempt() bool Equal(ValidityPeriod) bool }
ValidityPeriod is type of validity period
func ValidityPeriodOf ¶
func ValidityPeriodOf(t time.Duration, s bool) ValidityPeriod
ValidityPeriodOf returns VP from deadend time and single-attempt flag
Source Files ¶
- absentdiag.go
- address.go
- cp_ack.go
- cp_error.go
- cpdu.go
- data_coding.go
- description.go
- error.go
- gsm7bitalphabet.go
- rp_ack.go
- rp_error.go
- rp_smma.go
- rpdu.go
- smc.go
- smr.go
- timestamp.go
- tp_command.go
- tp_deliver.go
- tp_deliverreport.go
- tp_statusreport.go
- tp_submit.go
- tp_submitreport.go
- tpdu.go
- userdata.go
- userdata_header.go
- validity_period.go