linux

canGetChannelData

Syntax


#include <canlib.h>
canStatus canGetChannelData(int channel, int item, 
void *buffer, size_t bufsize);

Description

Parameters

channel
The number of the channel you are interested in. Channel numbers are integers in the interval beginning at 0 (zero) and ending at the value returned by canGetNumberOfChannels minus 1.
item
This parameter specifies what data to obtain for the specified channel. The value is one of the constants canCHANNELDATA_xxx.
buffer
The address of a buffer which is to receive the data.
bufsize
The size of the buffer to which the buffer parameter points.
Values of the item parameter

ValueMeaning
canCHANNELDATA_CHANNEL_CAP buffer points to a DWORD which receives the capabilities of the CAN controller; this is a combination of the canCHANNEL_CAP_xxx flags.
canCHANNELDATA_TRANS_CAP buffer points to a DWORD which receives the capabilities of the CAN transceiver; this is a combination of the canDRIVER_CAP_xxx flags.
canCHANNELDATA_CHANNEL_FLAGS Currently not implemented.
canCHANNELDATA_CARD_TYPE buffer points to a DWORD which receives the hardware type of the card. This value is any one of the canHWTYPE_xxx constants.
canCHANNELDATA_CARD_NUMBER buffer points to a DWORD which receives the card's number in the computer. Each card type is numbered separately. For example, the first PCcan card in a machine will have number 0, the second PCcan number 1, etc.
canCHANNELDATA_CHAN_NO_ON_CARD buffer points to a DWORD which receives the channel number on the card.
canCHANNELDATA_CARD_SERIAL_NO buffer points to a 64-bit (8 bytes) area which receives the serial number of the card. If the card doesn't have a serial number, 0 is returned.
canCHANNELDATA_TRANS_SERIAL_NO buffer points to a 64-bit (8 bytes) area which receives the serial number of the transceivcer. If the transceivcer doesn't have a serial number, 0 is returned.
canCHANNELDATA_CARD_FIRMWARE_REV buffer points to a 64-bit (8 bytes) area which receives the firmware revision number on the card. This number consists of four 16-bit words: the major revision, the minor revision, the release number and the build number, listed in order from the most significant to the least significant.
canCHANNELDATA_CARD_HARDWARE_REV buffer points to a 64-bit (8 bytes) area which receives the hardware revision number on the card. This number consists of four 16-bit words: the major revision, the minor revision, the release number and the build number, listed in order from the most significant to the least significant.
canCHANNELDATA_CARD_UPC_NO buffer points to a 6-byte area which receives the UPC (EAN) number for the card. If there is no UPC number, the buffer is filled with zeros.
canCHANNELDATA_TRANS_UPC_NO buffer points to a 6-byte area which receives the UPC (EAN) number for the transceiver. If there is no UPC number, the buffer is filled with zeros.
canCHANNELDATA_CHANNEL_NAME buffer points to an area which receives a zero-terminated string with a clear-text name of the channel.

Return Value

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

Related Topics

canGetNumberOfChannels

An example.