Added missing header files.

This commit is contained in:
Th3maz1ng 2022-09-16 13:13:56 +02:00
parent ad70fdccea
commit 6930494e0c
2 changed files with 48 additions and 0 deletions

42
src/app/definition.h Normal file
View File

@ -0,0 +1,42 @@
#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_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

6
src/app/packet_format.h Normal file
View File

@ -0,0 +1,6 @@
#ifndef PACKET_FORMAT_H
#define PACKET_FORMAT_H
enum HEADER_e {WEATHER_STATION = 0, CONNECTED_MAILBOX};
#endif //PACKET_FORMAT_H