get mostly one directional comms working
This commit is contained in:
@@ -2,8 +2,20 @@
|
||||
#define PACKETS_STRUCTS
|
||||
#include "stdint.h"
|
||||
|
||||
#define UplinkSync "PlechHore"
|
||||
#define DownlinkSync "PlechDole"
|
||||
|
||||
#define UplinkPacketType_SystemControl 0
|
||||
#define UplinkPacketType_Ping 1
|
||||
#define UplinkPacketType_ACK 255
|
||||
|
||||
#define DownlinkPacketType_Telemetry 0
|
||||
#define DownlinkPacketType_Ping 1
|
||||
#define DownlinkPacketType_ACK 255
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
char syncPhrase[10];
|
||||
uint32_t packetIndex;
|
||||
uint8_t packetType;
|
||||
uint32_t missionTimer;
|
||||
@@ -44,6 +56,15 @@ typedef struct __attribute__((packed))
|
||||
uint8_t gas_range;
|
||||
uint8_t gas_index;
|
||||
|
||||
float air_temperature; /*!< air temperature in degrees celsius */
|
||||
float relative_humidity; /*!< relative humidity in percent */
|
||||
float barometric_pressure; /*!< barometric pressure in hecto-pascal */
|
||||
float gas_resistance; /*!< gas resistance in ohms */
|
||||
uint16_t iaq_score; /*!< air quality index (0..500) */
|
||||
float temperature_score;
|
||||
float humidity_score;
|
||||
float gas_score;
|
||||
|
||||
// GPS DATA
|
||||
uint32_t time_seconds; // Seconds since start of day
|
||||
int32_t latitude_centi_degrees; // Latitude * 10,000
|
||||
@@ -73,6 +94,7 @@ typedef struct __attribute__((packed))
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
char syncPhrase[10];
|
||||
uint32_t packetIndex;
|
||||
uint8_t packetType;
|
||||
} UplinkPacket;
|
||||
@@ -85,4 +107,15 @@ typedef struct __attribute__((packed))
|
||||
uint16_t servoB;
|
||||
} SystemControlPacket;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint8_t PingData[20];
|
||||
} PingPacket;
|
||||
|
||||
typedef struct __attribute__((packed))
|
||||
{
|
||||
uint32_t packetIndex;
|
||||
uint32_t crc32Checksum;
|
||||
} ACKPacket;
|
||||
|
||||
#endif
|
Reference in New Issue
Block a user