linux

canIoCtl

Syntax


#include <canlib.h>
canStatus canIoCtl(int handle, 
    unsigned int func, 
    void* buf, 
    unsigned int buflen);

Description

This API call performs several different functions; these are described below.

Input Parameters

handle
A handle to an open circuit.
func
A canIOCTL_xxx function code (described below.)
buf
Pointer to a buffer containing function-dependent data; or a NULL pointer for certain function codes.
buflen
The length of the buffer.
Output Parameters

The contents of the buffer after the call is dependent on the function code you specified.

Function Codes

ValueMeaning
canIOCTL_GET_RX_BUFFER_LEVEL buf points at a DWORD which receives the current RX queue level. The returned value is approximative.
canIOCTL_GET_TX_BUFFER_LEVEL buf points at a DWORD which receives the current TX queue level. The returned value is approximative.
canIOCTL_FLUSH_RX_BUFFER Discard the current contents of the RX queue. The values of buf and buflen are ignored.
canIOCTL_FLUSH_TX_BUFFER Discard the current contents of the TX queue. The values of buf and buflen are ignored.

Return Value

canOK (zero) if success
canERR_xxx (negative) if failure.