AGHAF  4.5.1
Annecy electronique Generic Hardware Access Framework
DoCAN

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

enum  AGHAF_DoCan_Error {
  AGHAF_DOCAN_ERROR_TO_A = 0 , AGHAF_DOCAN_ERROR_TO_BS = 1 , AGHAF_DOCAN_ERROR_TO_CR = 2 , AGHAF_DOCAN_ERROR_SN = 3 ,
  AGHAF_DOCAN_ERROR_FS = 4 , AGHAF_DOCAN_ERROR_PDU = 5 , AGHAF_DOCAN_ERROR_WAIT = 6 , AGHAF_DOCAN_ERROR_OVFLW = 7 ,
  AGHAF_DOCAN_ERROR_OTHER = 8
}
 enumerator to describe the error on the bus More...
 
enum  AGHAF_DoCAN_AddrMode { AGHAF_DoCAN_ADDR_MODE_PHYS = 0x00 , AGHAF_DoCAN_ADDR_MODE_FUNC = 0x01 }
 Possible addressing modes for DoCAN. More...
 
enum  AGHAF_DoCAN_ChannelDirection { AGHAF_DoCAN_CHANNEL_DIR_RX = (1U<<0) , AGHAF_DoCAN_CHANNEL_DIR_TX = (1U<<1) , AGHAF_DoCAN_CHANNEL_DIR_2WAY = (AGHAF_DoCAN_CHANNEL_DIR_RX | AGHAF_DoCAN_CHANNEL_DIR_TX) }
 Possible directions for DoCAN channels. More...
 
enum  AGHAF_DoCAN_PadHandling { AGHAF_DoCAN_PAD_DISABLE = 0x00 , AGHAF_DoCAN_PAD_ENABLE = 0x01 }
 Enable or disable padding handling. More...
 
enum  AGHAF_DoCAN_TxDL {
  AGHAF_DoCAN_TX_DL_CLASSIC_CAN = 0 , AGHAF_DoCAN_TX_DL_8 = 8 , AGHAF_DoCAN_TX_DL_12 = 9 , AGHAF_DoCAN_TX_DL_16 = 10 ,
  AGHAF_DoCAN_TX_DL_20 = 11 , AGHAF_DoCAN_TX_DL_24 = 12 , AGHAF_DoCAN_TX_DL_32 = 13 , AGHAF_DoCAN_TX_DL_48 = 14 ,
  AGHAF_DoCAN_TX_DL_64 = 15
}
 Possible TX_DL for DoCAN transmissions. More...
 
enum  AGHAF_DoCAN_IdFormat { AGHAF_DoCAN_ID_FMT_XTD = (1U<<0) , AGHAF_DoCAN_ID_FMT_AE = (1U<<1) }
 Flags to configure DoCAN identifier format. More...
 
enum  AGHAF_DoCAN_ChannelParam {
  AGHAF_DoCAN_CHANNEL_PARAM_DIRECTION = 0 , AGHAF_DoCAN_CHANNEL_PARAM_TXDL , AGHAF_DoCAN_CHANNEL_PARAM_PAD_HANDLING , AGHAF_DoCAN_CHANNEL_PARAM_PAD_VALUE ,
  AGHAF_DoCAN_CHANNEL_PARAM_ADDRMODE , AGHAF_DoCAN_CHANNEL_PARAM_TIMING_AS , AGHAF_DoCAN_CHANNEL_PARAM_TIMING_AR , AGHAF_DoCAN_CHANNEL_PARAM_TIMING_BS ,
  AGHAF_DoCAN_CHANNEL_PARAM_TIMING_BR , AGHAF_DoCAN_CHANNEL_PARAM_TIMING_CS , AGHAF_DoCAN_CHANNEL_PARAM_TIMING_CR , AGHAF_DoCAN_CHANNEL_PARAM_TIMING_STMIN ,
  AGHAF_DoCAN_CHANNEL_PARAM_REQ_ID_FMT , AGHAF_DoCAN_CHANNEL_PARAM_REQ_ID_VALUE , AGHAF_DoCAN_CHANNEL_PARAM_REQ_ID_AE , AGHAF_DoCAN_CHANNEL_PARAM_RESP_ID_FMT ,
  AGHAF_DoCAN_CHANNEL_PARAM_RESP_ID_VALUE , AGHAF_DoCAN_CHANNEL_PARAM_RESP_ID_AE , AGHAF_DoCAN_CHANNEL_PARAM_WAITFRAME , AGHAF_DoCAN_CHANNEL_PARAM_BLOCKSIZE ,
  AGHAF_DoCAN_CHANNEL_PARAM_MAXDATALEN , AGHAF_DoCAN_CHANNEL_PARAM_PAD_NOCHECK , AGHAF_DoCAN_CHANNEL_PARAM_CANFD_BRS , AGHAF_DoCAN_CHANNEL_PARAM_TIMING_STMIN_OVRD ,
  AGHAF_DoCAN_CHANNEL_PARAM_BS_OVRD
}
 List of parameters used to configure a DoCAN channel. More...
 
