Class: Majoron::AntHill::SMPP::SMPPOutbind

Inherits:
SMPPPDU
  • Object
show all
Defined in:
lib/pdu/smpp_outbind.rb

Instance Attribute Summary collapse

Attributes inherited from SMPPPDU

#header

Instance Method Summary collapse

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

Returns a new instance of SMPPOutbind.



23
24
25
# File 'lib/pdu/smpp_outbind.rb', line 23

def initialize(command_status = ErrorCode::ESME_ROK, sequence_number = nil)
	super(CommandId::CM_OUTBIND, command_status, sequence_number)
end

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



62
63
64
# File 'lib/pdu/smpp_outbind.rb', line 62

def password
  @password
end

#system_idObject

Mandatory fields



61
62
63
# File 'lib/pdu/smpp_outbind.rb', line 61

def system_id
  @system_id
end

Instance Method Details

#decode_packet(decoder) ⇒ Object

Interface to decode SMPP packet



36
37
38
39
40
41
# File 'lib/pdu/smpp_outbind.rb', line 36

def decode_packet(decoder)
	# Decode header and mandatory fields
	@header = decoder.decode_header()
	@system_id = decoder.decode_system_id(command_length())
	@password = decoder.decode_password(command_length())
end

#encode_packet(encoder) ⇒ Object

Interface to encode SMPP packet



28
29
30
31
32
33
# File 'lib/pdu/smpp_outbind.rb', line 28

def encode_packet(encoder)
	# Encode header and mandatory fields
	encoder.encode_header(@header)
	encoder.encode_system_id(@system_id)
	encoder.encode_password(@password)
end

#output_packet(outputter) ⇒ Object

Interface to output SMPP packet



52
53
54
55
56
57
# File 'lib/pdu/smpp_outbind.rb', line 52

def output_packet(outputter)
	# Output header and mandatory fields
	outputter.output_header(@header)
	outputter.output_system_id(@system_id)
	outputter.output_password(@password)
end

#validate_packet(validator) ⇒ Object

Interface to validate SMPP packet



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

def validate_packet(validator)
	# Validate header and mandatory fields
	validator.validate_header(@header)
	validator.validate_system_id(@system_id)
	validator.validate_password(@password)
end