class Smpp::Pdu::BindBase
this class serves as the base for all the bind* commands. since the command format remains the same for all bind commands, sub classes just change the @@command_id
Attributes
command_id[RW]
addr_npi[R]
addr_ton[R]
address_range[R]
password[R]
system_id[R]
system_type[R]
Public Class Methods
from_wire_data(seq, status, body)
click to toggle source
# File lib/smpp/pdu/bind_base.rb, line 18 def self.from_wire_data(seq, status, body) #unpack the body system_id, password, system_type, interface_version, addr_ton, addr_npi, address_range = body.unpack("Z*Z*Z*CCCZ*") self.new(system_id, password, system_type, addr_ton, addr_npi, address_range, seq) end
new(system_id, password, system_type, addr_ton, addr_npi, address_range, seq = nil)
click to toggle source
Calls superclass method
Smpp::Pdu::Base::new
# File lib/smpp/pdu/bind_base.rb, line 9 def initialize(system_id, password, system_type, addr_ton, addr_npi, address_range, seq = nil) @system_id, @password, @system_type, @addr_ton, @addr_npi, @address_range = system_id, password, system_type, addr_ton, addr_npi, address_range seq ||= next_sequence_number body = sprintf("%s\0%s\0%s\0%c%c%c%s\0", system_id, password,system_type, PROTOCOL_VERSION, addr_ton, addr_npi, address_range) super(self.class.command_id, 0, seq, body) end