enum  AGHAF_DoCAN_EventType {
  AGHAF_DoCAN_EVENT_MSGTX = 0 , AGHAF_DoCAN_EVENT_MSGTXERR = 1 , AGHAF_DoCAN_EVENT_MSGRX = 2 , AGHAF_DoCAN_EVENT_MSGRXFF = 3 ,
  AGHAF_DoCAN_EVENT_MSGRXERR = 4
}
 enumerator to tell the type of the event More...
 
typedef void * AGHAF_DoCAN_Bus
 Handle to a DoCAN bus.
 
typedef void * AGHAF_DoCAN_Event
 Handle to a DoCAN event.
 
typedef void * AGHAF_DoCAN_Channel
 Handle to a DoCAN channel.
 
typedef void(* AGHAF_DoCAN_Callback) (AGHAF_DoCAN_Event event, void *userContext)
 
AGHAF_DoCAN_Bus AGHAF_DoCAN_getBus (AGHAF_Device device, uint8_t index)
 return the DoCAN bus at index in parameter More...
 
uint32_t AGHAF_DoCAN_getBusCount (AGHAF_Device device)
 return the number of DoCAN bus from a device More...
 
void AGHAF_DoCAN_registerCallback (AGHAF_DoCAN_Bus bus, AGHAF_DoCAN_Callback callback, void *userContext)
 Register a callback for the DoCAN events from a bus. More...
 
void AGHAF_DoCAN_deregisterCallback (AGHAF_DoCAN_Bus bus, AGHAF_DoCAN_Callback callback)
 deregister a callback More...
 
AGHAF_Status AGHAF_DoCAN_getChannelCount (AGHAF_DoCAN_Bus bus, uint8_t *count)
 Provide the number of channels available on the bus. More...
 
AGHAF_Status AGHAF_DoCAN_getFreeChannelCount (AGHAF_DoCAN_Bus bus, uint8_t *count)
 Return the number of free channels still available. More...
 
AGHAF_DoCAN_Channel AGHAF_DoCAN_createChannel (AGHAF_DoCAN_Bus bus)
 Create a channel. More...
 
AGHAF_Status AGHAF_DoCAN_releaseChannel (AGHAF_DoCAN_Channel channel)
 Release the channel. More...
 
AGHAF_DoCAN_Channel AGHAF_DoCAN_getChannelByIndex (AGHAF_DoCAN_Bus bus, uint8_t index)
 return the index corrsponding to the index in parameter (nullptr if the index is not found) More...
 
uint8_t AGHAF_DoCAN_Channel_getIndex (AGHAF_DoCAN_Channel channel)
 Return the intern index from the channel. More...
 
AGHAF_Status AGHAF_DoCAN_Channel_setParam (AGHAF_DoCAN_Channel channel, AGHAF_DoCAN_ChannelParam param, uint32_t value)
 Set the parameter from a channel. More...
 
AGHAF_Status AGHAF_DoCAN_Channel_getParam (AGHAF_DoCAN_Channel channel, AGHAF_DoCAN_ChannelParam param, uint32_t *value)
 Provide the value from a channel parameter. More...
 
AGHAF_Status AGHAF_DoCAN_Channel_start (AGHAF_DoCAN_Channel channel)
 Start a channel. More...
 
AGHAF_Status AGHAF_DoCAN_Channel_stop (AGHAF_DoCAN_Channel channel)
 Stop a channel. More...
 
AGHAF_Status AGHAF_DoCAN_Channel_send (AGHAF_DoCAN_Channel channel, uint32_t dataLen, uint8_t const *data)
 Send on the DoCAN channel in parameter. More...
 
void AGHAF_DoCAN_Channel_activateTrace (AGHAF_DoCAN_Channel channel, AGHAF_BOOL value)
 Activate the CAN trace. More...
 
AGHAF_DoCAN_EventType AGHAF_DoCAN_Event_type (AGHAF_EventInfo event)
 return the type from the event More...
 
