#define M2_UNDEFINED_TEMP -32768 #define M2_UNDEFINED_HUMID -32768 #define M2_COUNTER typedef struct { uint8_t device_type; uint8_t serial; uint8_t report_type; uint8_t arg1; int16_t arg2; int32_t arg3; #ifdef M2_COUNTER uint16_t counter; #endif uint16_t crc; } __attribute__((packed)) METEO2_DATAGRAM; //device types #define M2_METEOSTATION 1 //report types #define M2_RESET 0 #define M2_TEMP_HUMID 1 #define M2_PRESSURE 2 #define M2_LIGHT 3 #define M2_WIND 4 #define M2_WIND_GUSTS 5 #define M2_RAIN 6 #define M2_WATER_LEVEL 7 #define M2_WATER_ALARM 8 #define M2_VOLTAGE 9 #define M2_PING 10