Class: SensorSample
- Inherits:
-
Object
- Object
- SensorSample
- Defined in:
- lib/libowl/sensor_sample.rb
Overview
Sensor sample format
Instance Attribute Summary collapse
-
#device_id ⇒ Object
Returns the value of attribute device_id.
-
#phy_layer ⇒ Object
Returns the value of attribute phy_layer.
-
#receiver_id ⇒ Object
Returns the value of attribute receiver_id.
-
#rssi ⇒ Object
Returns the value of attribute rssi.
-
#sense_data ⇒ Object
Returns the value of attribute sense_data.
-
#timestamp ⇒ Object
Returns the value of attribute timestamp.
Instance Method Summary collapse
-
#initialize(phy, device_id, receiver_id, timestamp, rssi, sense_data) ⇒ SensorSample
constructor
A new instance of SensorSample.
- #to_s ⇒ Object
Constructor Details
#initialize(phy, device_id, receiver_id, timestamp, rssi, sense_data) ⇒ SensorSample
Returns a new instance of SensorSample.
5 6 7 8 9 10 11 12 |
# File 'lib/libowl/sensor_sample.rb', line 5 def initialize(phy, device_id, receiver_id, , rssi, sense_data) @phy_layer = phy @device_id = device_id @receiver_id = receiver_id @timestamp = @rssi = rssi @sense_data = sense_data end |
Instance Attribute Details
#device_id ⇒ Object
Returns the value of attribute device_id.
3 4 5 |
# File 'lib/libowl/sensor_sample.rb', line 3 def device_id @device_id end |
#phy_layer ⇒ Object
Returns the value of attribute phy_layer.
3 4 5 |
# File 'lib/libowl/sensor_sample.rb', line 3 def phy_layer @phy_layer end |
#receiver_id ⇒ Object
Returns the value of attribute receiver_id.
3 4 5 |
# File 'lib/libowl/sensor_sample.rb', line 3 def receiver_id @receiver_id end |
#rssi ⇒ Object
Returns the value of attribute rssi.
3 4 5 |
# File 'lib/libowl/sensor_sample.rb', line 3 def rssi @rssi end |
#sense_data ⇒ Object
Returns the value of attribute sense_data.
3 4 5 |
# File 'lib/libowl/sensor_sample.rb', line 3 def sense_data @sense_data end |
#timestamp ⇒ Object
Returns the value of attribute timestamp.
3 4 5 |
# File 'lib/libowl/sensor_sample.rb', line 3 def @timestamp end |
Instance Method Details
#to_s ⇒ Object
14 15 16 |
# File 'lib/libowl/sensor_sample.rb', line 14 def to_s() return "#{@timestamp}: (phy #{@phy_layer}) #{@device_id} -> #{@receiver_id}, RSS:#{@rssi}, Datalength:#{@sense_data.length} Data:#{@sense_data.unpack('C*').join(', ')}" end |