AGHAF  4.5.1
Annecy electronique Generic Hardware Access Framework
CAN

API to use CAN on exxotest devices. More...

enum  AGHAF_CAN_IdentifierType { AGHAF_CAN_IdStd , AGHAF_CAN_IdXtd }
 enumerator to choose the type of CAN identifier More...
 
enum  AGHAF_CAN_FrameType { AGHAF_CAN_DataFrame = 0 , AGHAF_CAN_RemoteFrame = 1 }
 type of frame More...
 
enum  AGHAF_CAN_BusState { AGHAF_CAN_BUS_UNKNOW = 0 , AGHAF_CAN_BUS_ACTIVE , AGHAF_CAN_BUS_PASSIVE , AGHAF_CAN_BUS_BUSOFF }
 enumerator for the state of the bus More...
 
enum  AGHAF_CAN_EventType {
  AGHAF_CAN_EVENT_UNKNOW = 0 , AGHAF_CAN_EVENT_MSGTX = 1 , AGHAF_CAN_EVENT_MSGRX = 2 , AGHAF_CAN_EVENT_ERROR = 3 ,
  AGHAF_CAN_EVENT_BUSCHANGE = 4 , AGHAF_CAN_EVENT_BUSLOAD = 5
}
 enumerator to tell the type of the event More...
 
enum  AGHAF_CAN_RejectType { AGHAF_CAN_REJECT_ALL = 0 , AGHAF_CAN_REJECT_STD = 1 , AGHAF_CAN_REJECT_EXT = 2 , AGHAF_CAN_REJECT_NONE = 3 }
 enumerator to choose the type of exclusion filter More...
 
enum  AGHAF_CAN_FilterId { AGHAF_CAN_FILTER_ID_STD = 0 , AGHAF_CAN_FILTER_ID_XTD = 1 }
 enumerator to choose the identifier type for can filter More...
 
enum  AGHAF_CAN_FilterMode { AGHAF_CAN_FILTER_MODE_ACCEPT = 0 , AGHAF_CAN_FILTER_MODE_REJECT = 1 }
 enumerator to choose the type of the filter: accept or reject More...
 
enum  AGHAF_CAN_FILTER_Type { AGHAF_CAN_FILTER_TYPE_CLASSIC = 0 , AGHAF_CAN_FILTER_TYPE_SINGLE = 1 , AGHAF_CAN_FILTER_TYPE_DUAL = 2 , AGHAF_CAN_FILTER_TYPE_RANGE = 3 }
 type of the filter More...
 
typedef void * AGHAF_CAN_Bus
 handle to a CAN bus More...
 
typedef void * AGHAF_CAN_Frame
 Handle to a CAN frame. More...
 
typedef void * AGHAF_CAN_Event
 Handle to a CAN event.
 
typedef void const * AGHAF_CAN_Event_busInfo
 Handle to a CAN event bus info.
 
typedef void(* AGHAF_CAN_Callback) (AGHAF_CAN_Event event, void *userContext)
 Callback function type to recieve CAN events. More...
 
typedef struct AGHAF_CAN_Identifier AGHAF_CAN_Identifier
 structure to represent an indentifier CAN in the AGHAF library
 
typedef struct AGHAF_CAN_FilterDesc AGHAF_CAN_FilterDesc
 structure to tell the filter capabilities from an exxotest device
 
typedef void(* AGHAF_CAN_asyncSendFrame_Callback) (AGHAF_Status status, uint32_t id, void *userContext)
 Callback function type to recieve CAN events. More...
 
AGHAF_CAN_Bus AGHAF_CAN_getBus (AGHAF_Device device, uint8_t index)
 return the CAN bus at index in parameter More...
 
uint8_t AGHAF_CAN_getBusIndex (AGHAF_CAN_Bus bus)
 return the index from a CAN bus More...
 
uint8_t AGHAF_CAN_getBusCount (AGHAF_Device device)
 return the number of CAN bus from a device More...
 
