Initial commit.

This commit is contained in:
Sasa Karanovic
2021-02-25 22:20:15 -05:00
parent 32df4a42e8
commit dcda38bcac
605 changed files with 479040 additions and 0 deletions
@@ -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