Loading [MathJax]/extensions/tex2jax.js
AGHAF  4.5.5
Annecy electronique Generic Hardware Access Framework
All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Modules
DoCAN V2

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

typedef void * AGHAF_DoCAN_v2_Channel
 Handle to a DoCAN channel.
 
typedef void(* AGHAF_DoCAN_onMessageTx) (uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, uint32_t dataLen, uint8_t const *data, void *userContext)
 callback function called when a message is transmitted on a DoCAN channel More...
 
typedef void(* AGHAF_DoCAN_onMessageTxError) (uint64_t timestamp, AGHAF_DoCan_Error error, void *userContext)
 callback function called when an error happens on the transmission from a DoCAN channel More...
 
typedef void(* AGHAF_DoCAN_onMessageRx) (uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, uint32_t dataLen, uint8_t const *data, void *userContext)
 callback function called when a message is received on a DoCAN channel More...
 
typedef void(* AGHAF_DoCAN_onMessageRxFF) (uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, void *userContext)
 callback function called when a first frame is received on a DoCAN channel More...
 
typedef void(* AGHAF_DoCAN_onMessageRxError) (uint64_t timestamp, AGHAF_DoCan_Error error, void *userContext)
 callback function called when an error happens on the reception from a DoCAN channel More...
 
void AGHAF_DoCAN_v2_setOnMessageTxCallback (AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageTx callback, void *userContext)
 set the callback called on a transmission event More...
 
void AGHAF_DoCAN_v2_setOnMessageTxErrorCallback (AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageTxError callback, void *userContext)
 set the callback called on a transmission error event More...
 
void AGHAF_DoCAN_v2_setOnMessageRxCallback (AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageRx callback, void *userContext)
 set the callback called on a reception event More...
 
void AGHAF_DoCAN_v2_setOnMessageRxFFCallback (AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageRxFF callback, void *userContext)
 set the callback called on the reception from a first frame event More...
 
void AGHAF_DoCAN_v2_setOnMessageRxErrorCallback (AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_onMessageRxError callback, void *userContext)
 set the callback called on a reception error event More...
 
AGHAF_Status AGHAF_DoCAN_v2_getChannelCount (AGHAF_CAN can, uint8_t *count)
 Provide the number of channels available on the bus. More...
 
AGHAF_Status AGHAF_DoCAN_v2_getFreeChannelCount (AGHAF_CAN can, uint8_t *count)
 Return the number of free channels still available. More...
 
AGHAF_DoCAN_v2_Channel AGHAF_DoCAN_v2_createChannel (AGHAF_CAN can)
 Create a channel. More...
 
AGHAF_Status AGHAF_DoCAN_v2_releaseChannel (AGHAF_DoCAN_v2_Channel channel)
 Release the channel. More...
 
AGHAF_DoCAN_Channel AGHAF_DoCAN_v2_getChannelByIndex (AGHAF_CAN can, uint8_t index)
 return the index corrsponding to the index in parameter (nullptr if the index is not found) More...
 
uint8_t AGHAF_DoCAN_v2_Channel_getIndex (AGHAF_DoCAN_v2_Channel channel)
 Return the intern index from the channel. More...
 
AGHAF_Status AGHAF_DoCAN_v2_Channel_setParam (AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_ChannelParam param, uint32_t value)
 Set the parameter from a channel. More...
 
AGHAF_Status AGHAF_DoCAN_v2_Channel_getParam (AGHAF_DoCAN_v2_Channel channel, AGHAF_DoCAN_ChannelParam param, uint32_t *value)
 Provide the value from a channel parameter. More...
 
AGHAF_Status AGHAF_DoCAN_v2_Channel_start (AGHAF_DoCAN_v2_Channel channel)
 Start a channel. More...
 
AGHAF_Status AGHAF_DoCAN_v2_Channel_stop (AGHAF_DoCAN_v2_Channel channel)
 Stop a channel. More...
 
AGHAF_Status AGHAF_DoCAN_v2_Channel_send (AGHAF_DoCAN_v2_Channel channel, uint32_t dataLen, uint8_t const *data)
 Send on the DoCAN channel in parameter. More...
 
void AGHAF_DoCAN_v2_Channel_activateTrace (AGHAF_DoCAN_v2_Channel channel, AGHAF_BOOL value)
 Activate the CAN trace. More...
 

Detailed Description

API to use DoCAN on exxotest devices.

Usage Example

Call order and priority

below, the description of channel state management:


Symbol Description
Forbidden
Authorized
Next state