uint8_t AGHAF_DoCAN_Event_getBusIndex (AGHAF_DoCAN_Event event)
 return the index from the bus on which occured the event More...
 
uint32_t AGHAF_DoCAN_Event_getDataSize (AGHAF_DoCAN_Event event)
 return the size from the datas in the event More...
 
AGHAF_Status AGHAF_DoCAN_Event_getData (AGHAF_DoCAN_Event event, uint8_t *data, uint32_t *size)
 Provide the datas received in the event. More...
 
AGHAF_CAN_Identifier AGHAF_DoCAN_Event_getId (AGHAF_DoCAN_Event event)
 Return the CAN identifier from the event. More...
 
uint8_t AGHAF_DoCAN_Event_getError (AGHAF_DoCAN_Event event)
 Return the error value from the event. More...
 
AGHAF_DoCAN_Channel AGHAF_DoCAN_Event_getChannel (AGHAF_DoCAN_Event event)
 Return the channel on which occured the event. 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_Channel_setParam
AGHAF_DoCAN_Channel_getParam
AGHAF_DoCAN_Channel_start
AGHAF_DoCAN_Channel_stop
AGHAF_DoCAN_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_Callback

AGHAF_DoCAN_Callback

Callback function type to recieve DoCAN events.

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

Enumeration Type Documentation

◆ AGHAF_DoCAN_AddrMode

Possible addressing modes for DoCAN.

Enumerator
AGHAF_DoCAN_ADDR_MODE_PHYS 

Physical.

AGHAF_DoCAN_ADDR_MODE_FUNC 

Functionnal.

◆ AGHAF_DoCAN_ChannelDirection

Possible directions for DoCAN channels.

Enumerator
AGHAF_DoCAN_CHANNEL_DIR_RX 

Rx only channel.

AGHAF_DoCAN_CHANNEL_DIR_TX 

Tx only channel.

AGHAF_DoCAN_CHANNEL_DIR_2WAY 

2-way channel

◆ AGHAF_DoCAN_ChannelParam

List of parameters used to configure a DoCAN channel.

Warning
The set of AGHAF_DoCAN_CHANNEL_PARAM_RESP_ID_xxx must be unique for all channels.
With the exception of functional addressing Tx channel, that don't need a response ID.
Enumerator
AGHAF_DoCAN_CHANNEL_PARAM_DIRECTION 

Set channel direction.
When functional addressing mode is used, you can't use 2-way channel.

Use AGHAF_DoCAN_ChannelDirection
Default: AGHAF_DoCAN_CHANNEL_DIR_2WAY

AGHAF_DoCAN_CHANNEL_PARAM_TXDL 

Define TX_DL and identitify if CAN FD or Classic CAN is to be used.
For Rx only channels, use any value different of AGHAF_DoCAN_TX_DL_CLASSIC_CAN to enable CAN FD.

Use AGHAF_DoCAN_TxDL
Default: AGHAF_DoCAN_TX_DL_CLASSIC_CAN

AGHAF_DoCAN_CHANNEL_PARAM_PAD_HANDLING 

Enable padding handling.

Use AGHAF_DoCAN_PadHandling
Default: AGHAF_DoCAN_PAD_ENABLE

AGHAF_DoCAN_CHANNEL_PARAM_PAD_VALUE 

Padding value to use when padding handling is enabled.
This value is also used for mandatory padding of CAN FD frames (TX_DL > 8).

Range: [0x00, 0xFF]
Default: 0xCC

AGHAF_DoCAN_CHANNEL_PARAM_ADDRMODE 

Addressing mode used by the channel
When functional adressing mode is used, you can't use 2-way channel.

Use AGHAF_DoCAN_AddrMode
Default: AGHAF_DoCAN_ADDR_MODE_PHYS

AGHAF_DoCAN_CHANNEL_PARAM_TIMING_AS 

As - Time for transmission of the CAN frame (any N_PDU) on the sender side.

Max: 20000 ms
Default: 1000 ms

AGHAF_DoCAN_CHANNEL_PARAM_TIMING_AR 

Ar - Time for transmission of the CAN frame (any N_PDU) on the receiver side.

Max: 20000 ms
Default: 1000 ms

AGHAF_DoCAN_CHANNEL_PARAM_TIMING_BS 

Bs - Timeout until reception of the next FlowControl N_PDU.

Max: 20000 ms
Default: 1000 ms

AGHAF_DoCAN_CHANNEL_PARAM_TIMING_BR 