void AGHAF_CAN_registerCallback (AGHAF_CAN_Bus bus, AGHAF_CAN_Callback callback, void *userContext)
 Register a callback for the CAN events from a bus. More...
 
void AGHAF_CAN_deregisterCallback (AGHAF_CAN_Bus bus, AGHAF_CAN_Callback callback)
 deregister a callback More...
 
void AGHAF_CAN_asyncSendFrame_registerCallback (AGHAF_CAN_Bus bus, AGHAF_CAN_asyncSendFrame_Callback callback, void *userContext)
 AGHAF_CAN_asyncSendFrame_registerCallback. More...
 
void AGHAF_CAN_asyncSendFrame_deregisterCallback (AGHAF_CAN_Bus bus, AGHAF_CAN_asyncSendFrame_Callback callback)
 AGHAF_CAN_asyncSendFrame_deregisterCallback. More...
 
AGHAF_Status AGHAF_CAN_Bus_getParam (AGHAF_CAN_Bus bus, AGHAF_CAN_Param param, uint32_t *value)
 Provide the value from a CAN parameter. More...
 
AGHAF_Status AGHAF_CAN_Bus_setParam (AGHAF_CAN_Bus bus, AGHAF_CAN_Param param, uint32_t value)
 Set the value from a CAN parameter. More...
 
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. More...
 
void AGHAF_CAN_Bus_freeSupportedModes (AGHAF_CAN_Mode *modes)
 Free the memory allocated with AGHAF_CAN_Bus_supportedModes. More...
 
AGHAF_Status AGHAF_CAN_Bus_state (AGHAF_CAN_Bus bus, AGHAF_CAN_BusState *canBusState)
 AGHAF_CAN_Bus_state. More...
 
AGHAF_Status AGHAF_CAN_Bus_BusOn (AGHAF_CAN_Bus bus)
 reactivate the bus after an error More...
 
AGHAF_Status AGHAF_CAN_Bus_activate (AGHAF_CAN_Bus bus)
 activate a CAN bus More...
 
AGHAF_Status AGHAF_CAN_Bus_deactivate (AGHAF_CAN_Bus bus)
 deactivate a CAN bus More...
 
AGHAF_Status AGHAF_CAN_Bus_isActivated (AGHAF_CAN_Bus bus, AGHAF_BOOL *isActivated)
 Request if a CAN bus is yet activated or not. More...
 
AGHAF_Status AGHAF_CAN_Bus_supportedTerminations (AGHAF_CAN_Bus bus, uint32_t **terminations, uint32_t *nbTerminations)
 Request the supported terminations from a CAN bus. More...
 
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. More...
 
void AGHAF_CAN_Bus_freeSupportedTerminations (uint32_t *terminations)
 Free the memory allocated with AGHAF_CAN_Bus_supportedTerminations or AGHAF_CAN_Bus_supportedTerminationsLs. More...
 
uint8_t AGHAF_CAN_Bus_getPeriodicCount (AGHAF_CAN_Bus bus)
 Return the number of periodic message available on a CAN bus. More...
 
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. More...
 
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 More...
 
AGHAF_Status AGHAF_CAN_Bus_clearFilters (AGHAF_CAN_Bus bus)
 clear the filters from a bus More...
 
AGHAF_Status AGHAF_CAN_Bus_filtersCount (AGHAF_CAN_Bus bus, AGHAF_CAN_FilterId idType, uint16_t *count)
 Provide the current number of filters. More...
 
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. More...
 
void AGHAF_CAN_Bus_freeSupportedFilters (AGHAF_CAN_FilterDesc *values)
 Free the memory allocated with AGHAF_CAN_Bus_supportedFilters. More...
 
AGHAF_Status AGHAF_CAN_Bus_reject (AGHAF_CAN_Bus bus, AGHAF_CAN_RejectType rejectType, AGHAF_BOOL rtr)
 Set a global filter. More...
 
AGHAF_CAN_Frame AGHAF_CAN_Frame_new ()
 Return a handle on a CAN frame. More...
 
