class XBee::Frames::DataSampleRXIndicator
Constants
- OPTION_BITS
Attributes
address16[R]
address64[R]
options[R]
samples[R]
- Array<Data::DataSample>
-
Array of sample objects
Public Class Methods
new(packet: nil)
click to toggle source
Calls superclass method
# File lib/xbee/frames/data_sample_rx_indicator.rb, line 24 def initialize(packet: nil) @samples = [] super if @parse_bytes @address64 = Address64.new *@parse_bytes.shift(8) @address16 = Address16.new *@parse_bytes.shift(2) @options = @parse_bytes.shift @number_of_samples = @parse_bytes.shift @number_of_samples.times do @samples << Data::Sample.new(parse_bytes: @parse_bytes) end end end
Public Instance Methods
bytes()
click to toggle source
Calls superclass method
# File lib/xbee/frames/data_sample_rx_indicator.rb, line 41 def bytes super + (address64 || Address64::COORDINATOR).to_a + (address16 || Address16::COORDINATOR).to_a + [options || 0x00] + [(samples || []).length] + samples.map(&:to_a).reduce(:+) end