Br - Performance requirement (not used).

Default: NA

AGHAF_DoCAN_CHANNEL_PARAM_TIMING_CS 

Cs - Performance requirement (not used).

Default: NA

AGHAF_DoCAN_CHANNEL_PARAM_TIMING_CR 

Cr - Timeout until reception of the next ConsecutiveFrame.

Max: 20000 ms
Default: 1000 ms

AGHAF_DoCAN_CHANNEL_PARAM_TIMING_STMIN 

STmin - Separation time (Receiver only).
The minimum time the sender shall wait between the transmissions of two ConsecutiveFrame N_PDUs
The receiver transmit this value to the sender in FlowControl CTS STmin parameter.

Range: [0x00, 0xFF]
Default: 0x00

AGHAF_DoCAN_CHANNEL_PARAM_REQ_ID_FMT 

CAN ID format used to transmit data.

Use AGHAF_DoCAN_IdFormat
Default: 0x00

AGHAF_DoCAN_CHANNEL_PARAM_REQ_ID_VALUE 

CAN ID used to transmit data.

Range: [0x00000000, 0x1FFFFFFF]
Default: 0x7E0

AGHAF_DoCAN_CHANNEL_PARAM_REQ_ID_AE 

Address extension used to transmit data.

Range: [0x00,0xFF]
Default: 0x00

AGHAF_DoCAN_CHANNEL_PARAM_RESP_ID_FMT 

CAN ID format used to receive data.

Use AGHAF_DoCAN_IdFormat
Default: 0x00

AGHAF_DoCAN_CHANNEL_PARAM_RESP_ID_VALUE 

CAN ID used to receive data.

Range: [0x00000000, 0x1FFFFFFF]
Default: 0x7E8

AGHAF_DoCAN_CHANNEL_PARAM_RESP_ID_AE 

Address extension used to receive data.

Range: [0x00,0xFF]
Default: 0x00

AGHAF_DoCAN_CHANNEL_PARAM_WAITFRAME 

Maximum number of WAIT flow control frames allowed during a multi-segment transfer.

Max: 1027
Default: 0

AGHAF_DoCAN_CHANNEL_PARAM_BLOCKSIZE 

Block Size (Receiver only).
Number of CF N_PDUs until transmission of the next FlowControl N_PDU.
The receiver transmit this value to the sender in FlowControl CTS BlockSize parameter.

Range: [0x00, 0xFF]
Default: 0

AGHAF_DoCAN_CHANNEL_PARAM_MAXDATALEN 

Maximum byte length of received segmented message (Receiver only).

Max: 131072
Default: 4095

AGHAF_DoCAN_CHANNEL_PARAM_PAD_NOCHECK 

If enable, doesn't check padding of response against the AGHAF_DoCAN_CHANNEL_PARAM_PAD_HANDLING setting.

Range: [0, 1]
Default: 0 (disabled)

AGHAF_DoCAN_CHANNEL_PARAM_CANFD_BRS 

Manage Bit Rate Switch when sending frame.
Only evaluated in CAN FD mode (AGHAF_DoCAN_CHANNEL_PARAM_TXDL not equal to AGHAF_DoCAN_TX_DL_CLASSIC_CAN).

Range: [0, 1]
Default: 1 (enable BRS)

AGHAF_DoCAN_CHANNEL_PARAM_TIMING_STMIN_OVRD 

STmin Override - Separation time (Sender only).
The minimum time the sender is to wait between transmission of two CF N_PDUs.
The FlowControl CTS STmin value reported by the vehicle should be ignored.

Range: [0x00, 0xFF] and 0xFFFFFFFF
Default: 0xFFFFFFFF Use the value reported by the vehicle

AGHAF_DoCAN_CHANNEL_PARAM_BS_OVRD 

Block Size Override (Sender only).
Number of CF N_PDUs until transmission of the next FlowControl N_PDU.
The FlowControl CTS BlockSize value reported by the vehicle should be ignored.

Range: [0x00, 0xFF] and 0xFFFFFFFF
Default: 0xFFFFFFFF Use the value reported by the vehicle

◆ AGHAF_DoCan_Error

enumerator to describe the error on the bus

Enumerator
AGHAF_DOCAN_ERROR_TO_A 

As/Ar timeout (N_TIMEOUT_A) (Sender/Receiver)

AGHAF_DOCAN_ERROR_TO_BS 

Bs timeout (N_TIMEOUT_Bs) (Sender only)

AGHAF_DOCAN_ERROR_TO_CR 

