CanGetStatus
The function CanGetStatus reads the current status-information.
BOOL CanGetStatus(int *status);
BOOL DCanGetStatus(int devno,int *status);
Parameters
devno
Index of SJA1000-controller to use (starting with 0).
status
Pointer to an integer array of length int[9], receiving status information.
status[0] = DriverStatus; // error status / error counter
status[1] = ControllerStatus; // status register of SJA1000
status[2] = 0;
status[3] = arbitration_lost_capture;
status[4] = ActiveMonitor; // 0: Monitor off 1: Monitor on (not supported here)
status[5] = DeviceIsActive; // 0: inactive 1: active (not supported here)
status[6] = RX_error_counter;
status[7] = TX_error_counter;
status[8] = error_code_capture;
Return Values
If this function succeeds, the return value is TRUE.
If the function fails, the return value is FALSE. Additional error-information is availlable through CanGetLastError
Driver Status:
Code | Error | Description |
---|---|---|
0x40070020 | CAN_E_RWARNING | 96 ⇐ REC < 128 |
0x40070021 | CAN_E_RPASSIVE | REC >= 128 |
0x40070022 | CAN_E_TWARNING | TEC < 128 |
0x40070023 | CAN_E_TPASSIVE | TEC >= 128 |
0x40070025 | CAN_E_BUSOFF | Bus Off |
0x40070041 | CAN_DRV_E_TX_TIMEOUT | TX-Timeout |
Remarks
Requirements
OS Versions: Windows CE 4.2 and later.
Header: gfcan32ce.h
Link Library: singlecan.lib (one sja1000-controller), dualcan.lib (two or more sja1000-controller)