Function Stop Start
AGHAF_DoCAN_v2_setOnMessageTxCallback
AGHAF_DoCAN_v2_setOnMessageTxErrorCallback
AGHAF_DoCAN_v2_setOnMessageRxCallback
AGHAF_DoCAN_v2_setOnMessageRxFFCallback
AGHAF_DoCAN_v2_setOnMessageRxErrorCallback
AGHAF_DoCAN_v2_Channel_setParam
AGHAF_DoCAN_v2_Channel_getParam
AGHAF_DoCAN_v2_Channel_start
AGHAF_DoCAN_v2_Channel_stop
AGHAF_DoCAN_v2_Channel_send

Performances

This table presents the results obtained during a test in ko.s-1. The rate corresponds to the transmission rate on the whole bus. For this test, there was 32 channels and 10 messages exchanged on each channel. The CAN baudrate was 1Mb/s and FD baudrate was 5Mb/s. The message size is in bytes. Datas are exchanged between two MuxDiag 3.

Message Size Classic CAN TxDL 8 TxDL 12 TXDL 16 TxDL 20 TxDL 24 TxDL 32 TxDL 48 TxDL 64
12 19 28 32 32 28 29 31 32 30
100 42 85 102 129 134 159 167 173 173
1000 47 93 134 165 189 213 257 301 340
10000 48 96 137 172 200 224 266 323 362

Typedef Documentation

◆ AGHAF_DoCAN_onMessageRx

typedef void(* AGHAF_DoCAN_onMessageRx) (uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, uint32_t dataLen, uint8_t const *data, void *userContext)

callback function called when a message is received on a DoCAN channel

Parameters
timestamptimestamp of the event
canIdentcan identifier
canFlagscorresponding to AGHAF_CAN_MSG_FLAGS
dataLenlength of the datas received
datadatas received
userContextcontext given when setting the callabck in the system

◆ AGHAF_DoCAN_onMessageRxError

typedef void(* AGHAF_DoCAN_onMessageRxError) (uint64_t timestamp, AGHAF_DoCan_Error error, void *userContext)

callback function called when an error happens on the reception from a DoCAN channel

Parameters
timestamptimestamp of the event
errorvalue of the error
userContextcontext given when setting the callabck in the system

◆ AGHAF_DoCAN_onMessageRxFF

typedef void(* AGHAF_DoCAN_onMessageRxFF) (uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, void *userContext)

callback function called when a first frame is received on a DoCAN channel

Parameters
timestamptimestamp of the event
canIdentcan identifier
canFlagscorresponding to AGHAF_CAN_MSG_FLAGS
userContextcontext given when setting the callabck in the system

◆ AGHAF_DoCAN_onMessageTx

typedef void(* AGHAF_DoCAN_onMessageTx) (uint64_t timestamp, uint32_t canIdent, uint8_t canFlags, uint32_t dataLen, uint8_t const *data, void *userContext)

callback function called when a message is transmitted on a DoCAN channel

Parameters
timestamptimestamp of the event
canIdentcan identifier
canFlagscorresponding to AGHAF_CAN_MSG_FLAGS
dataLenlength of the datas transmitted
datadatas transmitted
userContextcontext given when setting the callabck in the system

◆ AGHAF_DoCAN_onMessageTxError

typedef void(* AGHAF_DoCAN_onMessageTxError) (uint64_t timestamp, AGHAF_DoCan_Error error, void *userContext)

callback function called when an error happens on the transmission from a DoCAN channel

Parameters
timestamptimestamp of the event
errorvalue of the error
userContextcontext given when setting the callabck in the system

Function Documentation

◆ AGHAF_DoCAN_v2_Channel_activateTrace()

void AGHAF_DoCAN_v2_Channel_activateTrace ( AGHAF_DoCAN_v2_Channel  channel,
AGHAF_BOOL  value 
)

Activate the CAN trace.

Parameters
channelhandle on the channel
valueAGHAF_TRUE ? activate : deactivate

◆ AGHAF_DoCAN_v2_Channel_getIndex()

uint8_t AGHAF_DoCAN_v2_Channel_getIndex ( AGHAF_DoCAN_v2_Channel  channel)

Return the intern index from the channel.

Parameters
channel
Returns
index from the channel

◆ AGHAF_DoCAN_v2_Channel_getParam()

AGHAF_Status AGHAF_DoCAN_v2_Channel_getParam ( AGHAF_DoCAN_v2_Channel  channel,
AGHAF_DoCAN_ChannelParam  param,
uint32_t *  value 
)

Provide the value from a channel parameter.

Parameters
channelhandle on the channel
paramparameter to get
valuevalue to get
Returns
status request information

◆ AGHAF_DoCAN_v2_Channel_send()

AGHAF_Status AGHAF_DoCAN_v2_Channel_send ( AGHAF_DoCAN_v2_Channel  channel,
uint32_t  dataLen,
uint8_t const *  data 
)

