diff --git a/CLS.c b/CLS.c index 5219658..05cf780 100644 --- a/CLS.c +++ b/CLS.c @@ -6,17 +6,7 @@ osTimerId_t CLS_HeatbeatTimerId; // Timer ID -static CLS_HeatbeatData_t cls_heatbeat_data = { - .firmware_version.major = 0, - .firmware_version.minor = 0, - .firmware_version.patch = 0, - .firmware_version.count = 0, - .id = 0, - .type = CLS_TYPE_LIGHT, - .counter =0, - .position.p0 = 0, - .position.p1 = 0, -}; +static CLS_HeatbeatData_t cls_heatbeat_data = {0}; _Static_assert(sizeof(cls_heatbeat_data) == 8, "CLS_HeatbeatData_t is not 8 bytes"); diff --git a/CLS.h b/CLS.h index f8ab33a..304f3a1 100644 --- a/CLS.h +++ b/CLS.h @@ -2,37 +2,15 @@ #define CLS_HEARTBEAT_INTERVAL_MS 1000 +#include "cls_device.pb.h" -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 cls_device_Type 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 cls_device_Position CLS_Position_Option_t; typedef struct CLS_Position { - CLS_Position_Type_t p0:4; - CLS_Position_Type_t p1:4; + CLS_Position_Option_t p0:4; + CLS_Position_Option_t p1:4; } CLS_Position_t; diff --git a/CMakeLists.txt b/CMakeLists.txt index 44e063c..cd907cb 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -15,4 +15,4 @@ target_sources(${PROJECT_NAME} ) target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_LIST_DIR}) -target_link_libraries(${PROJECT_NAME} PRIVATE Revision CLS_BSP) \ No newline at end of file +target_link_libraries(${PROJECT_NAME} PRIVATE Revision CLS_BSP PROTOS) \ No newline at end of file