WPILibC++ 2023.4.3-108-ge5452e3
CanData.h
Go to the documentation of this file.
1// Copyright (c) FIRST and other WPILib contributors.
2// Open Source Software; you can modify and/or share it under the terms of
3// the WPILib BSD license file in the root directory of this project.
4
5#pragma once
6
7#include "hal/Types.h"
8#include "hal/Value.h"
10
11typedef void (*HAL_CAN_SendMessageCallback)(const char* name, void* param,
12 uint32_t messageID,
13 const uint8_t* data,
14 uint8_t dataSize, int32_t periodMs,
15 int32_t* status);
16
18 const char* name, void* param, uint32_t* messageID, uint32_t messageIDMask,
19 uint8_t* data, uint8_t* dataSize, uint32_t* timeStamp, int32_t* status);
20
22 const char* name, void* param, uint32_t* sessionHandle, uint32_t messageID,
23 uint32_t messageIDMask, uint32_t maxMessages, int32_t* status);
24
25typedef void (*HAL_CAN_CloseStreamSessionCallback)(const char* name,
26 void* param,
27 uint32_t sessionHandle);
28
30 const char* name, void* param, uint32_t sessionHandle,
31 struct HAL_CANStreamMessage* messages, uint32_t messagesToRead,
32 uint32_t* messagesRead, int32_t* status);
33
35 const char* name, void* param, float* percentBusUtilization,
36 uint32_t* busOffCount, uint32_t* txFullCount, uint32_t* receiveErrorCount,
37 uint32_t* transmitErrorCount, int32_t* status);
38
39#ifdef __cplusplus
40extern "C" {
41#endif
42
44
46 HAL_CAN_SendMessageCallback callback, void* param);
48
50 HAL_CAN_ReceiveMessageCallback callback, void* param);
52
54 HAL_CAN_OpenStreamSessionCallback callback, void* param);
56
58 HAL_CAN_CloseStreamSessionCallback callback, void* param);
60
62 HAL_CAN_ReadStreamSessionCallback callback, void* param);
64
66 HAL_CAN_GetCANStatusCallback callback, void* param);
68
69#ifdef __cplusplus
70} // extern "C"
71#endif
void(* HAL_CAN_ReceiveMessageCallback)(const char *name, void *param, uint32_t *messageID, uint32_t messageIDMask, uint8_t *data, uint8_t *dataSize, uint32_t *timeStamp, int32_t *status)
Definition: CanData.h:17
void(* HAL_CAN_SendMessageCallback)(const char *name, void *param, uint32_t messageID, const uint8_t *data, uint8_t dataSize, int32_t periodMs, int32_t *status)
Definition: CanData.h:11
void(* HAL_CAN_ReadStreamSessionCallback)(const char *name, void *param, uint32_t sessionHandle, struct HAL_CANStreamMessage *messages, uint32_t messagesToRead, uint32_t *messagesRead, int32_t *status)
Definition: CanData.h:29
void HALSIM_CancelCanReadStreamCallback(int32_t uid)
int32_t HALSIM_RegisterCanReadStreamCallback(HAL_CAN_ReadStreamSessionCallback callback, void *param)
void HALSIM_CancelCanGetCANStatusCallback(int32_t uid)
int32_t HALSIM_RegisterCanGetCANStatusCallback(HAL_CAN_GetCANStatusCallback callback, void *param)
int32_t HALSIM_RegisterCanSendMessageCallback(HAL_CAN_SendMessageCallback callback, void *param)
int32_t HALSIM_RegisterCanCloseStreamCallback(HAL_CAN_CloseStreamSessionCallback callback, void *param)
void(* HAL_CAN_GetCANStatusCallback)(const char *name, void *param, float *percentBusUtilization, uint32_t *busOffCount, uint32_t *txFullCount, uint32_t *receiveErrorCount, uint32_t *transmitErrorCount, int32_t *status)
Definition: CanData.h:34
int32_t HALSIM_RegisterCanOpenStreamCallback(HAL_CAN_OpenStreamSessionCallback callback, void *param)
void HALSIM_CancelCanSendMessageCallback(int32_t uid)
void HALSIM_CancelCanOpenStreamCallback(int32_t uid)
void HALSIM_CancelCanCloseStreamCallback(int32_t uid)
void(* HAL_CAN_CloseStreamSessionCallback)(const char *name, void *param, uint32_t sessionHandle)
Definition: CanData.h:25
void(* HAL_CAN_OpenStreamSessionCallback)(const char *name, void *param, uint32_t *sessionHandle, uint32_t messageID, uint32_t messageIDMask, uint32_t maxMessages, int32_t *status)
Definition: CanData.h:21
void HALSIM_ResetCanData(void)
int32_t HALSIM_RegisterCanReceiveMessageCallback(HAL_CAN_ReceiveMessageCallback callback, void *param)
void HALSIM_CancelCanReceiveMessageCallback(int32_t uid)
::uint32_t uint32_t
Definition: Meta.h:56
::int32_t int32_t
Definition: Meta.h:57
::uint8_t uint8_t
Definition: Meta.h:52
Storage for CAN Stream Messages.
Definition: CAN.h:34
Definition: format.h:1552