void AGHAF_CAN_Frame_delete (AGHAF_CAN_Frame frame)
 Free the memory from a CAN frame. More...
 
AGHAF_Status AGHAF_CAN_Frame_setId (AGHAF_CAN_Frame frame, AGHAF_CAN_Identifier *identifier)
 Set the identifier from a CAN frame. More...
 
AGHAF_Status AGHAF_CAN_Frame_id (AGHAF_CAN_Frame frame, AGHAF_CAN_Identifier *identifier)
 Get the identifier from a CAN frame. More...
 
AGHAF_Status AGHAF_CAN_Frame_setFrameType (AGHAF_CAN_Frame frame, AGHAF_CAN_FrameType type)
 Set the type from the frame. More...
 
AGHAF_CAN_FrameType AGHAF_CAN_Frame_frameType (AGHAF_CAN_Frame frame)
 Get the type from the frame. More...
 
AGHAF_Status AGHAF_CAN_Frame_setFDF (AGHAF_CAN_Frame frame, AGHAF_BOOL fdf, AGHAF_BOOL esi, AGHAF_BOOL brs)
 AGHAF_CAN_Frame_setFDF. More...
 
AGHAF_BOOL AGHAF_CAN_Frame_fdf (AGHAF_CAN_Frame frame)
 AGHAF_CAN_Frame_fdf. More...
 
AGHAF_BOOL AGHAF_CAN_Frame_esi (AGHAF_CAN_Frame frame)
 AGHAF_CAN_Frame_esi. More...
 
AGHAF_BOOL AGHAF_CAN_Frame_brs (AGHAF_CAN_Frame frame)
 AGHAF_CAN_Frame_brs. More...
 
AGHAF_Status AGHAF_CAN_Frame_setData (AGHAF_CAN_Frame frame, const void *data, int64_t size)
 Set the data from a frame. More...
 
AGHAF_Status AGHAF_CAN_Frame_data (AGHAF_CAN_Frame frame, void *data, int64_t size)
 Provide the data contained in a frame. More...
 
int64_t AGHAF_CAN_Frame_dataSize (AGHAF_CAN_Frame frame)
 return the size from the data More...
 
AGHAF_Status AGHAF_CAN_sendFrame (AGHAF_CAN_Bus bus, AGHAF_CAN_Frame frame)
 send a frame on a CAN bus More...
 
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 More...
 
void AGHAF_CAN_asyncSendFrame (AGHAF_CAN_Bus bus, AGHAF_CAN_Frame frame, uint32_t *id)
 AGHAF_CAN_asyncSendFrame. More...
 
AGHAF_CAN_Frame AGHAF_CAN_Event_frame (AGHAF_CAN_Event event)
 return the frame contained in an event More...
 
AGHAF_CAN_EventType AGHAF_CAN_typeEvent (AGHAF_EventInfo event)
 return the type from the event More...
 
AGHAF_CAN_Event_busInfo AGHAF_CAN_getEventBusInfo (AGHAF_CAN_Event event)
 return the bus informations from an event More...
 
uint8_t AGHAF_CAN_getEventBusIndex (AGHAF_CAN_Event event)
 return the index from the bus on which occured the event More...
 
uint32_t AGHAF_CAN_Event_chipState (AGHAF_CAN_Event_busInfo busState)
 return the chipstate More...
 
uint32_t AGHAF_CAN_Event_busLoad (AGHAF_CAN_Event_busInfo busState)
 return the bus load More...
 
uint32_t AGHAF_CAN_Event_busError (AGHAF_CAN_Event_busInfo busState)
 return the value from the error More...
 

Detailed Description

API to use CAN on exxotest devices.

Usage Example

Call order and priority

Device is in "init" state at startup.

The following section describes state management:


Symbol Description
Forbidden
Authorized
Followed status


