Class: TimexDatalinkClient::Protocol6::Eeprom

Inherits:
Object
  • Object
show all
Includes:
Helpers::CpacketPaginator, Helpers::CrcPacketsWrapper, Helpers::LsbMsbFormatter
Defined in:
lib/timex_datalink_client/protocol_6/eeprom.rb,
lib/timex_datalink_client/protocol_6/eeprom/phone_number.rb

Defined Under Namespace

Classes: PhoneNumber

Constant Summary collapse

CPACKET_CLEAR =
[0x93, 0x01]
CPACKET_SECT =
[0x90, 0x01]
CPACKET_DATA =
[0x91, 0x01]
CPACKET_END =
[0x92, 0x01]
CPACKET_DATA_LENGTH =
32

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Helpers::LsbMsbFormatter

#lsb_msb_format_for

Methods included from Helpers::CpacketPaginator

#paginate_cpackets

Constructor Details

#initialize(phone_numbers: []) ⇒ Eeprom

Create an Eeprom instance.

Parameters:

  • phone_numbers (Array<PhoneNumber>) (defaults to: [])

    Phone numbers to be added to EEPROM data.



27
28
29
# File 'lib/timex_datalink_client/protocol_6/eeprom.rb', line 27

def initialize(phone_numbers: [])
  @phone_numbers = phone_numbers
end

Instance Attribute Details

#phone_numbersObject

Returns the value of attribute phone_numbers.



21
22
23
# File 'lib/timex_datalink_client/protocol_6/eeprom.rb', line 21

def phone_numbers
  @phone_numbers
end

Instance Method Details

#packetsArray<Array<Integer>>

Compile packets for EEPROM data.

Returns:

  • (Array<Array<Integer>>)

    Two-dimensional array of integers that represent bytes.



34
35
36
# File 'lib/timex_datalink_client/protocol_6/eeprom.rb', line 34

def packets
  [CPACKET_CLEAR, header] + payloads + [CPACKET_END]
end