Casio wrist cam WQV-2 protocol
Kees Jongenburger
$Id: protocol.html,v 1.2 2003/06/01 21:54:27 keesj Exp $
General packet information
All packet start with C0 and end with C1. The watch is quit passive and only answers to request.
The only exception seems to be that the packet that acknoleges a new created session is sent 3 time.
The second byte of a packet is the session id. When the session is not yet started the session id is FF
The two last bytes of a packet(before C1) are a checksum. The checksum is calculated by adding all values of the packet (starting with the session id) to each other string the value in a "2 byte value".
int checksum =0;
for all bytes to send {
checksum += bytevalue;
}
checksum = checksum % 0x1000;
checksum1 = (checksum / 0x100);
checksum2 = (checksum % 0x100);
first packet
The communication is started by sending a packet containing B3
second packet
note probably the time is used at this point as a "random key" for the next packet
third packet
it looks like commandos exists of 3 parameter
B3 01 B2 => init
image format
When transfering data to the computer by means of the pad2 the wacht uses this format.
Casio images are stored with the .BIN extention. the image format
is quit simple.
try to keep your image in this format it has useluff meta-data
- The image format has a contant size of 7229 bytes.
- The first 24 bytes a the image title(ascii)
- The next 5 bytes are the date and time
- year starting from 2000 (int value of byte + 2000 = year) 0..255
- month (int value of byte = month) 0..11
- day of month (int value of byte = day) 0..31
- hour of day(int value of byte = hour) 0..24
- minutes of day(int value of byte = minutes) 0..59
- The next 120 * 60 bytes are the actual image.
The image is 120 times 120 pixels with 16 greyscales
each pixel is stored in 4 bits so one byte contains 2 pixels
the value of the 4 bits is the darkness so 0 (0x0) is white and 16 (0xf) is black.
The order is different from what I would expect (the pixel in the 4 MSB is right of the pixel in the LSB)