Class: TimexDatalinkClient::Protocol4::Sync
- Inherits:
- 
      Object
      
        - Object
- TimexDatalinkClient::Protocol4::Sync
 
- Defined in:
- lib/timex_datalink_client/protocol_4/sync.rb
Constant Summary collapse
- PING_BYTE =
- [0x78] 
- 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.
| 18 19 20 | # File 'lib/timex_datalink_client/protocol_4/sync.rb', line 18 def initialize(length: 300) @length = length end | 
Instance Attribute Details
#length ⇒ Object
Returns the value of attribute length.
| 12 13 14 | # File 'lib/timex_datalink_client/protocol_4/sync.rb', line 12 def length @length end | 
Instance Method Details
#packets ⇒ Array<Array<Integer>>
Compile packets for syncronization data.
| 25 26 27 | # File 'lib/timex_datalink_client/protocol_4/sync.rb', line 25 def packets [PING_BYTE + render_sync_1 + render_sync_2] end |