added display messages

This commit is contained in:
2024-08-13 05:07:40 +02:00
parent b02f4af38d
commit 6094e7b0e7
9 changed files with 87 additions and 5 deletions

View File

@@ -318,10 +318,9 @@ extern uint8_t gCLS_DEVICE_ADDRESS;
void DataClbk_cls_device_RequestList(void* msg, uint32_t length) {
memset(&list,0,sizeof(list));
// add yourself
CLS_Position_t position = CLS_BSP_GetPosition();
CLS_Type_t type = CLS_BSP_GetDeviceType();
list.devices[list.devices_count].available = true;
list.devices[list.devices_count].canid = GENERATE_CLS_ADDRESS(CLS_CODE_STATUS, gCLS_DEVICE_ADDRESS, CLS_CH_STA_HEATBEAT);
list.devices[list.devices_count].device = gCLS_DEVICE_ADDRESS;
@@ -333,7 +332,21 @@ void DataClbk_cls_device_RequestList(void* msg, uint32_t length) {
list.devices[list.devices_count].fw_version[1] = VERSION_INFO.patch;
list.devices[list.devices_count].fw_version[2] = VERSION_INFO.minor;
list.devices[list.devices_count].fw_version[3] = VERSION_INFO.major;
list.devices_count++;
//add display
list.devices[list.devices_count].available = true;
list.devices[list.devices_count].canid = GENERATE_CLS_ADDRESS(CLS_CODE_STATUS, gCLS_DEVICE_ADDRESS+1, CLS_CH_STA_HEATBEAT);
list.devices[list.devices_count].device = gCLS_DEVICE_ADDRESS+1;
list.devices[list.devices_count].type = cls_device_Type_DISPLAY; // enum to uint
list.devices[list.devices_count].position[0] = position.p0;
list.devices[list.devices_count].position[1] = position.p1;
list.devices[list.devices_count].position_count = 2;
list.devices[list.devices_count].fw_version[0] = 0;
list.devices[list.devices_count].fw_version[1] = 0;
list.devices[list.devices_count].fw_version[2] = 0;
list.devices[list.devices_count].fw_version[3] = 0;
list.devices_count++;
for (size_t i = 0; i < 16; i++)