Class: Orion6Rep::MultiMessageCommand
- Defined in:
- lib/orion6_rep/multi_message_command.rb
Direct Known Subclasses
Instance Method Summary collapse
Methods inherited from Command
convert_to_integer_as_big_endian, convert_to_integer_as_little_endian, xor
Instance Method Details
#execute ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/orion6_rep/multi_message_command.rb', line 23 def execute # calculate how many messages will be needed: = get_field_quantity / get_field_size = get_field_quantity % get_field_size payload = "" @messages_sent = 0 .times do command_data = payload += (command_data) # For some very obscure reason, on each received message the next # command must increased by the size of the received payload. # Go figure... @command += payload.size @messages_sent += 1 end if > 0 command_data = generate_remainder_header() payload += (command_data) end return get_data_from_response(payload) end |