added more device info into hartbeat
fw_version+id+type+postion slowed down to 1000ms now depends on libRevision to get the FW version information
This commit is contained in:
53
CLS.h
53
CLS.h
@@ -1,7 +1,60 @@
|
||||
#pragma once
|
||||
|
||||
#define CLS_HEARTBEAT_INTERVAL_MS 1000
|
||||
|
||||
|
||||
typedef enum CLS_Type {
|
||||
CLS_TYPE_LIGHT = 0x00,
|
||||
CLS_TYPE_SWITCH = 0x01,
|
||||
CLS_TYPE_SWITCHED_LIGHT = 0x02,
|
||||
CLS_TYPE_SENSOR = 0x03,
|
||||
CLS_TYPE_DISPLAY = 0x04,
|
||||
CLS_TYPE_MASTER = 0x0F,
|
||||
}CLS_Type_t;
|
||||
|
||||
typedef enum CLS_Position_Type {
|
||||
CLS_POSITION_TOP = 0x00,
|
||||
CLS_POSITION_BOTTOM = 0x01,
|
||||
CLS_POSITION_LEFT = 0x02,
|
||||
CLS_POSITION_RIGHT = 0x03,
|
||||
CLS_POSITION_CENTER = 0x04,
|
||||
CLS_POSITION_FRONT = 0x05,
|
||||
CLS_POSITION_REAR = 0x06,
|
||||
CLS_POSITION_BACK = 0x07,
|
||||
CLS_POSITION_FLOOR = 0x08,
|
||||
CLS_POSITION_CEILING = 0x09,
|
||||
CLS_POSITION_ENGINE = 0x0A,
|
||||
CLS_POSITION_TRUNK = 0x0B,
|
||||
// more TBD
|
||||
CLS_POSITION_INSIDE = 0x0E,
|
||||
CLS_POSITION_OUTSIDE = 0x0F,
|
||||
} CLS_Position_Type_t;
|
||||
|
||||
typedef struct CLS_Position {
|
||||
CLS_Position_Type_t p0:4;
|
||||
CLS_Position_Type_t p1:4;
|
||||
} CLS_Position_t;
|
||||
|
||||
#pragma pack(1) // 1 byte alignment
|
||||
typedef struct CLS_HeatbeatData
|
||||
{
|
||||
struct
|
||||
{
|
||||
uint8_t major;
|
||||
uint8_t minor;
|
||||
uint8_t patch;
|
||||
uint8_t count;
|
||||
}firmware_version;
|
||||
|
||||
CLS_Type_t type;
|
||||
uint8_t id;
|
||||
uint8_t counter;
|
||||
CLS_Position_t position;
|
||||
} CLS_HeatbeatData_t;
|
||||
|
||||
extern uint8_t gCLS_DEVICE_ADDRESS;
|
||||
|
||||
|
||||
|
||||
|
||||
void CLS_Init(void);
|
||||
|
||||
Reference in New Issue
Block a user