44 lines
753 B
C
44 lines
753 B
C
#ifndef DEFINITION_H
|
|
#define DEFINITION_H
|
|
|
|
#include "packet_format.h"
|
|
|
|
//Payload structure
|
|
typedef struct
|
|
{
|
|
uint16_t id;
|
|
HEADER_e header : 6;
|
|
} __attribute__((__packed__)) DataPacket;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t id;
|
|
HEADER_e header : 6;
|
|
unsigned int ldr : 10;
|
|
float battery;
|
|
float bmpTemp;
|
|
float bmpPress;
|
|
float humidity;
|
|
float compensatedHumidity;
|
|
float htuTemp;
|
|
} __attribute__((__packed__)) WeatherStationDataPacket;
|
|
|
|
typedef enum
|
|
{
|
|
MAILBOX_LETTER = 0,
|
|
MAILBOX_PACKAGE,
|
|
MAILBOX_COLLECTED,
|
|
MAILBOX_TEST,
|
|
MAILBOX_UNKNOWN,
|
|
} MAILBOX_EVENT_e;
|
|
|
|
typedef struct
|
|
{
|
|
uint16_t id;
|
|
HEADER_e header : 6;
|
|
float battery;
|
|
MAILBOX_EVENT_e mailbox_event;
|
|
} __attribute__((__packed__)) MailboxDataPacket;
|
|
|
|
#endif //DEFINITION_H
|