Documentation ¶
Overview ¶
Package pdufield provides PDU field codecs and utilities.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Body ¶
type Body interface { Len() int Raw() interface{} String() string Bytes() []byte SerializeTo(w io.Writer) error }
Body is an interface for manipulating binary PDU field data.
type DeliverySetting ¶
type DeliverySetting uint8
DeliverySetting is used to configure registered delivery for short messages.
const ( NoDeliveryReceipt DeliverySetting = 0x00 FinalDeliveryReceipt DeliverySetting = 0x01 FailureDeliveryReceipt DeliverySetting = 0x02 )
Supported delivery settings.
type DestSme ¶
DestSme is a PDU field used for an sme addreses.
func (*DestSme) SerializeTo ¶
SerializeTo implements the Data interface.
type DestSmeList ¶
type DestSmeList struct {
Data []DestSme
}
DestSmeList contains a list of DestSme
func (*DestSmeList) Bytes ¶
func (dsl *DestSmeList) Bytes() []byte
Bytes implements the Data interface.
func (*DestSmeList) Raw ¶
func (dsl *DestSmeList) Raw() interface{}
Raw implements the Data interface.
func (*DestSmeList) SerializeTo ¶
func (dsl *DestSmeList) SerializeTo(w io.Writer) error
SerializeTo implements the Data interface.
func (*DestSmeList) String ¶
func (dsl *DestSmeList) String() string
String implements the Data interface.
type Fixed ¶
type Fixed struct {
Data uint8
}
Fixed is a PDU of fixed length.
func (*Fixed) SerializeTo ¶
SerializeTo implements the Data interface.
type Map ¶
Map is a collection of PDU field data indexed by name.
func (Map) Set ¶
Set updates the PDU map with the given key and value, and returns error if the value cannot be converted to type Data.
This is a shortcut for m[k] = New(k, v) converting v properly.
If k is ShortMessage and v is of type pdutext.Codec, text is encoded and data_coding PDU and sm_length PDUs are set.
type Name ¶
type Name string
Name is the name of a PDU field.
const ( AddrNPI Name = "addr_npi" AddrTON Name = "addr_ton" AddressRange Name = "address_range" DataCoding Name = "data_coding" DestAddrNPI Name = "dest_addr_npi" DestAddrTON Name = "dest_addr_ton" DestinationAddr Name = "destination_addr" DestinationList Name = "dest_addresses" ESMClass Name = "esm_class" ErrorCode Name = "error_code" FinalDate Name = "final_date" InterfaceVersion Name = "interface_version" MessageID Name = "message_id" MessageState Name = "message_state" NumberDests Name = "number_of_dests" NoUnsuccess Name = "no_unsuccess" Password Name = "password" PriorityFlag Name = "priority_flag" ProtocolID Name = "protocol_id" RegisteredDelivery Name = "registered_delivery" ReplaceIfPresentFlag Name = "replace_if_present_flag" SMDefaultMsgID Name = "sm_default_msg_id" SMLength Name = "sm_length" ScheduleDeliveryTime Name = "schedule_delivery_time" ServiceType Name = "service_type" ShortMessage Name = "short_message" SourceAddr Name = "source_addr" SourceAddrNPI Name = "source_addr_npi" SourceAddrTON Name = "source_addr_ton" SystemID Name = "system_id" SystemType Name = "system_type" UDHLength Name = "gsm_sms_ud.udh.len" GSMUserData Name = "gsm_sms_ud.udh" UnsuccessSme Name = "unsuccess_sme" ValidityPeriod Name = "validity_period" )
Supported PDU field names.
type SM ¶
type SM struct {
Data []byte
}
SM is a PDU field used for Short Messages.
func (*SM) SerializeTo ¶
SerializeTo implements the Data interface.
type UDH ¶
UDH is a PDU field used for user data header.
func (*UDH) SerializeTo ¶
SerializeTo implements the Data interface.
type UDHList ¶
type UDHList struct {
Data []UDH
}
UDHList contains a list of UDH.
func (*UDHList) SerializeTo ¶
SerializeTo implements the Data interface.
type UnSme ¶
UnSme is a PDU field used for unsuccess sme addreses.
func (*UnSme) SerializeTo ¶
SerializeTo implements the Data interface.
type UnSmeList ¶
type UnSmeList struct {
Data []UnSme
}
UnSmeList contains a list of UnSme
func (*UnSmeList) SerializeTo ¶
SerializeTo implements the Data interface.
type Variable ¶
type Variable struct {
Data []byte
}
Variable is a PDU field of variable length.
func (*Variable) SerializeTo ¶
SerializeTo implements the Data interface.