Farm-Data-Relay-System/fdrs_types.h

44 lines
659 B
C
Raw Normal View History

2022-06-21 19:04:05 +00:00
#ifndef __FDRS_TYPES_H__
2022-06-21 19:12:46 +00:00
#define __FDRS_TYPES_H__
2022-06-21 19:04:05 +00:00
2022-06-22 23:06:13 +00:00
#include <stdint.h>
2022-06-23 20:31:51 +00:00
#include <string.h>
2022-06-22 23:06:13 +00:00
typedef struct __attribute__((packed)) DataReading_t {
2022-06-21 19:04:05 +00:00
float data;
uint16_t id;
uint8_t type;
2022-06-22 23:06:13 +00:00
DataReading_t(): data(0.0),id(0),type(0){
}
} DataReading_t;
typedef struct DataReadingBuffer_t{
DataReading_t buffer[256];
uint16_t len;
2022-06-21 19:04:05 +00:00
2022-06-22 23:06:13 +00:00
DataReadingBuffer_t(){
}
2022-06-21 20:31:47 +00:00
2022-06-22 23:06:13 +00:00
}DataReadingBuffer_t;
2022-06-21 20:31:47 +00:00
2022-06-23 20:31:51 +00:00
typedef struct ESP_Peer_t{
uint8_t peer[6];
ESP_Peer_t(){
memset(peer,0,6);
}
void _copy(uint8_t p[6]){
memcpy(peer,p,6);
}
uint8_t *_data(void){
return peer;
}
}ESP_Peer_t;
2022-06-21 19:04:05 +00:00
#endif