Function Config Active
AGHAF_CAN_getBus
AGHAF_CAN_getBusCount
AGHAF_CAN_registerCallback
AGHAF_CAN_deregisterCallback
AGHAF_CAN_Bus_getParam
AGHAF_CAN_Bus_setParam
AGHAF_CAN_Bus_supportedModes
AGHAF_CAN_Bus_addFilter
AGHAF_CAN_Bus_clearFilters
AGHAF_CAN_Bus_filtersCount
AGHAF_CAN_Bus_reject
AGHAF_CAN_Bus_supportedFilters
AGHAF_CAN_Bus_activate
AGHAF_CAN_Bus_deactivate
AGHAF_CAN_Bus_isActivated
AGHAF_CAN_Bus_supportedTerminations
AGHAF_CAN_Bus_supportedTerminationsLs
AGHAF_CAN_Bus_state
AGHAF_CAN_Bus_BusOn
AGHAF_CAN_sendFrame
AGHAF_CAN_Bus_sendPeriodic
AGHAF_CAN_Bus_getPeriodicCount

Typedef Documentation

◆ AGHAF_CAN_asyncSendFrame_Callback

AGHAF_CAN_asyncSendFrame_Callback

Callback function type to recieve CAN events.

Parameters
statusof the sending to tell if it succeeded or not
idid of the frame sent
userContextSame parameter as the one passed to AGHAF_CAN_asyncSendFrame_registerCallback().
Returns
void

◆ AGHAF_CAN_Bus

typedef void* AGHAF_CAN_Bus

handle to a CAN bus

handle to a CAN bus

◆ AGHAF_CAN_Callback

AGHAF_CAN_Callback

Callback function type to recieve CAN events.

Parameters
eventHandle to the event.
userContextSame parameter as the one passed to AGHAF_CAN_registerCallback().
Returns
void
Note
Do not delete the event within the body of a callback function.

◆ AGHAF_CAN_Frame

typedef void* AGHAF_CAN_Frame

Handle to a CAN frame.

Handle to a CAN frame

Enumeration Type Documentation

◆ AGHAF_CAN_BusState

enumerator for the state of the bus

Enumerator
AGHAF_CAN_BUS_UNKNOW 

Invalide mode.

AGHAF_CAN_BUS_ACTIVE 

active error state

AGHAF_CAN_BUS_PASSIVE 

Passive error state.

AGHAF_CAN_BUS_BUSOFF 

Bus off state.

◆ AGHAF_CAN_EventType

enumerator to tell the type of the event

Enumerator
AGHAF_CAN_EVENT_UNKNOW 

Unknown type of event.

AGHAF_CAN_EVENT_MSGTX 

End of transmission.

AGHAF_CAN_EVENT_MSGRX 

Message has been received.

AGHAF_CAN_EVENT_ERROR 

Bus error.

AGHAF_CAN_EVENT_BUSCHANGE 

Chip state has chaged active or passive error ou bus off.

AGHAF_CAN_EVENT_BUSLOAD 

Bus load information.

◆ AGHAF_CAN_FILTER_Type

type of the filter

Enumerator
AGHAF_CAN_FILTER_TYPE_CLASSIC 

id1 is the identifier and id2 is the mask

AGHAF_CAN_FILTER_TYPE_SINGLE 

id1 is the identifier you want to filter. id2 is not used.

AGHAF_CAN_FILTER_TYPE_DUAL 

id1 is an identifier and id2 is an identifier too

AGHAF_CAN_FILTER_TYPE_RANGE 

allow to filter on a range (id1 is the beginning and id2 is the end)

◆ AGHAF_CAN_FilterId

enumerator to choose the identifier type for can filter

Enumerator
AGHAF_CAN_FILTER_ID_STD 

Filter for frames with standard can Id.

AGHAF_CAN_FILTER_ID_XTD 

filter for frames with an extended can Id

◆ AGHAF_CAN_FilterMode

enumerator to choose the type of the filter: accept or reject

Enumerator
AGHAF_CAN_FILTER_MODE_ACCEPT 

Accept mode for a can filter.

AGHAF_CAN_FILTER_MODE_REJECT 

Reject mode for a can filter.

◆ AGHAF_CAN_FrameType

type of frame

Enumerator
AGHAF_CAN_DataFrame 

