Class: Smpp::Pdu::BindBase
Overview
this class serves as the base for all the bind* commands. since the command format remains the same for all bind commands, sub classes just change the @@command_id
Direct Known Subclasses
Constant Summary
Constants inherited from Base
Smpp::Pdu::Base::BIND_RECEIVER, Smpp::Pdu::Base::BIND_RECEIVER_RESP, Smpp::Pdu::Base::BIND_TRANSCEIVER, Smpp::Pdu::Base::BIND_TRANSCEIVER_RESP, Smpp::Pdu::Base::BIND_TRANSMITTER, Smpp::Pdu::Base::BIND_TRANSMITTER_RESP, Smpp::Pdu::Base::CANCEL_SM, Smpp::Pdu::Base::CANCEL_SM_RESP, Smpp::Pdu::Base::DELIVER_SM, Smpp::Pdu::Base::DELIVER_SM_RESP, Smpp::Pdu::Base::ENQUIRE_LINK, Smpp::Pdu::Base::ENQUIRE_LINK_RESP, Smpp::Pdu::Base::ESME_RALYBND, Smpp::Pdu::Base::ESME_RBINDFAIL, Smpp::Pdu::Base::ESME_RCANCELFAIL, Smpp::Pdu::Base::ESME_RCNTSUBDL, Smpp::Pdu::Base::ESME_RINVBNDSTS, Smpp::Pdu::Base::ESME_RINVCMDID, Smpp::Pdu::Base::ESME_RINVCMDLEN, Smpp::Pdu::Base::ESME_RINVDESTFLAG, Smpp::Pdu::Base::ESME_RINVDLNAME, Smpp::Pdu::Base::ESME_RINVDSTADR, Smpp::Pdu::Base::ESME_RINVDSTNPI, Smpp::Pdu::Base::ESME_RINVDSTTON, Smpp::Pdu::Base::ESME_RINVESMCLASS, Smpp::Pdu::Base::ESME_RINVMSGID, Smpp::Pdu::Base::ESME_RINVMSGLEN, Smpp::Pdu::Base::ESME_RINVNUMDESTS, Smpp::Pdu::Base::ESME_RINVNUMMSGS, Smpp::Pdu::Base::ESME_RINVPASWD, Smpp::Pdu::Base::ESME_RINVPRTFLG, Smpp::Pdu::Base::ESME_RINVREGDLVFLG, Smpp::Pdu::Base::ESME_RINVREPFLAG, Smpp::Pdu::Base::ESME_RINVSERTYP, Smpp::Pdu::Base::ESME_RINVSRCADR, Smpp::Pdu::Base::ESME_RINVSRCNPI, Smpp::Pdu::Base::ESME_RINVSRCTON, Smpp::Pdu::Base::ESME_RINVSUBREP, Smpp::Pdu::Base::ESME_RINVSYSID, Smpp::Pdu::Base::ESME_RINVSYSTYP, Smpp::Pdu::Base::ESME_RMSGQFUL, Smpp::Pdu::Base::ESME_ROK, Smpp::Pdu::Base::ESME_RREPLACEFAIL, Smpp::Pdu::Base::ESME_RSUBMITFAIL, Smpp::Pdu::Base::ESME_RSYSERR, Smpp::Pdu::Base::ESME_RTHROTTLED, Smpp::Pdu::Base::ESME_RX_T_APPN, Smpp::Pdu::Base::GENERIC_NACK, Smpp::Pdu::Base::OPTIONAL_MESSAGE_STATE, Smpp::Pdu::Base::OPTIONAL_RECEIPTED_MESSAGE_ID, Smpp::Pdu::Base::PROTOCOL_VERSION, Smpp::Pdu::Base::QUERY_SM, Smpp::Pdu::Base::QUERY_SM_RESP, Smpp::Pdu::Base::REPLACE_SM, Smpp::Pdu::Base::REPLACE_SM_RESP, Smpp::Pdu::Base::SEQUENCE_MAX, Smpp::Pdu::Base::SUBMIT_MULTI, Smpp::Pdu::Base::SUBMIT_MULTI_RESP, Smpp::Pdu::Base::SUBMIT_SM, Smpp::Pdu::Base::SUBMIT_SM_RESP, Smpp::Pdu::Base::UNBIND, Smpp::Pdu::Base::UNBIND_RESP
Class Attribute Summary collapse
-
.command_id ⇒ Object
Returns the value of attribute command_id.
Instance Attribute Summary collapse
-
#addr_npi ⇒ Object
readonly
Returns the value of attribute addr_npi.
-
#addr_ton ⇒ Object
readonly
Returns the value of attribute addr_ton.
-
#address_range ⇒ Object
readonly
Returns the value of attribute address_range.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#system_id ⇒ Object
readonly
Returns the value of attribute system_id.
-
#system_type ⇒ Object
readonly
Returns the value of attribute system_type.
Attributes inherited from Base
#body, #command_id, #command_status, #data, #sequence_number
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(system_id, password, system_type, addr_ton, addr_npi, address_range, seq = nil) ⇒ BindBase
constructor
A new instance of BindBase.
Methods inherited from Base
create, fixed_int, #fixed_int, handles_cmd, #logger, next_sequence_number, #next_sequence_number, #optional_parameters_to_buffer, optional_parameters_to_buffer, parse_optional_parameters, #to_human
Constructor Details
#initialize(system_id, password, system_type, addr_ton, addr_npi, address_range, seq = nil) ⇒ BindBase
Returns a new instance of BindBase.
9 10 11 12 13 14 15 16 |
# File 'lib/smpp/pdu/bind_base.rb', line 9 def initialize(system_id, password, system_type, addr_ton, addr_npi, address_range, seq = nil) @system_id, @password, @system_type, @addr_ton, @addr_npi, @address_range = system_id, password, system_type, addr_ton, addr_npi, address_range seq ||= next_sequence_number body = sprintf("%s\0%s\0%s\0%c%c%c%s\0", system_id, password,system_type, PROTOCOL_VERSION, addr_ton, addr_npi, address_range) super(self.class.command_id, 0, seq, body) end |
Class Attribute Details
.command_id ⇒ Object
Returns the value of attribute command_id.
5 6 7 |
# File 'lib/smpp/pdu/bind_base.rb', line 5 def command_id @command_id end |
Instance Attribute Details
#addr_npi ⇒ Object (readonly)
Returns the value of attribute addr_npi.
7 8 9 |
# File 'lib/smpp/pdu/bind_base.rb', line 7 def addr_npi @addr_npi end |
#addr_ton ⇒ Object (readonly)
Returns the value of attribute addr_ton.
7 8 9 |
# File 'lib/smpp/pdu/bind_base.rb', line 7 def addr_ton @addr_ton end |
#address_range ⇒ Object (readonly)
Returns the value of attribute address_range.
7 8 9 |
# File 'lib/smpp/pdu/bind_base.rb', line 7 def address_range @address_range end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
7 8 9 |
# File 'lib/smpp/pdu/bind_base.rb', line 7 def password @password end |
#system_id ⇒ Object (readonly)
Returns the value of attribute system_id.
7 8 9 |
# File 'lib/smpp/pdu/bind_base.rb', line 7 def system_id @system_id end |
#system_type ⇒ Object (readonly)
Returns the value of attribute system_type.
7 8 9 |
# File 'lib/smpp/pdu/bind_base.rb', line 7 def system_type @system_type end |
Class Method Details
.from_wire_data(seq, status, body) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/smpp/pdu/bind_base.rb', line 18 def self.from_wire_data(seq, status, body) #unpack the body system_id, password, system_type, interface_version, addr_ton, addr_npi, address_range = body.unpack("Z*Z*Z*CCCZ*") self.new(system_id, password, system_type, addr_ton, addr_npi, address_range, seq) end |