Class: TimexDatalinkClient::Protocol9::Alarm
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol9::Alarm
- Includes:
- Helpers::CharEncoders, Helpers::CrcPacketsWrapper
- Defined in:
- lib/timex_datalink_client/protocol_9/alarm.rb
Constant Summary collapse
- CPACKET_ALARM =
[0x50]
Constants included from Helpers::CharEncoders
Helpers::CharEncoders::CHARS, Helpers::CharEncoders::EEPROM_CHARS, Helpers::CharEncoders::EEPROM_TERMINATOR, Helpers::CharEncoders::INVALID_CHAR, Helpers::CharEncoders::PHONE_CHARS
Instance Attribute Summary collapse
-
#audible ⇒ Object
Returns the value of attribute audible.
-
#day ⇒ Object
Returns the value of attribute day.
-
#message ⇒ Object
Returns the value of attribute message.
-
#month ⇒ Object
Returns the value of attribute month.
-
#number ⇒ Object
Returns the value of attribute number.
-
#time ⇒ Object
Returns the value of attribute time.
Instance Method Summary collapse
-
#initialize(number:, audible:, time:, message:, month: nil, day: nil) ⇒ Alarm
constructor
Create an Alarm instance.
-
#packets ⇒ Array<Array<Integer>>
Compile packets for an alarm.
Methods included from Helpers::CharEncoders
#chars_for, #eeprom_chars_for, #phone_chars_for
Constructor Details
#initialize(number:, audible:, time:, message:, month: nil, day: nil) ⇒ Alarm
Create an Alarm instance.
25 26 27 28 29 30 31 32 |
# File 'lib/timex_datalink_client/protocol_9/alarm.rb', line 25 def initialize(number:, audible:, time:, message:, month: nil, day: nil) @number = number @audible = audible @time = time @message = @month = month @day = day end |
Instance Attribute Details
#audible ⇒ Object
Returns the value of attribute audible.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/alarm.rb', line 14 def audible @audible end |
#day ⇒ Object
Returns the value of attribute day.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/alarm.rb', line 14 def day @day end |
#message ⇒ Object
Returns the value of attribute message.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/alarm.rb', line 14 def @message end |
#month ⇒ Object
Returns the value of attribute month.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/alarm.rb', line 14 def month @month end |
#number ⇒ Object
Returns the value of attribute number.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/alarm.rb', line 14 def number @number end |
#time ⇒ Object
Returns the value of attribute time.
14 15 16 |
# File 'lib/timex_datalink_client/protocol_9/alarm.rb', line 14 def time @time end |
Instance Method Details
#packets ⇒ Array<Array<Integer>>
Compile packets for an alarm.
37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/timex_datalink_client/protocol_9/alarm.rb', line 37 def packets [ [ CPACKET_ALARM, number, time.hour, time.min, month.to_i, day.to_i, audible_integer, ].flatten ] end |