standard frame of data

AGHAF_CAN_RemoteFrame 

a remote frame means we send only the id and the data field is completed by another device on the bus

◆ AGHAF_CAN_IdentifierType

enumerator to choose the type of CAN identifier

Enumerator
AGHAF_CAN_IdStd 

Standard 11 bit identifier.

AGHAF_CAN_IdXtd 

Extended 29 bit identifier.

◆ AGHAF_CAN_RejectType

enumerator to choose the type of exclusion filter

Enumerator
AGHAF_CAN_REJECT_ALL 

Reject all non matching frames.

AGHAF_CAN_REJECT_STD 

Reject all non matching frames with a standard can Id.

AGHAF_CAN_REJECT_EXT 

Reject all non matching frames with an extended can Id.

AGHAF_CAN_REJECT_NONE 

Accept all the frames.

Function Documentation

◆ AGHAF_CAN_asyncSendFrame()

void AGHAF_CAN_asyncSendFrame ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_Frame  frame,
uint32_t *  id 
)

AGHAF_CAN_asyncSendFrame.

Parameters
bushandle on the CAN bus
framehandle on the frame
idid used to recognize the frame in the callback
Returns

◆ AGHAF_CAN_asyncSendFrame_deregisterCallback()

void AGHAF_CAN_asyncSendFrame_deregisterCallback ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_asyncSendFrame_Callback  callback 
)

AGHAF_CAN_asyncSendFrame_deregisterCallback.

Parameters
bushandle on the bus
callbackfunction pointer to remove

◆ AGHAF_CAN_asyncSendFrame_registerCallback()

void AGHAF_CAN_asyncSendFrame_registerCallback ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_asyncSendFrame_Callback  callback,
void *  userContext 
)

AGHAF_CAN_asyncSendFrame_registerCallback.

Parameters
bushandle on the bus
callbackfunction pointer to call when a frame has been sent
userContext

◆ AGHAF_CAN_Bus_activate()

AGHAF_Status AGHAF_CAN_Bus_activate ( AGHAF_CAN_Bus  bus)

activate a CAN bus

Parameters
bushandle on the bus
Returns
status request information
Examples
Can_FD/main.cpp, Can_LS/main.cpp, and DoCan_FD/main.cpp.

◆ AGHAF_CAN_Bus_addFilter()

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

Parameters
bushandle on the bus
idTypestandard or extended CAN
typetype from the filter
modemode from the filter
id1
id2
Returns
status request information

◆ AGHAF_CAN_Bus_BusOn()

AGHAF_Status AGHAF_CAN_Bus_BusOn ( AGHAF_CAN_Bus  bus)

reactivate the bus after an error

Parameters
bushandle on the bus
Returns
status request information

◆ AGHAF_CAN_Bus_clearFilters()

AGHAF_Status AGHAF_CAN_Bus_clearFilters ( AGHAF_CAN_Bus  bus)

clear the filters from a bus

Parameters
bushandle on the bus
Returns
status request information

◆ AGHAF_CAN_Bus_deactivate()

AGHAF_Status AGHAF_CAN_Bus_deactivate ( AGHAF_CAN_Bus  bus)

deactivate a CAN bus

Parameters
bushandle on the bus
Returns
status request information
Examples
Can_FD/main.cpp, Can_LS/main.cpp, and DoCan_FD/main.cpp.

◆ AGHAF_CAN_Bus_filtersCount()

AGHAF_Status AGHAF_CAN_Bus_filtersCount ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_FilterId  idType,
uint16_t *  count 
)

Provide the current number of filters.

Parameters
bushandle on the bus
idTypestandard or extended CAN
countpointer to fill with the data
Returns
status request information

◆ AGHAF_CAN_Bus_freeSupportedFilters()

void AGHAF_CAN_Bus_freeSupportedFilters ( AGHAF_CAN_FilterDesc values)

Free the memory allocated with AGHAF_CAN_Bus_supportedFilters.

Parameters
valuesarray to free

◆ AGHAF_CAN_Bus_freeSupportedModes()

