Miscellaneous

configActiveProfileSet()

canlib.kvrlib.configActiveProfileSet(channel, profile_number)[source]

Set active profile.

configActiveProfileGet()

canlib.kvrlib.configActiveProfileGet(channel)[source]

Get active profile.

configNoProfilesGet()

canlib.kvrlib.configNoProfilesGet(channel)[source]

Get the maximum number of profile(s) the device can store.

When a remote device is connected to the host it can be configured. The remote device can hold a number of different profiles.

deviceGetServiceStatus()

canlib.kvrlib.deviceGetServiceStatus(device_info)[source]

Returns local connection status of the selected device.

deviceGetServiceStatusText()

canlib.kvrlib.deviceGetServiceStatusText(device_info)[source]

Returns local connection status of the selected device as ASCII text.

dllversion()

canlib.kvrlib.dllversion()[source]

Get the kvrlib version number as a VersionNumber

generate_wep_keys()

canlib.kvrlib.generate_wep_keys(pass_phrase)[source]

Generates four 64-bit and one 128-bit WEP keys

Parameters

pass_phrase (str) – The pass phrase to use to generate the keys.

Returns a (key64, key128) (WEPKeys) namedtuple, where key64 is a list of four bytes object with the four 64-bit WEP keys, and where `key128 is a bytes object with the single 128-bit WEP key.

generate_wpa_keys()

canlib.kvrlib.generate_wpa_keys(pass_phrase, ssid)[source]

Generate a WPA key from a pass phrase and ssid

Parameters
  • pass_phrase (str) – The pass phrase to use to generate the key.

  • ssid (str) – The SSID to use to generate the key.

Returns

bytes – The generated WPA key.

hostname()

canlib.kvrlib.hostname(ean, serial)[source]

Generate a hostname from ean and serial number

Parameters
  • ean (canlib.EAN) – European Article Number

  • serial (int) – Serial number

kvrDiscovery

class canlib.kvrlib.kvrDiscovery(kvrlib=None)[source]
clearDevicesAtExit(onoff)[source]
close()[source]
classmethod getDefaultAddresses(addressTypeFlag=AddressTypeFlag.BROADCAST, listSize=20)[source]
getResults()[source]
setAddresses(addressList)[source]
setEncryptionKey(device_info, key)[source]
setPassword(device_info, password)[source]
setScanTime(delay_ms, timeout_ms)[source]
start(delay_ms=None, timeout_ms=None)[source]
storeDevices(deviceInfos)[source]

kvrConfig

class canlib.kvrlib.kvrConfig(kvrlib=None, channel=0, mode=0, password='', profile_no=0)[source]
MODE_ERASE = 2
MODE_R = 0
MODE_RW = 1
XML_BUFFER_SIZE = 2046
clear()[source]
close()[source]
getXml()[source]
openEx(channel=None, mode=None, password=None, profile_no=None)[source]
setXml()[source]

unload()

canlib.kvrlib.unload()[source]

Unloads library stuff.

verify_xml()

canlib.kvrlib.verify_xml(xml_string)[source]

Verify that the xml string complies with both the DTD and internal restrictions

WEPKeys

class canlib.kvrlib.WEPKeys(key64, key128)
property key128

Alias for field number 1

property key64

Alias for field number 0