Class: Majoron::AntHill::SMPP::SMPPSubmitSMResp

Inherits:
SMPPResp show all
Defined in:
lib/pdu/smpp_submit_sm_resp.rb

Instance Attribute Summary collapse

Attributes inherited from SMPPPDU

#header

Instance Method Summary collapse

Methods inherited from SMPPResp

#init

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) ⇒ SMPPSubmitSMResp

Constructor.



25
26
27
28
29
30
31
# File 'lib/pdu/smpp_submit_sm_resp.rb', line 25

def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil)
	super(CommandId::CM_SUBMIT_SM_RESP, command_status, sequence_number)
  
	# Mandatory fields
	@message_id = ""
  
end

Instance Attribute Details

#message_idObject

Mandatory fields



63
64
65
# File 'lib/pdu/smpp_submit_sm_resp.rb', line 63

def message_id
  @message_id
end

Instance Method Details

#decode_packet(decoder) ⇒ Object

Interface to decode SMPP packet



41
42
43
44
45
# File 'lib/pdu/smpp_submit_sm_resp.rb', line 41

def decode_packet(decoder)
	# Decode header and mandatory fields
	@header = decoder.decode_header()
	@message_id = decoder.decode_message_id(command_length())
end

#encode_packet(encoder) ⇒ Object

Interface to encode SMPP packet



34
35
36
37
38
# File 'lib/pdu/smpp_submit_sm_resp.rb', line 34

def encode_packet(encoder)
	# Encode header and mandatory fields
	encoder.encode_header(@header)
	encoder.encode_message_id(@message_id)
end

#output_packet(outputter) ⇒ Object

Interface to output SMPP packet



55
56
57
58
59
# File 'lib/pdu/smpp_submit_sm_resp.rb', line 55

def output_packet(outputter)
	# Output header and mandatory fields
	outputter.output_header(@header)
	outputter.output_message_id(@message_id)
end

#validate_packet(validator) ⇒ Object

Interface to validate SMPP packet



48
49
50
51
52
# File 'lib/pdu/smpp_submit_sm_resp.rb', line 48

def validate_packet(validator)
	# Validate header and mandatory fields
	validator.validate_header(@header)
	validator.validate_message_id(@message_id)
end