Send on the DoCAN channel in parameter.

Parameters
channelhandle on the channel
dataLenlength from the datas
datapointer on data
Returns
status request information
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_Channel_setParam()

AGHAF_Status AGHAF_DoCAN_v2_Channel_setParam ( AGHAF_DoCAN_v2_Channel  channel,
AGHAF_DoCAN_ChannelParam  param,
uint32_t  value 
)

Set the parameter from a channel.

Parameters
channelhandle on the channel
paramparameter to set
valuevalue to set
Returns
status request information
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_Channel_start()

AGHAF_Status AGHAF_DoCAN_v2_Channel_start ( AGHAF_DoCAN_v2_Channel  channel)

Start a channel.

Parameters
channelhandle on the channel
Returns
status request information
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_Channel_stop()

AGHAF_Status AGHAF_DoCAN_v2_Channel_stop ( AGHAF_DoCAN_v2_Channel  channel)

Stop a channel.

Parameters
channelhandle on the channel
Returns
status request information
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_createChannel()

AGHAF_DoCAN_v2_Channel AGHAF_DoCAN_v2_createChannel ( AGHAF_CAN  can)

Create a channel.

Parameters
canhandle on the bus
Returns
handle on the channel created

◆ AGHAF_DoCAN_v2_getChannelByIndex()

AGHAF_DoCAN_Channel AGHAF_DoCAN_v2_getChannelByIndex ( AGHAF_CAN  can,
uint8_t  index 
)

return the index corrsponding to the index in parameter (nullptr if the index is not found)

Parameters
canbus on which is the channel
indexindex from the channel
Returns
handle on a channel

◆ AGHAF_DoCAN_v2_getChannelCount()

AGHAF_Status AGHAF_DoCAN_v2_getChannelCount ( AGHAF_CAN  can,
uint8_t *  count 
)

Provide the number of channels available on the bus.

Parameters
canhandle on the bus
countpointer to fill with the data
Returns
status request information

◆ AGHAF_DoCAN_v2_getFreeChannelCount()

AGHAF_Status AGHAF_DoCAN_v2_getFreeChannelCount ( AGHAF_CAN  can,
uint8_t *  count 
)

Return the number of free channels still available.

Parameters
canhandle on the bus
countnumber of free channels still available
Returns
status request information

◆ AGHAF_DoCAN_v2_releaseChannel()

AGHAF_Status AGHAF_DoCAN_v2_releaseChannel ( AGHAF_DoCAN_v2_Channel  channel)

Release the channel.

Parameters
channelhandle on the channel to release
Returns
status request information
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_setOnMessageRxCallback()

void AGHAF_DoCAN_v2_setOnMessageRxCallback ( AGHAF_DoCAN_v2_Channel  channel,
AGHAF_DoCAN_onMessageRx  callback,
void *  userContext 
)

set the callback called on a reception event

Parameters
channelhandle on the channel
callbackcallback to be used for the event
userContextcontext provided by the user for custom datas
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_setOnMessageRxErrorCallback()

void AGHAF_DoCAN_v2_setOnMessageRxErrorCallback ( AGHAF_DoCAN_v2_Channel  channel,
AGHAF_DoCAN_onMessageRxError  callback,
void *  userContext 
)

set the callback called on a reception error event

Parameters
channelhandle on the channel
callbackcallback to be used for the event
userContextcontext provided by the user for custom datas
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_setOnMessageRxFFCallback()

void AGHAF_DoCAN_v2_setOnMessageRxFFCallback ( AGHAF_DoCAN_v2_Channel  channel,
AGHAF_DoCAN_onMessageRxFF  callback,
void *  userContext 
)

set the callback called on the reception from a first frame event

Parameters
channelhandle on the channel
callbackcallback to be used for the event
userContextcontext provided by the user for custom datas
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_setOnMessageTxCallback()

void AGHAF_DoCAN_v2_setOnMessageTxCallback ( AGHAF_DoCAN_v2_Channel  channel,
AGHAF_DoCAN_onMessageTx  callback,
void *  userContext 
)

set the callback called on a transmission event

Parameters
channelhandle on the channel
callbackcallback to be used for the event
userContextcontext provided by the user for custom datas
Examples
DoCan_v2_FD/main.cpp.

◆ AGHAF_DoCAN_v2_setOnMessageTxErrorCallback()

void AGHAF_DoCAN_v2_setOnMessageTxErrorCallback ( AGHAF_DoCAN_v2_Channel  channel,
AGHAF_DoCAN_onMessageTxError  callback,
void *  userContext 
)

set the callback called on a transmission error event

Parameters
channelhandle on the channel
callbackcallback to be used for the event
userContextcontext provided by the user for custom datas
Examples
DoCan_v2_FD/main.cpp.