void AGHAF_CAN_Bus_freeSupportedModes ( AGHAF_CAN_Mode modes)

Free the memory allocated with AGHAF_CAN_Bus_supportedModes.

Parameters
modesarray to free

◆ AGHAF_CAN_Bus_freeSupportedTerminations()

void AGHAF_CAN_Bus_freeSupportedTerminations ( uint32_t *  terminations)

Free the memory allocated with AGHAF_CAN_Bus_supportedTerminations or AGHAF_CAN_Bus_supportedTerminationsLs.

Parameters
terminationsarray to free

◆ AGHAF_CAN_Bus_getParam()

AGHAF_Status AGHAF_CAN_Bus_getParam ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_Param  param,
uint32_t *  value 
)

Provide the value from a CAN parameter.

Parameters
bushandle on the CAN bus
paramparameter to request
valuepointer to fill with the content
Returns
status request information

◆ AGHAF_CAN_Bus_getPeriodicCount()

uint8_t AGHAF_CAN_Bus_getPeriodicCount ( AGHAF_CAN_Bus  bus)

Return the number of periodic message available on a CAN bus.

Parameters
bushandle on the bus
Returns
the number of periodic message available

◆ AGHAF_CAN_Bus_isActivated()

AGHAF_Status AGHAF_CAN_Bus_isActivated ( AGHAF_CAN_Bus  bus,
AGHAF_BOOL isActivated 
)

Request if a CAN bus is yet activated or not.

Parameters
bushandle on the bus
isActivatedpointer to fill with the information
Returns
status request information

◆ AGHAF_CAN_Bus_reject()

AGHAF_Status AGHAF_CAN_Bus_reject ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_RejectType  rejectType,
AGHAF_BOOL  rtr 
)

Set a global filter.

Parameters
bushandle on the bus
rejectTypetype of reject desired
rtr
Returns
status request information

◆ AGHAF_CAN_Bus_sendPeriodic()

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.

Parameters
bushandle on the bus
frameFrame to send periodically
indexindex in which to save the frame
flagsAGHAF_CAN_PERIODIC_FLAGS
periodperiod at which sending the frame (ms)
Returns
status request information
Note
A period of zero stops the priodic frame.

◆ AGHAF_CAN_Bus_setParam()

AGHAF_Status AGHAF_CAN_Bus_setParam ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_Param  param,
uint32_t  value 
)

Set the value from a CAN parameter.

Parameters
bushandle on the CAN bus
paramparameter to set
valuevalue to set
Returns
status request information
Examples
Can_FD/main.cpp, Can_LS/main.cpp, and DoCan_FD/main.cpp.

◆ AGHAF_CAN_Bus_state()

AGHAF_Status AGHAF_CAN_Bus_state ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_BusState canBusState 
)

AGHAF_CAN_Bus_state.

Parameters
bus
canBusStateUNKNOWN if can chip is not started, can chip state otherwise
Returns
status request information

◆ AGHAF_CAN_Bus_supportedFilters()

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.

Parameters
bushandle on the bus
globalFilterCapspointer to fill with global cappabilites informations
valuespointer to fill with the datas
sizesize from values arrays
Returns
status request information
Warning
the memory allocated in values must freed with AGHAF_CAN_Bus_freeSupportedFilters

◆ AGHAF_CAN_Bus_supportedModes()

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.

Parameters
bushandle on the bus
modespointer on the datas
nbModessize from the modes array
Returns
status request information
Warning
the memory allocated in modes must freed with AGHAF_CAN_Bus_freeSupportedModes

◆ AGHAF_CAN_Bus_supportedTerminations()

AGHAF_Status AGHAF_CAN_Bus_supportedTerminations ( AGHAF_CAN_Bus  bus,
uint32_t **  terminations,
uint32_t *  nbTerminations 
)

Request the supported terminations from a CAN bus.

Parameters
bushandle on the bus
terminationspointer on the datas
nbTerminationssize from the modes array
Returns
status request information
Warning
the memory allocated in terminations must freed with AGHAF_CAN_Bus_freeSupportedTerminations

