Class: TimexDatalinkClient::Protocol1::Eeprom
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol1::Eeprom
- Includes:
- ActiveModel::Validations, Helpers::CpacketPaginator, Helpers::CrcPacketsWrapper
- Defined in:
- lib/timex_datalink_client/protocol_1/eeprom.rb,
lib/timex_datalink_client/protocol_1/eeprom/list.rb,
lib/timex_datalink_client/protocol_1/eeprom/anniversary.rb,
lib/timex_datalink_client/protocol_1/eeprom/appointment.rb,
lib/timex_datalink_client/protocol_1/eeprom/phone_number.rb
Defined Under Namespace
Classes: Anniversary, Appointment, List, PhoneNumber
Constant Summary collapse
- CPACKET_SECT =
[0x60]
- CPACKET_DATA =
[0x61]
- CPACKET_END =
[0x62]
- CPACKET_DATA_LENGTH =
27
- START_INDEX =
14
- 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.
41 42 43 44 45 46 47 48 49 |
# File 'lib/timex_datalink_client/protocol_1/eeprom.rb', line 41 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.
24 25 26 |
# File 'lib/timex_datalink_client/protocol_1/eeprom.rb', line 24 def anniversaries @anniversaries end |
#appointment_notification_minutes ⇒ Object
Returns the value of attribute appointment_notification_minutes.
24 25 26 |
# File 'lib/timex_datalink_client/protocol_1/eeprom.rb', line 24 def appointment_notification_minutes @appointment_notification_minutes end |
#appointments ⇒ Object
Returns the value of attribute appointments.
24 25 26 |
# File 'lib/timex_datalink_client/protocol_1/eeprom.rb', line 24 def appointments @appointments end |
#lists ⇒ Object
Returns the value of attribute lists.
24 25 26 |
# File 'lib/timex_datalink_client/protocol_1/eeprom.rb', line 24 def lists @lists end |
#phone_numbers ⇒ Object
Returns the value of attribute phone_numbers.
24 25 26 |
# File 'lib/timex_datalink_client/protocol_1/eeprom.rb', line 24 def phone_numbers @phone_numbers end |
Instance Method Details
#packets ⇒ Array<Array<Integer>>
Compile packets for EEPROM data.
55 56 57 58 59 |
# File 'lib/timex_datalink_client/protocol_1/eeprom.rb', line 55 def packets validate! [header] + payloads + [CPACKET_END] end |