Class: Empp::MsgDeliveryResp

Inherits:
EmppBase show all
Defined in:
lib/empp/msg_delivery_resp.rb

Instance Attribute Summary collapse

Attributes inherited from EmppBase

#command_id, #sequence_id, #total_length

Instance Method Summary collapse

Constructor Details

#initializeMsgDeliveryResp

Returns a new instance of MsgDeliveryResp.



12
13
14
15
16
17
# File 'lib/empp/msg_delivery_resp.rb', line 12

def initialize
  @command_id = Constants::EMPP_DELIVER_RESP
  @result = 0
  @total_length = 12 + 10 + 4
  setSequenceId
end

Instance Attribute Details

#msg_idObject

Returns the value of attribute msg_id.



10
11
12
# File 'lib/empp/msg_delivery_resp.rb', line 10

def msg_id
  @msg_id
end

Instance Method Details

#packageObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'lib/empp/msg_delivery_resp.rb', line 19

def package
  buf = Utils::ByteBuffer.new
  # add header
  buf.append_uint_be(@total_length)

  buf.append_uint_be(@command_id)
  buf.append_uint_be(@sequence_id)
  buf.append_string(@msg_id)
  buf.append_string("\0\0\0\0")

  buf.data

end