fixed bug in CanDataTask

the counter of devices was not resetting.
leading to a memory overlow when called multible times.
This commit is contained in:
2024-02-25 23:49:05 +01:00
parent 85e08d31be
commit 64631ea08f

View File

@@ -131,7 +131,7 @@ void DataClbk_cls_device_ResponseList(void* msg, uint32_t length) {
cls_device_ResponseList list; cls_device_ResponseList list;
extern uint8_t gCLS_DEVICE_ADDRESS; extern uint8_t gCLS_DEVICE_ADDRESS;
void DataClbk_cls_device_RequestList(void* msg, uint32_t length) { void DataClbk_cls_device_RequestList(void* msg, uint32_t length) {
memset(&list,0,sizeof(list));
// add yourself // add yourself
list.devices[list.devices_count].available = true; 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].canid = GENERATE_CLS_ADDRESS(CLS_CODE_STATUS, gCLS_DEVICE_ADDRESS, CLS_CH_STA_HEATBEAT);