protocol
author viric <viriketo@gmail.com>
Sun, 01 Jan 2012 21:43:00 +0100
changeset 21 59497fb48e2c
parent 2 884635f4a24f
permissions -rw-r--r--
Fixing a signed/unsigned problem, evident when downloading lots of samples.

ce 00 00 00  <= no ho sé. Programant val ce, rebent val e1 o 0.
80 3e 00 00  <= número de samples. 16000
00 00 00 00 <= mostres obtingudes (0, programant)
2c 01 00 00 <=  sample rate in seconds (300s here)
da 07 00 00 <= any (2010)
00 00 20 41 <= min temperatura (20 41 = 10, 30 41 = 11, 08 3f = 1)
00 00 a0 41 <= max temperatura (b0 4a = 22, a8 41 = 21, a0 41 = 20, 20 42 = 40)
0a <= mes
18 <= dia
00 <= hora
17 <= minut
18 <= segon
00 <= en cas de celsius, 01 en cas de farenheit
7e <= pausa entre leds: 30s = 7E, 20s = 54, ... el bit més alt vol dir "leds flash for high and low alarm" (fe, en aquest cas):  1e = 30s, 14 = 20.   9e/94 = flash.
16 bytes seguents <= nom donat, 00 al final.
01 <= 1 manual, 2 instant
00 00 0c 42 <= mínim humitat (f041 = 30, 0c42 = 35, 2042 = 40, 3442 = 45)
00 00 96 42 <= max humitat (8c42 = 70, 9642 = 75, 4842 = 50)
c1 00 00 00 <= Igual que al començament


Download:
1era trama: 02 2c 00   (2c 00 = numero de mostres = samples * 4)

2a trama, rebuda pel 81j:
Com la de programar.

3a trama:
00 00 01  (pel 2)

4a trama, el host rep pel 81:
02 00 00

5a trama, el host rep pel 81:
f7 00 63 02 * samples
f7 00 = 76.4 fahrenheit = 24.7 C = 247
f6 00 = 76.2 fahrenheit = 24.6 C = 256
63 02 = 61.1 % 
62 02 = 61.0 %
61 02 = 61.0 %
66 02 = 61.4 %
68 02 = 61.6 %
6b 02 = 61.9 %
6a 02 = 61.8 %