CAVRIT is fully compatible with the standard Cricket communication protocol. It also supports several new opcodes to simplify data access. Please note that all multi-byte data types are sent MSB first.
Name: SET_POINTER Name: READ_BYTES Name: WRITE_BYTES Name: RUN Name: CRICKET_CHECK For the above Opcodes, see http://www.handyboard.com/cricket/tech/comms.txt
Name: CRICKET_RENAME Opcode: 136 Arguments: A NULL-terminated string of up to 10 characters Description: Reads data from the serial port until either a NULL character is read or 10 characters are read. Once the name is read the Cricket needs to receive another CRICKET_CHECK request to be ready for further commands. Name: SET_DATA_POINTER Opcode: 137 Description: This opcode takes a 2-byte unsigned integer argument that will be used as the starting address for the DATA_POINTER. If this value is larger than the data buffer the address that will be set is (DATA_POINTER % DBUFFER_SIZE). Name: DATA_READ_BYTES Opcode: 138 Description: This opcode takes a 2-byte unsigned integer argument that will be used as the count. CAVRIT will then read 'count' bytes of data from the data buffer, starting from the location set by the DATA_POINTER and write them to the serial port. After each read the DATA_POINTER will be incremented by 1. Name: DATA_WRITE_BYTES Opcode: 139 Description: This opcode takes a 2-byte unsigned integer argument that will be used as the count. CAVRIT will then read 'count' bytes of data from the serial port and write them to the internal data buffer at the location set by the DATA_POINTER. After each write the DATA_POINTER will be incremented by 1. If the end of the buffer is encountered, the address will wrap around and continue writing without any notification. Name: DATA_BSIZE Opcode: 140 Description: This opcode returns a 16-bit unsigned integer that represents the length of the data buffer. Any reads or writes that extend beyond this point will wrap around to the beginning of the buffer.