Cr timeout (N_TIMEOUT_Cr) (Receiver only)

AGHAF_DOCAN_ERROR_SN 

Unexpected SequenceNumber (N_WRONG_SN) (Receiver only)

AGHAF_DOCAN_ERROR_FS 

Invalid FlowStatus in FC (N_INVALID_FS) (Sender only)

AGHAF_DOCAN_ERROR_PDU 

Unexpected PDU (N_UNEXP_PDU) (Receiver only)

AGHAF_DOCAN_ERROR_WAIT 

Wait overrun (N_WFT_OVRN) (Receiver only)

AGHAF_DOCAN_ERROR_OVFLW 

Receiver can't store message (N_BUFFER_OVFLW) (Sender only)

AGHAF_DOCAN_ERROR_OTHER 

Other error (N_ERROR) (Sender/Receiver)

◆ AGHAF_DoCAN_EventType

enumerator to tell the type of the event

Enumerator
AGHAF_DoCAN_EVENT_MSGTX 

End of transmission.

AGHAF_DoCAN_EVENT_MSGTXERR 

Transmission Error.

AGHAF_DoCAN_EVENT_MSGRX 

Message has been received.

AGHAF_DoCAN_EVENT_MSGRXFF 

First Frame has been received.

AGHAF_DoCAN_EVENT_MSGRXERR 

Reception error.

◆ AGHAF_DoCAN_IdFormat

Flags to configure DoCAN identifier format.

  • Enable extended CAN identifer
  • Enable address extension
Enumerator
AGHAF_DoCAN_ID_FMT_XTD 

Extended identifier (29-bit CAN ID)

AGHAF_DoCAN_ID_FMT_AE 

Use optional address extension It's the N_TA byte of Extended addressing format It's the N_AE byte of Mixed addressing format

◆ AGHAF_DoCAN_PadHandling

Enable or disable padding handling.

Note
In CAN FD, even if padding is disabled, transmitted frames are still padded up to the nearest valid length.
Warning
When enabled, if response frames do not use padding they will be rejected.
Enumerator
AGHAF_DoCAN_PAD_DISABLE 

Disable padding handling.

AGHAF_DoCAN_PAD_ENABLE 

Enable padding handling.

◆ AGHAF_DoCAN_TxDL

Possible TX_DL for DoCAN transmissions.

Note
This parameter is also used to enable or disable the use of CAN FD.
Enumerator
AGHAF_DoCAN_TX_DL_CLASSIC_CAN 

Classic CAN, TX_DL = 8.

AGHAF_DoCAN_TX_DL_8 

CAN FD, TX_DL = 8.

AGHAF_DoCAN_TX_DL_12 

CAN FD, TX_DL = 12.

AGHAF_DoCAN_TX_DL_16 

CAN FD, TX_DL = 16.

AGHAF_DoCAN_TX_DL_20 

CAN FD, TX_DL = 20.

AGHAF_DoCAN_TX_DL_24 

CAN FD, TX_DL = 24.

AGHAF_DoCAN_TX_DL_32 

CAN FD, TX_DL = 32.

AGHAF_DoCAN_TX_DL_48 

CAN FD, TX_DL = 48.

AGHAF_DoCAN_TX_DL_64 

CAN FD, TX_DL = 64.

Function Documentation

◆ AGHAF_DoCAN_Channel_activateTrace()

void AGHAF_DoCAN_Channel_activateTrace ( AGHAF_DoCAN_Channel  channel,
AGHAF_BOOL  value 
)

Activate the CAN trace.

Parameters
channelhandle on the channel
valueAGHAF_TRUE ? activate : deactivate

◆ AGHAF_DoCAN_Channel_getIndex()

uint8_t AGHAF_DoCAN_Channel_getIndex ( AGHAF_DoCAN_Channel  channel)

Return the intern index from the channel.

Parameters
channel
Returns
index from the channel

◆ AGHAF_DoCAN_Channel_getParam()

