Class: Majoron::AntHill::SMPP::SMPPQuerySMResp
- Defined in:
- lib/pdu/smpp_query_sm_resp.rb
Instance Attribute Summary collapse
-
#error_code ⇒ Object
Returns the value of attribute error_code.
-
#final_date ⇒ Object
Returns the value of attribute final_date.
-
#message_id ⇒ Object
Mandatory fields.
-
#message_state ⇒ Object
Returns the value of attribute message_state.
Attributes inherited from SMPPPDU
Instance Method Summary collapse
-
#decode_packet(decoder) ⇒ Object
Interface to decode SMPP packet.
-
#encode_packet(encoder) ⇒ Object
Interface to encode SMPP packet.
-
#initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil) ⇒ SMPPQuerySMResp
constructor
Constructor.
-
#output_packet(outputter) ⇒ Object
Interface to output SMPP packet.
-
#validate_packet(validator) ⇒ Object
Interface to validate SMPP packet.
Methods inherited from SMPPResp
Methods inherited from SMPPPDU
#command_id, #command_length, #command_status, #command_status=, #sequence_number, #sequence_number=
Constructor Details
#initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil) ⇒ SMPPQuerySMResp
Constructor.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 24 def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil) super(CommandId::CM_QUERY_SM_RESP, command_status, sequence_number) # Mandatory fields @message_id = "" @final_date = "" @message_state = MessageState::UNKNOWN @error_code = 0 # Optional fields # Optional fields length end |
Instance Attribute Details
#error_code ⇒ Object
Returns the value of attribute error_code.
84 85 86 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 84 def error_code @error_code end |
#final_date ⇒ Object
Returns the value of attribute final_date.
82 83 84 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 82 def final_date @final_date end |
#message_id ⇒ Object
Mandatory fields
81 82 83 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 81 def @message_id end |
#message_state ⇒ Object
Returns the value of attribute message_state.
83 84 85 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 83 def @message_state end |
Instance Method Details
#decode_packet(decoder) ⇒ Object
Interface to decode SMPP packet
50 51 52 53 54 55 56 57 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 50 def decode_packet(decoder) # Decode header and mandatory fields @header = decoder.decode_header() @message_id = decoder.(command_length()) @final_date = decoder.decode_final_date(command_length()) @message_state = decoder.(command_length()) @error_code = decoder.decode_error_code(command_length()) end |
#encode_packet(encoder) ⇒ Object
Interface to encode SMPP packet
40 41 42 43 44 45 46 47 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 40 def encode_packet(encoder) # Encode header and mandatory fields encoder.encode_header(@header) encoder.(@message_id) encoder.encode_final_date(@final_date) encoder.(@message_state) encoder.encode_error_code(@error_code) end |
#output_packet(outputter) ⇒ Object
Interface to output SMPP packet
70 71 72 73 74 75 76 77 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 70 def output_packet(outputter) # Output header and mandatory fields outputter.output_header(@header) outputter.(@message_id) outputter.output_final_date(@final_date) outputter.(@message_state) outputter.output_error_code(@error_code) end |
#validate_packet(validator) ⇒ Object
Interface to validate SMPP packet
60 61 62 63 64 65 66 67 |
# File 'lib/pdu/smpp_query_sm_resp.rb', line 60 def validate_packet(validator) # Validate header and mandatory fields validator.validate_header(@header) validator.(@message_id) validator.validate_final_date(@final_date) validator.(@message_state) validator.validate_error_code(@error_code) end |