Class: TimexDatalinkClient::Protocol6::Sync
- Inherits:
-
Object
- Object
- TimexDatalinkClient::Protocol6::Sync
- Defined in:
- lib/timex_datalink_client/protocol_6/sync.rb
Constant Summary collapse
- PING_BYTE =
[0x78]
- FAST_MODE_BYTE =
[0x56]
- SYNC_1_BYTE =
[0x55]
- SYNC_2_BYTE =
[0xaa]
- SYNC_2_LENGTH =
40
Instance Attribute Summary collapse
-
#length ⇒ Object
Returns the value of attribute length.
Instance Method Summary collapse
-
#initialize(length: 300) ⇒ Sync
constructor
Create a Sync instance.
-
#packets ⇒ Array<Array<Integer>>
Compile packets for syncronization data.
Constructor Details
#initialize(length: 300) ⇒ Sync
Create a Sync instance.
19 20 21 |
# File 'lib/timex_datalink_client/protocol_6/sync.rb', line 19 def initialize(length: 300) @length = length end |
Instance Attribute Details
#length ⇒ Object
Returns the value of attribute length.
13 14 15 |
# File 'lib/timex_datalink_client/protocol_6/sync.rb', line 13 def length @length end |
Instance Method Details
#packets ⇒ Array<Array<Integer>>
Compile packets for syncronization data.
26 27 28 |
# File 'lib/timex_datalink_client/protocol_6/sync.rb', line 26 def packets [PING_BYTE + FAST_MODE_BYTE + render_sync_1 + render_sync_2] end |