Class: Majoron::AntHill::SMPP::SMPPSubmitMultiResp

Inherits:
SMPPResp show all
Defined in:
lib/pdu/smpp_submit_multi_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) ⇒ SMPPSubmitMultiResp

Constructor.



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

def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil)
	super(CommandId::CM_SUBMIT_MULTI_RESP, command_status, sequence_number)
  
	# Mandatory fields
	@message_id= ""
	@no_unsuccess = 0
	@unsuccess_smes = []
end

Instance Attribute Details

#message_idObject

Mandatory fields



79
80
81
# File 'lib/pdu/smpp_submit_multi_resp.rb', line 79

def message_id
  @message_id
end

#no_unsuccessObject

Returns the value of attribute no_unsuccess.



80
81
82
# File 'lib/pdu/smpp_submit_multi_resp.rb', line 80

def no_unsuccess
  @no_unsuccess
end

#unsuccess_smesObject

Returns the value of attribute unsuccess_smes.



81
82
83
# File 'lib/pdu/smpp_submit_multi_resp.rb', line 81

def unsuccess_smes
  @unsuccess_smes
end

Instance Method Details

#decode_packet(decoder) ⇒ Object

Interface to decode SMPP packet



43
44
45
46
47
48
49
50
# File 'lib/pdu/smpp_submit_multi_resp.rb', line 43

def decode_packet(decoder)
	# Decode header and mandatory fields
	@header = decoder.decode_header()
	@message_id = decoder.decode_message_id(command_length())
	@no_unsuccess = decoder.decode_no_unsuccess(command_length())
	@unsuccess_smes = decoder.decode_unsuccess_smes(@no_unsuccess, command_length())
  
end

#encode_packet(encoder) ⇒ Object

Interface to encode SMPP packet



34
35
36
37
38
39
40
# File 'lib/pdu/smpp_submit_multi_resp.rb', line 34

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

#output_packet(outputter) ⇒ Object

Interface to output SMPP packet



62
63
64
65
66
67
68
# File 'lib/pdu/smpp_submit_multi_resp.rb', line 62

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

#validate_packet(validator) ⇒ Object

Interface to validate SMPP packet



53
54
55
56
57
58
59
# File 'lib/pdu/smpp_submit_multi_resp.rb', line 53

def validate_packet(validator)
	# Validate header and mandatory fields
	validator.validate_header(@header)
	validator.validate_message_id(@message_id)
	validator.validate_no_unsuccess(@no_unsuccess)
	validator.validate_unsuccess_smes(@unsuccess_smes, @no_unsuccess)
end