4.4 JNMMCANErrorStat

This function receives the error on the selected CAN port.

int JNMMCANErrorStat(int Can_fd, CANCONFIG CanParam, can_device_stats* stats);

Name

Description

Can_fd

Can_fd received from JNMMCANOpen().

Structure with following member variables,

Can_ch - CAN port number 0-3.

Pointer to can_device_stats structure

txerr : no of Tx errors

rxerr : no of Rx errors

txpackets : no of Tx transmitted count

rxpackets : no of Rx transmitted count

rx_over_errors : no of Rx over error count

error_active : Error active enable

stat_change : stat changed from passive to active ,vice versa */

bit_error : bit error

stuff_error : stuff error

form_error : Form error

bus_error : no of Bus errors

bus_error_enable : bit error enable

error_warning : Changes to error warning state

error_passive : Changes to error passive state

bus_off : Changes to bus off state

arbitration_lost : Arbitration lost errors

arbitration_lost_enable : arbitration lost error enable

Return Value

Error code or 0.

Usage Example

For receiving the message.

memset(&stats,0,sizeof(can_device_stats));
ret = JNMMCANErrorStat(can_fd,canconfig,&stats);

if(ret == -1)
{
    printf("JNMMCANErrorStat failure \n");
}

Last updated