7 #ifndef EXXOTEST_AGHAF_CAN_H
8 #define EXXOTEST_AGHAF_CAN_H
112 #pragma pack(push, 1)
170 uint32_t *nbTerminations));
173 uint32_t *nbTerminations));
175 (uint32_t *terminations));
182 uint8_t flags, uint32_t period));
188 uint32_t id1, uint32_t id2));
233 uint16_t dataLen, uint8_t
const *data));
@ AGHAF_CAN_FILTER_MODE_ACCEPT
Accept mode for a can filter.
Definition: aghaf_can.h:72
@ AGHAF_CAN_FILTER_MODE_REJECT
Reject mode for a can filter.
Definition: aghaf_can.h:73
@ AGHAF_CAN_REJECT_NONE
Accept all the frames.
Definition: aghaf_can.h:61
@ AGHAF_CAN_REJECT_ALL
Reject all non matching frames.
Definition: aghaf_can.h:56
@ AGHAF_CAN_REJECT_STD
Reject all non matching frames with a standard can Id.
Definition: aghaf_can.h:57
@ AGHAF_CAN_REJECT_EXT
Reject all non matching frames with an extended can Id.
Definition: aghaf_can.h:59
@ AGHAF_CAN_FILTER_ID_XTD
filter for frames with an extended can Id
Definition: aghaf_can.h:67
@ AGHAF_CAN_FILTER_ID_STD
Filter for frames with standard can Id.
Definition: aghaf_can.h:66
@ AGHAF_CAN_BUS_PASSIVE
Passive error state.
Definition: aghaf_can.h:39
@ AGHAF_CAN_BUS_BUSOFF
Bus off state.
Definition: aghaf_can.h:40
@ AGHAF_CAN_BUS_ACTIVE
active error state
Definition: aghaf_can.h:38
@ AGHAF_CAN_BUS_UNKNOW
Invalide mode.
Definition: aghaf_can.h:37
@ AGHAF_CAN_EVENT_BUSCHANGE
Chip state has chaged active or passive error ou bus off.
Definition: aghaf_can.h:49
@ AGHAF_CAN_EVENT_ERROR
Bus error.
Definition: aghaf_can.h:48
@ AGHAF_CAN_EVENT_MSGRX
Message has been received.
Definition: aghaf_can.h:47
@ AGHAF_CAN_EVENT_BUSLOAD
Bus load information.
Definition: aghaf_can.h:51
@ AGHAF_CAN_EVENT_MSGTX
End of transmission.
Definition: aghaf_can.h:46
@ AGHAF_CAN_EVENT_UNKNOW
Unknown type of event.
Definition: aghaf_can.h:45
@ AGHAF_CAN_RemoteFrame
Definition: aghaf_can.h:30
@ AGHAF_CAN_DataFrame
standard frame of data
Definition: aghaf_can.h:29
@ AGHAF_CAN_FILTER_TYPE_CLASSIC
id1 is the identifier and id2 is the mask
Definition: aghaf_can.h:78
@ AGHAF_CAN_FILTER_TYPE_DUAL
id1 is an identifier and id2 is an identifier too
Definition: aghaf_can.h:82
@ AGHAF_CAN_FILTER_TYPE_SINGLE
id1 is the identifier you want to filter. id2 is not used.
Definition: aghaf_can.h:80
@ AGHAF_CAN_FILTER_TYPE_RANGE
Definition: aghaf_can.h:84
AGHAF_CAN_Param
List of parameters used to configure a CAN bus.
Definition: aghaf_can_enums.h:75
AGHAF_CAN_Mode
Possible modes for CAN.
Definition: aghaf_can_enums.h:57
AGHAF_CAN_FilterMode
enumerator to choose the type of the filter: accept or reject
Definition: aghaf_can.h:71
AGHAF_CAN_Frame AGHAF_CAN_Frame_new(void)
Return a handle on a CAN frame.
Definition: aghaf_can.cpp:355
AGHAF_BOOL AGHAF_CAN_Frame_esi(AGHAF_CAN_Frame frame)
AGHAF_CAN_Frame_esi.
Definition: aghaf_can.cpp:446
AGHAF_Status AGHAF_CAN_Bus_deactivate(AGHAF_CAN_Bus bus)
deactivate a CAN bus
Definition: aghaf_can.cpp:175
AGHAF_Status AGHAF_CAN_Bus_isActivated(AGHAF_CAN_Bus bus, AGHAF_BOOL *isActivated)
Request if a CAN bus is yet activated or not.
Definition: aghaf_can.cpp:186
void AGHAF_CAN_deregisterCallback(AGHAF_CAN_Bus bus, AGHAF_CAN_Callback callback)
deregister a callback
Definition: aghaf_can.cpp:57
AGHAF_Status AGHAF_CAN_Bus_reject(AGHAF_CAN_Bus bus, AGHAF_CAN_RejectType rejectType, AGHAF_BOOL rtr)
Set a global filter.
Definition: aghaf_can.cpp:343
void * AGHAF_CAN_Bus
handle to a CAN bus
Definition: aghaf_can.h:89
AGHAF_CAN_RejectType
enumerator to choose the type of exclusion filter
Definition: aghaf_can.h:55
AGHAF_CAN_FrameType AGHAF_CAN_Frame_frameType(AGHAF_CAN_Frame frame)
Get the type from the frame.
Definition: aghaf_can.cpp:411
AGHAF_CAN_Bus AGHAF_CAN_getBus(AGHAF_Device device, uint8_t index)
return the CAN bus at index in parameter
Definition: aghaf_can.cpp:15
AGHAF_Status AGHAF_CAN_Bus_addFilter(AGHAF_CAN_Bus bus, AGHAF_CAN_FilterId idType, AGHAF_CAN_FILTER_Type type, AGHAF_CAN_FilterMode mode, uint32_t id1, uint32_t id2)
add a filter to the CAN bus
Definition: aghaf_can.cpp:275
AGHAF_Status AGHAF_CAN_Frame_data(AGHAF_CAN_Frame frame, void *data, int64_t size)
Provide the data contained in a frame.
Definition: aghaf_can.cpp:486
AGHAF_CAN_IdentifierType
enumerator to choose the type of CAN identifier
Definition: aghaf_can.h:22
AGHAF_Status AGHAF_CAN_Bus_supportedTerminationsLs(AGHAF_CAN_Bus bus, uint32_t **terminations, uint32_t *nbTerminations)
Request the supported low speed terminations from a CAN bus.
Definition: aghaf_can.cpp:220
AGHAF_Status AGHAF_CAN_Bus_state(AGHAF_CAN_Bus bus, AGHAF_CAN_BusState *canBusState)
AGHAF_CAN_Bus_state.
Definition: aghaf_can.cpp:144
struct AGHAF_CAN_Identifier AGHAF_CAN_Identifier
structure to represent an indentifier CAN in the AGHAF library
uint8_t AGHAF_CAN_getBusIndex(AGHAF_CAN_Bus bus)
return the index from a CAN bus
Definition: aghaf_can.cpp:25
void AGHAF_CAN_Bus_freeSupportedTerminations(uint32_t *terminations)
Free the memory allocated with AGHAF_CAN_Bus_supportedTerminations or AGHAF_CAN_Bus_supportedTerminat...
Definition: aghaf_can.cpp:232
AGHAF_Status AGHAF_CAN_Bus_supportedFilters(AGHAF_CAN_Bus bus, uint16_t *globalFilterCaps, AGHAF_CAN_FilterDesc **values, uint16_t *size)
Provide the supported filters from a CAN bus.
Definition: aghaf_can.cpp:320
AGHAF_CAN_FilterId
enumerator to choose the identifier type for can filter
Definition: aghaf_can.h:65
AGHAF_CAN_BusState
enumerator for the state of the bus
Definition: aghaf_can.h:36
AGHAF_CAN_EventType
enumerator to tell the type of the event
Definition: aghaf_can.h:44
AGHAF_Status AGHAF_CAN_Bus_sendPeriodic(AGHAF_CAN_Bus bus, AGHAF_CAN_Frame frame, uint8_t index, uint8_t flags, uint32_t period)
Add a periodic message to send.
Definition: aghaf_can.cpp:256
void AGHAF_CAN_asyncSendFrame(AGHAF_CAN_Bus bus, AGHAF_CAN_Frame frame, uint32_t *id)
AGHAF_CAN_asyncSendFrame.
Definition: aghaf_can.cpp:543
AGHAF_CAN_Frame AGHAF_CAN_Event_frame(AGHAF_CAN_Event event)
return the frame contained in an event
Definition: aghaf_can.cpp:554
void AGHAF_CAN_registerCallback(AGHAF_CAN_Bus bus, AGHAF_CAN_Callback callback, void *userContext)
Register a callback for the CAN events from a bus.
Definition: aghaf_can.cpp:46
AGHAF_BOOL AGHAF_CAN_Frame_fdf(AGHAF_CAN_Frame frame)
AGHAF_CAN_Frame_fdf.
Definition: aghaf_can.cpp:436
AGHAF_Status AGHAF_CAN_sendFrame(AGHAF_CAN_Bus bus, AGHAF_CAN_Frame frame)
send a frame on a CAN bus
Definition: aghaf_can.cpp:515
void const * AGHAF_CAN_Event_busInfo
Handle to a CAN event bus info.
Definition: aghaf_can.h:98
AGHAF_Status AGHAF_CAN_Frame_setId(AGHAF_CAN_Frame frame, AGHAF_CAN_Identifier *identifier)
Set the identifier from a CAN frame.
Definition: aghaf_can.cpp:372
AGHAF_Status AGHAF_CAN_Frame_setData(AGHAF_CAN_Frame frame, const void *data, int64_t size)
Set the data from a frame.
Definition: aghaf_can.cpp:469
uint8_t AGHAF_CAN_getBusCount(AGHAF_Device device)
return the number of CAN bus from a device
Definition: aghaf_can.cpp:35
uint8_t AGHAF_CAN_Bus_getPeriodicCount(AGHAF_CAN_Bus bus)
Return the number of periodic message available on a CAN bus.
Definition: aghaf_can.cpp:241
AGHAF_Status AGHAF_CAN_Frame_id(AGHAF_CAN_Frame frame, AGHAF_CAN_Identifier *identifier)
Get the identifier from a CAN frame.
Definition: aghaf_can.cpp:385
AGHAF_Status AGHAF_CAN_Bus_BusOn(AGHAF_CAN_Bus bus)
reactivate the bus after an error
Definition: aghaf_can.cpp:155
AGHAF_Status AGHAF_CAN_sendMessage(AGHAF_CAN_Bus bus, uint32_t ident, uint8_t flags, uint16_t dataLen, uint8_t const *data)
send data on a CAN bus
Definition: aghaf_can.cpp:529
AGHAF_Status AGHAF_CAN_Bus_clearFilters(AGHAF_CAN_Bus bus)
clear the filters from a bus
Definition: aghaf_can.cpp:290
void(* AGHAF_CAN_Callback)(AGHAF_CAN_Event event, void *userContext)
Callback function type to recieve CAN events.
Definition: aghaf_can.h:109
uint8_t AGHAF_CAN_getEventBusIndex(AGHAF_CAN_Event event)
return the index from the bus on which occured the event
Definition: aghaf_can.cpp:583
void AGHAF_CAN_Bus_freeSupportedModes(AGHAF_CAN_Mode *modes)
Free the memory allocated with AGHAF_CAN_Bus_supportedModes.
Definition: aghaf_can.cpp:133
void AGHAF_CAN_Frame_delete(AGHAF_CAN_Frame frame)
Free the memory from a CAN frame.
Definition: aghaf_can.cpp:361
struct AGHAF_CAN_FilterDesc AGHAF_CAN_FilterDesc
structure to tell the filter capabilities from an exxotest device
uint32_t AGHAF_CAN_Event_busLoad(AGHAF_CAN_Event_busInfo busState)
return the bus load
Definition: aghaf_can.cpp:603
AGHAF_Status AGHAF_CAN_Bus_supportedModes(AGHAF_CAN_Bus bus, AGHAF_CAN_Mode **modes, uint8_t *nbModes)
Request the supported modes from the CAN bus in parameter.
Definition: aghaf_can.cpp:122
AGHAF_Status AGHAF_CAN_Frame_setFrameType(AGHAF_CAN_Frame frame, AGHAF_CAN_FrameType type)
Set the type from the frame.
Definition: aghaf_can.cpp:399
AGHAF_CAN_FrameType
type of frame
Definition: aghaf_can.h:28
int64_t AGHAF_CAN_Frame_dataSize(AGHAF_CAN_Frame frame)
return the size from the data
Definition: aghaf_can.cpp:504
AGHAF_Status AGHAF_CAN_Bus_supportedTerminations(AGHAF_CAN_Bus bus, uint32_t **terminations, uint32_t *nbTerminations)
Request the supported terminations from a CAN bus.
Definition: aghaf_can.cpp:204
AGHAF_CAN_Event_busInfo AGHAF_CAN_getEventBusInfo(AGHAF_CAN_Event event)
return the bus informations from an event
Definition: aghaf_can.cpp:573
AGHAF_Status AGHAF_CAN_Bus_filtersCount(AGHAF_CAN_Bus bus, AGHAF_CAN_FilterId idType, uint16_t *count)
Provide the current number of filters.
Definition: aghaf_can.cpp:302
void AGHAF_CAN_asyncSendFrame_deregisterCallback(AGHAF_CAN_Bus bus, AGHAF_CAN_asyncSendFrame_Callback callback)
AGHAF_CAN_asyncSendFrame_deregisterCallback.
Definition: aghaf_can.cpp:81
AGHAF_Status AGHAF_CAN_Bus_getParam(AGHAF_CAN_Bus bus, AGHAF_CAN_Param param, uint32_t *value)
Provide the value from a CAN parameter.
Definition: aghaf_can.cpp:94
uint32_t AGHAF_CAN_Event_chipState(AGHAF_CAN_Event_busInfo busState)
return the chipstate
Definition: aghaf_can.cpp:593
AGHAF_Status AGHAF_CAN_Frame_setFDF(AGHAF_CAN_Frame frame, AGHAF_BOOL fdf, AGHAF_BOOL esi, AGHAF_BOOL brs)
AGHAF_CAN_Frame_setFDF.
Definition: aghaf_can.cpp:424
void * AGHAF_CAN_Event
Handle to a CAN event.
Definition: aghaf_can.h:95
AGHAF_Status AGHAF_CAN_Bus_setParam(AGHAF_CAN_Bus bus, AGHAF_CAN_Param param, uint32_t value)
Set the value from a CAN parameter.
Definition: aghaf_can.cpp:107
uint32_t AGHAF_CAN_Event_busError(AGHAF_CAN_Event_busInfo busState)
return the value from the error
Definition: aghaf_can.cpp:613
AGHAF_CAN_FILTER_Type
type of the filter
Definition: aghaf_can.h:77
AGHAF_CAN_EventType AGHAF_CAN_typeEvent(AGHAF_EventInfo event)
return the type from the event
Definition: aghaf_can.cpp:564
void(* AGHAF_CAN_asyncSendFrame_Callback)(AGHAF_Status status, uint32_t id, void *userContext)
Callback function type to recieve CAN events.
Definition: aghaf_can.h:260
AGHAF_BOOL AGHAF_CAN_Frame_brs(AGHAF_CAN_Frame frame)
AGHAF_CAN_Frame_brs.
Definition: aghaf_can.cpp:457
void AGHAF_CAN_Bus_freeSupportedFilters(AGHAF_CAN_FilterDesc *values)
Free the memory allocated with AGHAF_CAN_Bus_supportedFilters.
Definition: aghaf_can.cpp:332
void AGHAF_CAN_asyncSendFrame_registerCallback(AGHAF_CAN_Bus bus, AGHAF_CAN_asyncSendFrame_Callback callback, void *userContext)
AGHAF_CAN_asyncSendFrame_registerCallback.
Definition: aghaf_can.cpp:69
AGHAF_Status AGHAF_CAN_Bus_activate(AGHAF_CAN_Bus bus)
activate a CAN bus
Definition: aghaf_can.cpp:165
void * AGHAF_CAN_Frame
Handle to a CAN frame.
Definition: aghaf_can.h:92
@ AGHAF_CAN_IdStd
Standard 11 bit identifier.
Definition: aghaf_can.h:23
@ AGHAF_CAN_IdXtd
Extended 29 bit identifier.
Definition: aghaf_can.h:24
AGHAF_Status
enumerator to define the error type in aghaf functions
Definition: aghaf_global.h:120
AGHAF_BOOL
enumerator to get a bool definition
Definition: aghaf_global.h:114
void * AGHAF_Device
handle on an exxotest device
Definition: aghaf_global.h:175
structure to tell the filter capabilities from an exxotest device
Definition: aghaf_can.h:126
uint16_t count
number of filters supported
Definition: aghaf_can.h:128
structure to represent an indentifier CAN in the AGHAF library
Definition: aghaf_can.h:115
union AGHAF_CAN_Identifier::@0 id
Identifier.
uint16_t std
Standard identifier.
Definition: aghaf_can.h:118
AGHAF_CAN_IdentifierType type
Identifier type.
Definition: aghaf_can.h:116
uint32_t xtd
Extended identifier.
Definition: aghaf_can.h:119
generic stucture to read an event in a callback
Definition: aghaf_global.h:229