32
in "modbus only" mode the message will be displayed within 3 hours.
in other modes, this indication will be reset when the data is sent.
bit4... bit6 - device type - (0 - weather station)
bit0... bit3 - register bank number (0 - main, 1 - coordinates)
low byte: - firmware version (122) word 2 bytes - senior 16 bits UNIX TIME
word 2 bytes - junior 16 bits UNIX TIME word 2 bytes -
senior 16 bits of longitude
word 2 bytes -
lower 16 bits of longitude
representation of longitude: float lon_f;
uint32_t lon = (uint32_t)fourth word <<16 | fifth word; if (lon & 0x80000000) { east longitude }
else {Western longitude}
lon_f =(float)(lon & 0x7fffffff)/1000000;
word 2 bytes -
senior 16 bits of latitude word 2 bytes -
junior 16 bits of latitude
representation of latitude: float lat_f;
uint32_t lat = (uint32_t) sixth word <<16 | seventh word; if (lat & 0x80000000) {north latitude}
else {south latitude} lat_f =(float)(lon & 0x7fffffff)/1000000; word 2 bytes -
height above sea
level word 2 bytes - number of satellites. tenth-sixteenth word - reserve.
Last 2 bytes of the answer - CRC16 checksum
*******************************************************
CRC16 calculation algorithm.
Initial number - 0xffffff
unsigned int crc16_b(unsigned char dat, unsigned int cr) {
char csdv=0, f;
unsigned int tmp=cr;
tmp ^=dat;
while (csdv<8) {
if(tmp & 0x0001) f=1; else f=0; tmp >>=1;
if(f) tmp ^=0xA001;
csdv++;
};
return tmp;
}
**********************************************************