mirror of
https://github.com/SasaKaranovic/HousePlantMonitoringSystem.git
synced 2026-07-29 20:02:13 +02:00
Initial commit.
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#ifndef __PLANTSYSTEM_COMMS_H
|
||||
#define __PLANTSYSTEM_COMMS_H
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
// CMD (1byte) + DATATYPE (1byte) + DATALEN (2bytes)
|
||||
#define PLANTSYSTEM_MIN_HEADER_LENGHT 4
|
||||
|
||||
typedef enum
|
||||
{
|
||||
CMD_FIRST = 0x00,
|
||||
CMD_GET_DEVICE_INFO,
|
||||
CMD_GET_TEMPERATURE,
|
||||
CMD_GET_SOILMOISTURE,
|
||||
CMD_GET_AMBIENTLIGHT,
|
||||
CMD_LAST
|
||||
} plant_cmd_t;
|
||||
|
||||
|
||||
typedef enum
|
||||
{
|
||||
DATATYPE_FIRST = 0x00,
|
||||
DATATYPE_NONE,
|
||||
DATATYPE_SINGLE_VALUE,
|
||||
DATATYPE_KEY_VALUE_PAIR,
|
||||
DATATYPE_LAST
|
||||
} plant_datatype_t;
|
||||
|
||||
bool PlanSystem_ParseBuffer(uint8_t *pBuffer, uint8_t nBufferLen, uint8_t *cmd, uint8_t *dataType, uint8_t *dataLength);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user