Miscellaneous¶
dllversion()¶
getChannelData()¶
- canlib.linlib.getChannelData(channel_number, item=<ChannelData.CARD_FIRMWARE_REV: 9>)[source]¶
This function can be used to retrieve certain pieces of information about a channel.
Note
You must pass a channel number and not a channel handle.
- Parameters
channel (int) – The number of the channel you are interested in. Channel numbers are integers in the interval beginning at 0.
item (linlib.ChannelData) – This parameter specifies what data to obtain for the specified channel. Currently the only item available is
ChannelData.CARD_FIRMWARE_REV
, which is the default.
- Returns
- (major, minor, release, build) :: A four-tuple of the firmware
version. (For
ChannelData.CARD_FIRMWARE_REV
)
getTransceiverData¶
- canlib.linlib.getTransceiverData(channel_number)[source]¶
Get the transceiver information for a CAN channel
The application typically uses this call to find out whether a particular CAN channel has a LIN interface connected to it. For a Kvaser LIN Leaf it retrieves the transceiver type and device information.
This function call will open the CAN channel, but no CAN messages are transmitted on it. In other words, it’s risk-free to use even if no LIN interface is connected, or if the channel is connected to a CAN system.
Note
Attempts to use the channel for LIN communication will be meaningful only if the returned
TransceiverData
’s ~type~ attribute is one ofcanlib.canlib.TransceiverType.LIN
orcanlib.canlib.TransceiverType.CANFD_LIN
A LIN interface need not be powered for this call to succeed.
The information may not always be accurate. Especially after changing transceiver on a running LAPcan card, you should go on bus and off bus again to be sure the transceiver information is updated.
initializeLibrary¶
- canlib.linlib.initializeLibrary()[source]¶
Initialize LINlib
Note
LINlib is automatically initialized when
canlib.linlib
is imported. This function is only necessary when LINlib has been manually unloaded withunloadLibrary
.