◆ AGHAF_CAN_Bus_supportedTerminationsLs()

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.

Parameters
bushandle on the bus
terminationspointer on the datas
nbTerminationssize from the modes array
Returns
status request information
Warning
the memory allocated in terminations must freed with AGHAF_CAN_Bus_freeSupportedTerminations

◆ AGHAF_CAN_deregisterCallback()

void AGHAF_CAN_deregisterCallback ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_Callback  callback 
)

deregister a callback

Parameters
bushandle on the bus
callbackfunction pointer to remove
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_Event_busError()

uint32_t AGHAF_CAN_Event_busError ( AGHAF_CAN_Event_busInfo  busState)

return the value from the error

Parameters
busState
Returns
corresponds to AGHAF_CAN_Error enumerator

◆ AGHAF_CAN_Event_busLoad()

uint32_t AGHAF_CAN_Event_busLoad ( AGHAF_CAN_Event_busInfo  busState)

return the bus load

Parameters
busState
Returns

◆ AGHAF_CAN_Event_chipState()

uint32_t AGHAF_CAN_Event_chipState ( AGHAF_CAN_Event_busInfo  busState)

return the chipstate

Parameters
busState
Returns

◆ AGHAF_CAN_Event_frame()

AGHAF_CAN_Frame AGHAF_CAN_Event_frame ( AGHAF_CAN_Event  event)

return the frame contained in an event

Parameters
eventhandle on an event
Returns
the frame
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_Frame_brs()

AGHAF_BOOL AGHAF_CAN_Frame_brs ( AGHAF_CAN_Frame  frame)

AGHAF_CAN_Frame_brs.

Parameters
framehandle on the frame
Returns
brs value which indicates if data field is sent to the FD baudrate or not

◆ AGHAF_CAN_Frame_data()

AGHAF_Status AGHAF_CAN_Frame_data ( AGHAF_CAN_Frame  frame,
void *  data,
int64_t  size 
)

Provide the data contained in a frame.

Parameters
framehandle on the frame
dataarray to fill
sizesize that has been filled
Returns
status request information
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_Frame_dataSize()

int64_t AGHAF_CAN_Frame_dataSize ( AGHAF_CAN_Frame  frame)

return the size from the data

Parameters
framehandle on the frame
Returns
size from the datas in the frame
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_Frame_delete()

void AGHAF_CAN_Frame_delete ( AGHAF_CAN_Frame  frame)

Free the memory from a CAN frame.

Parameters
framehandle to free
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_Frame_esi()

AGHAF_BOOL AGHAF_CAN_Frame_esi ( AGHAF_CAN_Frame  frame)

AGHAF_CAN_Frame_esi.

Parameters
framehandle on the frame
Returns
error state indicator value

◆ AGHAF_CAN_Frame_fdf()

AGHAF_BOOL AGHAF_CAN_Frame_fdf ( AGHAF_CAN_Frame  frame)

AGHAF_CAN_Frame_fdf.

Parameters
framehandle on the frame
Returns
fdf value which indicates if FD is activated or not

◆ AGHAF_CAN_Frame_frameType()

AGHAF_CAN_FrameType AGHAF_CAN_Frame_frameType ( AGHAF_CAN_Frame  frame)

Get the type from the frame.

Parameters
framehandle on the frame
Returns
type from the frame

◆ AGHAF_CAN_Frame_id()

AGHAF_Status AGHAF_CAN_Frame_id ( AGHAF_CAN_Frame  frame,
AGHAF_CAN_Identifier identifier 
)

Get the identifier from a CAN frame.

Parameters
framehandle on the frame
identifier
Returns
status request information
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_Frame_new()

AGHAF_CAN_Frame AGHAF_CAN_Frame_new ( void  )

Return a handle on a CAN frame.

Returns
handle on a CAN frame
Warning
the handle must be freed with AGHAF_CAN_Frame_delete
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_Frame_setData()

