Class: TimexDatalinkClient::Protocol4::Eeprom
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol4::Eeprom
- Includes:
- ActiveModel::Validations, Helpers::CpacketPaginator, Helpers::CrcPacketsWrapper
- Defined in:
- lib/timex_datalink_client/protocol_4/eeprom.rb,
lib/timex_datalink_client/protocol_4/eeprom/list.rb,
lib/timex_datalink_client/protocol_4/eeprom/anniversary.rb,
lib/timex_datalink_client/protocol_4/eeprom/appointment.rb,
lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb
Defined Under Namespace
Classes: Anniversary, Appointment, List, PhoneNumber
Constant Summary collapse
- CPACKET_CLEAR =
[0x93, 0x01]
- CPACKET_SECT =
[0x90, 0x01]
- CPACKET_DATA =
[0x91, 0x01]
- CPACKET_END =
[0x92, 0x01]
- CPACKET_DATA_LENGTH =
32
- START_ADDRESS =
0x0236
- APPOINTMENT_NO_NOTIFICATION =
0xff
- APPOINTMENT_NOTIFICATION_VALID_MINUTES =
(0..30).step(5)
Instance Attribute Summary collapse
-
#anniversaries ⇒ Object
Returns the value of attribute anniversaries.
-
#appointment_notification_minutes ⇒ Object
Returns the value of attribute appointment_notification_minutes.
-
#appointments ⇒ Object
Returns the value of attribute appointments.
-
#lists ⇒ Object
Returns the value of attribute lists.
-
#phone_numbers ⇒ Object
Returns the value of attribute phone_numbers.
Instance Method Summary collapse
-
#initialize(appointments: [], anniversaries: [], phone_numbers: [], lists: [], appointment_notification_minutes: nil) ⇒ Eeprom
constructor
Create an Eeprom instance.
-
#packets ⇒ Array<Array<Integer>>
Compile packets for EEPROM data.
Methods included from Helpers::CpacketPaginator
Constructor Details
#initialize(appointments: [], anniversaries: [], phone_numbers: [], lists: [], appointment_notification_minutes: nil) ⇒ Eeprom
Create an Eeprom instance.
42 43 44 45 46 47 48 49 50 |
# File 'lib/timex_datalink_client/protocol_4/eeprom.rb', line 42 def initialize( appointments: [], anniversaries: [], phone_numbers: [], lists: [], appointment_notification_minutes: nil ) @appointments = appointments @anniversaries = anniversaries @phone_numbers = phone_numbers @lists = lists @appointment_notification_minutes = appointment_notification_minutes end |
Instance Attribute Details
#anniversaries ⇒ Object
Returns the value of attribute anniversaries.
25 26 27 |
# File 'lib/timex_datalink_client/protocol_4/eeprom.rb', line 25 def anniversaries @anniversaries end |
#appointment_notification_minutes ⇒ Object
Returns the value of attribute appointment_notification_minutes.
25 26 27 |
# File 'lib/timex_datalink_client/protocol_4/eeprom.rb', line 25 def appointment_notification_minutes @appointment_notification_minutes end |
#appointments ⇒ Object
Returns the value of attribute appointments.
25 26 27 |
# File 'lib/timex_datalink_client/protocol_4/eeprom.rb', line 25 def appointments @appointments end |
#lists ⇒ Object
Returns the value of attribute lists.
25 26 27 |
# File 'lib/timex_datalink_client/protocol_4/eeprom.rb', line 25 def lists @lists end |
#phone_numbers ⇒ Object
Returns the value of attribute phone_numbers.
25 26 27 |
# File 'lib/timex_datalink_client/protocol_4/eeprom.rb', line 25 def phone_numbers @phone_numbers end |
Instance Method Details
#packets ⇒ Array<Array<Integer>>
Compile packets for EEPROM data.
56 57 58 59 60 |
# File 'lib/timex_datalink_client/protocol_4/eeprom.rb', line 56 def packets validate! [CPACKET_CLEAR, header] + payloads + [CPACKET_END] end |