Class: Smpp::Pdu::BindRespBase

Inherits:
Base
  • Object
show all
Defined in:
lib/smpp/pdu/bind_resp_base.rb

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

Instance Attribute Summary collapse

Attributes inherited from Base

#body, #command_id, #command_status, #data, #sequence_number

Class Method Summary collapse

Instance Method Summary collapse

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(seq, status, system_id) ⇒ BindRespBase

Returns a new instance of BindRespBase.



5
6
7
8
9
10
# File 'lib/smpp/pdu/bind_resp_base.rb', line 5

def initialize(seq, status, system_id)
  seq ||= next_sequence_number
  system_id = system_id.to_s + "\000"
  super(self.class.command_id, status, seq, system_id) # pass in system_id as body for simple debugging
  @system_id = system_id
end

Class Attribute Details

.command_idObject

Returns the value of attribute command_id.



2
3
4
# File 'lib/smpp/pdu/bind_resp_base.rb', line 2

def command_id
  @command_id
end

Instance Attribute Details

#system_idObject

Returns the value of attribute system_id.



3
4
5
# File 'lib/smpp/pdu/bind_resp_base.rb', line 3

def system_id
  @system_id
end

Class Method Details

.from_wire_data(seq, status, body) ⇒ Object



12
13
14
15
# File 'lib/smpp/pdu/bind_resp_base.rb', line 12

def self.from_wire_data(seq, status, body)
  system_id = body.chomp("\000")
  new(seq, status, system_id)
end