AGHAF_Status AGHAF_DoCAN_Channel_getParam ( AGHAF_DoCAN_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_Channel_send()

AGHAF_Status AGHAF_DoCAN_Channel_send ( AGHAF_DoCAN_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_FD/main.cpp.

◆ AGHAF_DoCAN_Channel_setParam()

AGHAF_Status AGHAF_DoCAN_Channel_setParam ( AGHAF_DoCAN_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_FD/main.cpp.

◆ AGHAF_DoCAN_Channel_start()

AGHAF_Status AGHAF_DoCAN_Channel_start ( AGHAF_DoCAN_Channel  channel)

Start a channel.

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

◆ AGHAF_DoCAN_Channel_stop()

AGHAF_Status AGHAF_DoCAN_Channel_stop ( AGHAF_DoCAN_Channel  channel)

Stop a channel.

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

◆ AGHAF_DoCAN_createChannel()

AGHAF_DoCAN_Channel AGHAF_DoCAN_createChannel ( AGHAF_DoCAN_Bus  bus)

Create a channel.

Parameters
bushandle on the bus
Returns
handle on the channel created
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_deregisterCallback()

void AGHAF_DoCAN_deregisterCallback ( AGHAF_DoCAN_Bus  bus,
AGHAF_DoCAN_Callback  callback 
)

deregister a callback

Parameters
bushandle on the bus
callbackfunction pointer to remove
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_Event_getBusIndex()

uint8_t AGHAF_DoCAN_Event_getBusIndex ( AGHAF_DoCAN_Event  event)

return the index from the bus on which occured the event

Parameters
eventhandle on an event
Returns
index from bus

◆ AGHAF_DoCAN_Event_getChannel()

AGHAF_DoCAN_Channel AGHAF_DoCAN_Event_getChannel ( AGHAF_DoCAN_Event  event)

Return the channel on which occured the event.

Parameters
eventhandle on the event
Returns
handle on the channel
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_Event_getData()

AGHAF_Status AGHAF_DoCAN_Event_getData ( AGHAF_DoCAN_Event  event,
uint8_t *  data,
uint32_t *  size 
)

Provide the datas received in the event.

Parameters
eventhandle on the event
dataarray to fill with the data
size[in] data array size [out] size of copied data
Returns
status request information
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_Event_getDataSize()

uint32_t AGHAF_DoCAN_Event_getDataSize ( AGHAF_DoCAN_Event  event)

return the size from the datas in the event

Parameters
event
Returns
size from the datas
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_Event_getError()

uint8_t AGHAF_DoCAN_Event_getError ( AGHAF_DoCAN_Event  event)

Return the error value from the event.

Parameters
eventhandle on the event
Returns
corresponds to AGHAF_DoCan_Error enumerator
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_Event_getId()

AGHAF_CAN_Identifier AGHAF_DoCAN_Event_getId ( AGHAF_DoCAN_Event  event)

Return the CAN identifier from the event.

Parameters
eventhandle on the event
Returns
CAN identifier from the event

◆ AGHAF_DoCAN_Event_type()

AGHAF_DoCAN_EventType AGHAF_DoCAN_Event_type ( AGHAF_EventInfo  event)

return the type from the event

Parameters
event
Returns
type from the event
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_getBus()

AGHAF_DoCAN_Bus AGHAF_DoCAN_getBus ( AGHAF_Device  device,
uint8_t  index 
)

return the DoCAN bus at index in parameter

Parameters
devicedevice handle from the desired DoCAN bus
indexindex from the bus
Returns
Handle on a DoCAN bus
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_getBusCount()

uint32_t AGHAF_DoCAN_getBusCount ( AGHAF_Device  device)

return the number of DoCAN bus from a device

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

◆ AGHAF_DoCAN_getChannelByIndex()

AGHAF_DoCAN_Channel AGHAF_DoCAN_getChannelByIndex ( AGHAF_DoCAN_Bus  bus,
uint8_t  index 
)

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

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

◆ AGHAF_DoCAN_getChannelCount()

AGHAF_Status AGHAF_DoCAN_getChannelCount ( AGHAF_DoCAN_Bus  bus,
uint8_t *  count 
)

Provide the number of channels available on the bus.

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

◆ AGHAF_DoCAN_getFreeChannelCount()

AGHAF_Status AGHAF_DoCAN_getFreeChannelCount ( AGHAF_DoCAN_Bus  bus,
uint8_t *  count 
)

Return the number of free channels still available.

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

◆ AGHAF_DoCAN_registerCallback()

void AGHAF_DoCAN_registerCallback ( AGHAF_DoCAN_Bus  bus,
AGHAF_DoCAN_Callback  callback,
void *  userContext 
)

Register a callback for the DoCAN events from a bus.

Parameters
bushandle on the bus
callbackfunction pointer to call on an event
userContext
Examples
DoCan_FD/main.cpp.

◆ AGHAF_DoCAN_releaseChannel()

AGHAF_Status AGHAF_DoCAN_releaseChannel ( AGHAF_DoCAN_Channel  channel)

Release the channel.

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