Class: Sphero::Response::GetPowerState
- Inherits:
-
Sphero::Response
- Object
- Sphero::Response
- Sphero::Response::GetPowerState
- Defined in:
- lib/sphero/response.rb
Direct Known Subclasses
Constant Summary collapse
- CHARGING =
constants for power_state
0x01
- OK =
0x02
- LOW =
0x03
- CRITICAL =
0x04
Constants inherited from Sphero::Response
ASYNC_RESPONSE, CODE_OK, DLEN, MRSP, SEQ, SIMPLE_RESPONSE, SOP1, SOP2
Instance Method Summary collapse
-
#batt_voltage ⇒ Object
Voltage * 100.
- #body ⇒ Object
- #num_charges ⇒ Object
- #power_state ⇒ Object
- #rec_ver ⇒ Object
-
#time_since_charge ⇒ Object
Time since awakened in seconds.
Methods inherited from Sphero::Response
async?, #empty?, #initialize, #seq, simple?, #success?, #valid?
Constructor Details
This class inherits a constructor from Sphero::Response
Instance Method Details
#batt_voltage ⇒ Object
Voltage * 100
72 73 74 |
# File 'lib/sphero/response.rb', line 72 def batt_voltage body[2] end |
#body ⇒ Object
59 60 61 |
# File 'lib/sphero/response.rb', line 59 def body @body.unpack 'CCnnnC' end |
#num_charges ⇒ Object
76 77 78 |
# File 'lib/sphero/response.rb', line 76 def num_charges body[3] end |
#power_state ⇒ Object
67 68 69 |
# File 'lib/sphero/response.rb', line 67 def power_state body[1] end |
#rec_ver ⇒ Object
63 64 65 |
# File 'lib/sphero/response.rb', line 63 def rec_ver body[0] end |
#time_since_charge ⇒ Object
Time since awakened in seconds
81 82 83 |
# File 'lib/sphero/response.rb', line 81 def time_since_charge body[4] end |