[hal] Add capability to read power distribution data as a stream (#4983)

This commit is contained in:
Thad House
2023-11-30 21:09:14 -08:00
committed by GitHub
parent 51eecef2bd
commit ca684ac207
7 changed files with 592 additions and 0 deletions

View File

@@ -281,4 +281,19 @@ void HAL_ReadCANPacketTimeout(HAL_CANHandle handle, int32_t apiId,
}
}
}
uint32_t HAL_StartCANStream(HAL_CANHandle handle, int32_t apiId, int32_t depth,
int32_t* status) {
auto can = canHandles->Get(handle);
if (!can) {
*status = HAL_HANDLE_ERROR;
return 0;
}
uint32_t messageId = CreateCANId(can.get(), apiId);
uint32_t session = 0;
HAL_CAN_OpenStreamSession(&session, messageId, 0x1FFFFFFF, depth, status);
return session;
}
} // extern "C"