AGHAF_Status AGHAF_CAN_Frame_setData ( AGHAF_CAN_Frame  frame,
const void *  data,
int64_t  size 
)

Set the data from a frame.

Parameters
framehandle on the frame
datadata to set
sizesize from data array
Returns
status request information
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_Frame_setFDF()

AGHAF_Status AGHAF_CAN_Frame_setFDF ( AGHAF_CAN_Frame  frame,
AGHAF_BOOL  fdf,
AGHAF_BOOL  esi,
AGHAF_BOOL  brs 
)

AGHAF_CAN_Frame_setFDF.

Parameters
framehandle on the frame
fdfactivate the FD for the frame (allow to send more than 8 bytes)
esierror state indicator
brsif true then the field data is sent to the FD baudrate
Returns
Examples
Can_FD/main.cpp.

◆ AGHAF_CAN_Frame_setFrameType()

AGHAF_Status AGHAF_CAN_Frame_setFrameType ( AGHAF_CAN_Frame  frame,
AGHAF_CAN_FrameType  type 
)

Set the type from the frame.

Parameters
framehandle on the frame
typedata or remote (a remote frame is completed by another device on the CAN bus)
Returns
status request information

◆ AGHAF_CAN_Frame_setId()

AGHAF_Status AGHAF_CAN_Frame_setId ( AGHAF_CAN_Frame  frame,
AGHAF_CAN_Identifier identifier 
)

Set the identifier from a CAN frame.

Parameters
framehandle on the frame
identifier
Returns
status request information
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_getBus()

AGHAF_CAN_Bus AGHAF_CAN_getBus ( AGHAF_Device  device,
uint8_t  index 
)

return the CAN bus at index in parameter

Parameters
devicedevice handle from the desired CAN bus
indexindex from the bus
Returns
Handle on a CAN bus
Examples
Can_FD/main.cpp, Can_LS/main.cpp, and DoCan_FD/main.cpp.

◆ AGHAF_CAN_getBusCount()

uint8_t AGHAF_CAN_getBusCount ( AGHAF_Device  device)

return the number of CAN bus from a device

Parameters
devicehandle from the device
Returns
Number of CAN bus on the device

◆ AGHAF_CAN_getBusIndex()

uint8_t AGHAF_CAN_getBusIndex ( AGHAF_CAN_Bus  bus)

return the index from a CAN bus

Parameters
bushandle from the CAN bus
Returns
index from the bus

◆ AGHAF_CAN_getEventBusIndex()

uint8_t AGHAF_CAN_getEventBusIndex ( AGHAF_CAN_Event  event)

return the index from the bus on which occured the event

Parameters
eventhandle on an event
Returns
index from bus

◆ AGHAF_CAN_getEventBusInfo()

AGHAF_CAN_Event_busInfo AGHAF_CAN_getEventBusInfo ( AGHAF_CAN_Event  event)

return the bus informations from an event

Parameters
eventhandle on an event
Returns

◆ AGHAF_CAN_registerCallback()

void AGHAF_CAN_registerCallback ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_Callback  callback,
void *  userContext 
)

Register a callback for the CAN events from a bus.

Parameters
bushandle on the bus
callbackfunction pointer to call on an event
userContext
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_sendFrame()

AGHAF_Status AGHAF_CAN_sendFrame ( AGHAF_CAN_Bus  bus,
AGHAF_CAN_Frame  frame 
)

send a frame on a CAN bus

Parameters
bushandle on the CAN bus
framehandle on the frame
Returns
status request information
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.

◆ AGHAF_CAN_sendMessage()

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

Parameters
bushandle on the CAN bus
identCAN identifier
flagsflags starting with AGHAF_CAN_MSG_
dataLenlength of data
datadata to send
Returns
status request information

◆ AGHAF_CAN_typeEvent()

AGHAF_CAN_EventType AGHAF_CAN_typeEvent ( AGHAF_EventInfo  event)

return the type from the event

Parameters
event
Returns
type from the event
Examples
Can_FD/main.cpp, and Can_LS/main.cpp.