Class: TimexDatalinkClient
- Inherits:
-
Object
- Object
- TimexDatalinkClient
- Defined in:
- lib/timex_datalink_client.rb,
lib/timex_datalink_client/version.rb,
lib/timex_datalink_client/protocol_1/end.rb,
lib/timex_datalink_client/protocol_3/end.rb,
lib/timex_datalink_client/protocol_4/end.rb,
lib/timex_datalink_client/protocol_6/end.rb,
lib/timex_datalink_client/protocol_7/end.rb,
lib/timex_datalink_client/protocol_9/end.rb,
lib/timex_datalink_client/protocol_1/sync.rb,
lib/timex_datalink_client/protocol_1/time.rb,
lib/timex_datalink_client/protocol_3/sync.rb,
lib/timex_datalink_client/protocol_3/time.rb,
lib/timex_datalink_client/protocol_4/sync.rb,
lib/timex_datalink_client/protocol_4/time.rb,
lib/timex_datalink_client/protocol_6/sync.rb,
lib/timex_datalink_client/protocol_6/time.rb,
lib/timex_datalink_client/protocol_7/sync.rb,
lib/timex_datalink_client/protocol_9/sync.rb,
lib/timex_datalink_client/protocol_9/time.rb,
lib/timex_datalink_client/notebook_adapter.rb,
lib/timex_datalink_client/protocol_1/alarm.rb,
lib/timex_datalink_client/protocol_1/start.rb,
lib/timex_datalink_client/protocol_3/alarm.rb,
lib/timex_datalink_client/protocol_3/start.rb,
lib/timex_datalink_client/protocol_4/alarm.rb,
lib/timex_datalink_client/protocol_4/start.rb,
lib/timex_datalink_client/protocol_6/alarm.rb,
lib/timex_datalink_client/protocol_6/start.rb,
lib/timex_datalink_client/protocol_7/start.rb,
lib/timex_datalink_client/protocol_9/alarm.rb,
lib/timex_datalink_client/protocol_9/start.rb,
lib/timex_datalink_client/protocol_9/timer.rb,
lib/timex_datalink_client/protocol_1/eeprom.rb,
lib/timex_datalink_client/protocol_3/eeprom.rb,
lib/timex_datalink_client/protocol_4/eeprom.rb,
lib/timex_datalink_client/protocol_6/eeprom.rb,
lib/timex_datalink_client/protocol_7/eeprom.rb,
lib/timex_datalink_client/protocol_9/eeprom.rb,
lib/timex_datalink_client/protocol_1/time_name.rb,
lib/timex_datalink_client/protocol_3/wrist_app.rb,
lib/timex_datalink_client/protocol_4/wrist_app.rb,
lib/timex_datalink_client/protocol_9/time_name.rb,
lib/timex_datalink_client/helpers/char_encoders.rb,
lib/timex_datalink_client/protocol_1/eeprom/list.rb,
lib/timex_datalink_client/protocol_3/eeprom/list.rb,
lib/timex_datalink_client/protocol_3/sound_theme.rb,
lib/timex_datalink_client/protocol_4/eeprom/list.rb,
lib/timex_datalink_client/protocol_4/sound_theme.rb,
lib/timex_datalink_client/protocol_7/eeprom/games.rb,
lib/timex_datalink_client/protocol_3/sound_options.rb,
lib/timex_datalink_client/protocol_4/sound_options.rb,
lib/timex_datalink_client/protocol_6/pager_options.rb,
lib/timex_datalink_client/protocol_7/eeprom/speech.rb,
lib/timex_datalink_client/protocol_9/eeprom/chrono.rb,
lib/timex_datalink_client/protocol_9/sound_options.rb,
lib/timex_datalink_client/helpers/cpacket_paginator.rb,
lib/timex_datalink_client/helpers/lsb_msb_formatter.rb,
lib/timex_datalink_client/protocol_7/phrase_builder.rb,
lib/timex_datalink_client/protocol_7/eeprom/activity.rb,
lib/timex_datalink_client/protocol_7/eeprom/calendar.rb,
lib/timex_datalink_client/helpers/crc_packets_wrapper.rb,
lib/timex_datalink_client/helpers/four_byte_formatter.rb,
lib/timex_datalink_client/helpers/length_packet_wrapper.rb,
lib/timex_datalink_client/protocol_1/eeprom/anniversary.rb,
lib/timex_datalink_client/protocol_1/eeprom/appointment.rb,
lib/timex_datalink_client/protocol_3/eeprom/anniversary.rb,
lib/timex_datalink_client/protocol_3/eeprom/appointment.rb,
lib/timex_datalink_client/protocol_4/eeprom/anniversary.rb,
lib/timex_datalink_client/protocol_4/eeprom/appointment.rb,
lib/timex_datalink_client/protocol_6/night_mode_options.rb,
lib/timex_datalink_client/protocol_1/eeprom/phone_number.rb,
lib/timex_datalink_client/protocol_3/eeprom/phone_number.rb,
lib/timex_datalink_client/protocol_4/eeprom/phone_number.rb,
lib/timex_datalink_client/protocol_6/eeprom/phone_number.rb,
lib/timex_datalink_client/protocol_7/eeprom/phone_number.rb,
lib/timex_datalink_client/protocol_9/eeprom/phone_number.rb,
lib/timex_datalink_client/protocol_6/sound_scroll_options.rb,
lib/timex_datalink_client/protocol_7/eeprom/calendar/event.rb
Defined Under Namespace
Classes: Helpers, NotebookAdapter, Protocol1, Protocol3, Protocol4, Protocol6, Protocol7, Protocol9
Constant Summary collapse
- VERSION =
"0.12.3"
Instance Attribute Summary collapse
-
#byte_sleep ⇒ Object
Returns the value of attribute byte_sleep.
-
#models ⇒ Object
Returns the value of attribute models.
-
#packet_sleep ⇒ Object
Returns the value of attribute packet_sleep.
-
#serial_device ⇒ Object
Returns the value of attribute serial_device.
-
#verbose ⇒ Object
Returns the value of attribute verbose.
Instance Method Summary collapse
-
#initialize(serial_device: nil, models: [], byte_sleep: nil, packet_sleep: nil, verbose: false) ⇒ TimexDatalinkClient
constructor
Create a TimexDatalinkClient instance.
-
#packets ⇒ Array<Array<Integer>>
Compile packets for all models.
-
#write ⇒ void
Write data for all models to serial device.
Constructor Details
#initialize(serial_device: nil, models: [], byte_sleep: nil, packet_sleep: nil, verbose: false) ⇒ TimexDatalinkClient
Create a TimexDatalinkClient instance.
101 102 103 104 105 106 107 |
# File 'lib/timex_datalink_client.rb', line 101 def initialize(serial_device: nil, models: [], byte_sleep: nil, packet_sleep: nil, verbose: false) @serial_device = serial_device @models = models @byte_sleep = byte_sleep @packet_sleep = packet_sleep @verbose = verbose end |
Instance Attribute Details
#byte_sleep ⇒ Object
Returns the value of attribute byte_sleep.
82 83 84 |
# File 'lib/timex_datalink_client.rb', line 82 def byte_sleep @byte_sleep end |
#models ⇒ Object
Returns the value of attribute models.
82 83 84 |
# File 'lib/timex_datalink_client.rb', line 82 def models @models end |
#packet_sleep ⇒ Object
Returns the value of attribute packet_sleep.
82 83 84 |
# File 'lib/timex_datalink_client.rb', line 82 def packet_sleep @packet_sleep end |
#serial_device ⇒ Object
Returns the value of attribute serial_device.
82 83 84 |
# File 'lib/timex_datalink_client.rb', line 82 def serial_device @serial_device end |
#verbose ⇒ Object
Returns the value of attribute verbose.
82 83 84 |
# File 'lib/timex_datalink_client.rb', line 82 def verbose @verbose end |
Instance Method Details
#packets ⇒ Array<Array<Integer>>
Compile packets for all models.
119 120 121 |
# File 'lib/timex_datalink_client.rb', line 119 def packets models.flat_map(&:packets) end |
#write ⇒ void
This method returns an undefined value.
Write data for all models to serial device.
112 113 114 |
# File 'lib/timex_datalink_client.rb', line 112 def write notebook_adapter.write(packets) end |