Changes between Version 36 and Version 37 of hwProtocol

Show
Ignore:
Timestamp:
01/04/09 11:03:38 (20 months ago)
Author:
jdunn
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • hwProtocol

    v36 v37  
    2222||0||0||dir||code||data0||data1||data2||data3|| 
    2323 
    24 The leading 0's are there to ensure that any data transfer in progress is terminated before the control packet is processed (data transfers are null-terminated).  It is permissable to have additional leading 0's, but the entire control packet must fit into a single 8-byte USB packet. 
    25  
    26 The dir byte must be 0xDC for IN transfers (from the transceiver to the host).  It must be 0xCD for OUT transfers (from the host to the transceiver).  Any other value will cause the control packet to be discarded. 
     24The leading 0's are there mainly for historic reasons.  At one point they ensured that any data transfer in progress is terminated before the control packet is processed because data transfers with older firmware versions were null-terminated.  It is no longer permissible to have additional leading 0's; the packet format must exactly match the above specification.  The only exception to this rule is for IR data received from the device.  In fact, any packet not fitting this data will be assumed to be received signals and used accordingly. 
     25 
     26The dir byte must be 0xDC for IN transfers (from the transceiver to the host).  It must be 0xCD for OUT transfers (from the host to the transceiver).  Any other value will cause the control packet to be discarded.  To remember the use of this byte, consider the direction of the packet with respect to the (C)omputer and the (D)evice. 
    2727 
    2828The code byte indicates the operation that is requested (see below). 
    2929 
    30 The data bytes are optional.  They are used to carry additional information to and from the transceiver. 
    31  
    32 ---- 
    33  
    34 === Replies === 
    35  
    36 Whenever the host sends a control packet to the transceiver, the transceiver replies by sending a control packet back to the host.  The reply packet is a regular control packet and contains the same control code as the original command, so the host can confirm the control code was received.  Reply packets may also contain additional data. 
     30The data bytes are optional.  They are used to carry additional information to and from the transceiver and their content and interpretation are specific to the requested operation. 
     31 
     32==== Replies ==== 
     33 
     34Whenever the host sends a control packet to the transceiver, the transceiver replies by sending a control packet back to the host.  The reply packet is a regular control packet and contains the same control code as the original command, so the host can confirm the control code was received.  Reply packets may also contain additional data specific to the requested operation. 
    3735 
    3836---- 
     
    4038=== Outgoing Data Transfers === 
    4139 
    42 When the host is sending signal data to the transceiver to be transmitted via IR, it uses an outgoing data transfer.  The data transfer is a null-terminated sequence of bytes, possibly occupying many packets.  There is no header information associated with a data transfer, although one is always preceded by a control packet indicating that the data is coming. 
     40When the host is sending signal data to the transceiver to be transmitted via IR, it uses an outgoing data transfer.  The length of the data transfer is specified at the beginning of the transfer... TODO: update this after making a couple firmware changes.... is a null-terminated sequence of bytes, possibly occupying many packets.  There is no header information associated with a data transfer, although one is always preceded by a control packet indicating that the data is coming. 
    4341 
    4442The most significant bit of each byte is 0 for pulse, or 1 for space.  The remaining 7 bits indicate the pulse or space length, in increments of 26.3uS (26.3uS is 1/38KHz).  So for example, the code 0x09 indicates a pulse of 236.7uS.  The code 0x89 indicates a space of 236.7uS.