![]() |
Library for interacting with remote devices. (Currently Windows only) More...
#include <windows.h>#include <stdint.h>Go to the source code of this file.
Data Structures | |
| struct | kvrAddress |
| struct | kvrCipherInfoElement |
| struct | kvrDeviceInfo |
| Holds information about a discovered device. More... | |
Typedefs | |
| typedef int32_t | kvrConfigHandle |
| typedef int32_t | kvrRssiHistory |
| typedef uint32_t | kvrRttHistory |
| typedef int32_t | kvrDiscoveryHandle |
Enumerations | |
| enum | kvrStatus { kvrOK = 0, kvrERR_NOT_INITIALIZED = -1, kvrERR_GENERIC = -2, kvrERR_CHECKSUM = -3, kvrERR_PARAMETER = -4, kvrERR_PASSWORD = -5, kvrERR_BLANK = -6, kvrERR_NO_DEVICE = -7, kvrERR_NO_ANSWER = -8, kvrERR_NOT_IMPLEMENTED = -9, kvrERR_PERMISSION_DENIED = -10, kvrERR_OUT_OF_SPACE = -11, kvrERR_NO_SERVICE = -12, kvrERR_DUPLICATED_DEVICE = -13, kvrERR_XML_VALIDATION = -14, kvrERR_BUFFER_TOO_SMALL = -15 } |
Functions | |
| kvrStatus | kvrConfigOpen (int32_t can_channel_no, int32_t mode, const char *password, kvrConfigHandle *handle) |
| kvrStatus | kvrConfigActiveProfileSet (int32_t can_channel_no, int32_t profile_number) |
| kvrStatus | kvrConfigActiveProfileGet (int32_t can_channel_no, int32_t *profile_number) |
| kvrStatus | kvrConfigNoProfilesGet (int32_t can_channel_no, int32_t *no_profiles) |
| kvrStatus | kvrConfigOpenEx (int32_t can_channel_no, int32_t mode, const char *password, kvrConfigHandle *handle, uint32_t profile_no) |
| void | kvrConfigClose (kvrConfigHandle handle) |
| kvrStatus | kvrConfigVerifyXml (const char *xml_buffer, char *err_buffer, uint32_t err_buffer_size) |
| kvrStatus | kvrConfigSet (kvrConfigHandle handle, const char *xml_buffer) |
| kvrStatus | kvrConfigGet (kvrConfigHandle handle, char *xml_buffer, uint32_t xml_buffer_size) |
| kvrStatus | kvrConfigInfoGet (int32_t can_channel_no, int32_t profile_no, char *xml_buffer, uint32_t xml_buffer_size) |
| kvrStatus | kvrConfigClear (kvrConfigHandle handle) |
| kvrStatus | kvrNetworkConnectionTest (kvrConfigHandle handle, int32_t active) |
| kvrStatus | kvrNetworkGetRssiRtt (kvrConfigHandle handle, kvrRssiHistory *rssi, uint32_t rssi_size, uint32_t *rssi_count, kvrRttHistory *rtt, uint32_t rtt_size, uint32_t *rtt_count) |
| kvrStatus | kvrWlanStartScan (kvrConfigHandle handle, int32_t active, int32_t bss_type, int32_t domain) |
| kvrStatus | kvrWlanGetScanResults (kvrConfigHandle handle, int32_t *rssi, int32_t *channel, kvrAddress *mac, int32_t *bss_type, char *ssid, uint32_t *capability, uint32_t *type_wpa, kvrCipherInfoElement *wpa_info, kvrCipherInfoElement *rsn_info) |
| kvrStatus | kvrNetworkGetHostName (kvrConfigHandle handle, char *buffer, uint32_t buffer_size) |
| kvrStatus | kvrHostName (uint32_t ean_hi, uint32_t ean_lo, uint32_t ser_no, char *buffer, uint32_t buffer_size) |
| kvrStatus | kvrNetworkGetConnectionStatus (kvrConfigHandle handle, int32_t *state, int32_t *tx_rate, int32_t *rx_rate, int32_t *channel, int32_t *rssi, int32_t *tx_power) |
| kvrStatus | kvrNetworkGetAddressInfo (kvrConfigHandle handle, kvrAddress *address1, kvrAddress *address2, kvrAddress *netmask, kvrAddress *gateway, int32_t *dhcp) |
| kvrStatus | kvrDiscoveryGetDefaultAddresses (kvrAddress address_list[], uint32_t address_list_size, uint32_t *address_list_count, uint32_t address_type_flags) |
| kvrStatus | kvrDiscoveryOpen (kvrDiscoveryHandle *handle) |
| kvrStatus | kvrDiscoveryClose (kvrDiscoveryHandle handle) |
| kvrStatus | kvrDiscoverySetAddresses (kvrDiscoveryHandle handle, const kvrAddress address_list[], uint32_t address_list_size) |
| kvrStatus | kvrDiscoveryStart (kvrDiscoveryHandle handle, uint32_t delay_ms, uint32_t timeout_ms) |
| kvrStatus | kvrDiscoveryStartEx (kvrDiscoveryHandle handle, uint32_t delay_ms, uint32_t timeout_ms, int add_stored) |
| kvrStatus | kvrDiscoveryGetResults (kvrDiscoveryHandle handle, kvrDeviceInfo *device_info) |
| kvrStatus | kvrDiscoveryStoreDevices (const kvrDeviceInfo device_info_list[], uint32_t device_info_list_size) |
| kvrStatus | kvrDiscoveryClearDevicesAtExit (int onoff) |
| kvrStatus | kvrDiscoverySetPassword (kvrDeviceInfo *device_info, const char *password) |
| kvrStatus | kvrDiscoverySetEncryptionKey (kvrDeviceInfo *device_info, const char *key) |
| kvrStatus | kvrDeviceGetServiceStatusText (const kvrDeviceInfo *device_info, char *buffer, uint32_t buffer_size) |
| kvrStatus | kvrDeviceGetServiceStatus (const kvrDeviceInfo *device_info, int32_t *state, int32_t *start_info) |
| kvrStatus | kvrGetErrorText (kvrStatus error, char *buffer, uint32_t buffer_size) |
| uint16_t | kvrGetVersion (void) |
| kvrStatus | kvrStringFromAddress (char *buffer, uint32_t buffer_size, const kvrAddress *address) |
| kvrStatus | kvrAddressFromString (int32_t address_type, kvrAddress *address, const char *address_string) |
| kvrStatus | kvrWlanGetSecurityText (char *security_string, uint32_t security_string_size, uint32_t capability, uint32_t type_wpa, const kvrCipherInfoElement *wpa_info, const kvrCipherInfoElement *rsn_info) |
| kvrStatus | kvrNetworkGenerateWepKeys (const char *pass_phrase, char *key64_1, char *key64_2, char *key64_3, char *key64_4, char *key128) |
| kvrStatus | kvrNetworkGenerateWpaKeys (const char *pass_phrase, const char *ssid, char *key) |
| void | kvrInitializeLibrary (void) |
| void | kvrUnloadLibrary (void) |
| kvrStatus | kvrServiceQuery (int *status) |
| kvrStatus | kvrServiceStart (int *status) |
| kvrStatus | kvrServiceStop (int *status) |
Library for interacting with remote devices. (Currently Windows only)
| struct kvrAddress |
Device address.
| Data Fields | ||
|---|---|---|
| uint8_t | address[20] |
IP or MAC address. |
| uint32_t | type | |
| struct kvrCipherInfoElement |
Capability of a WLAN AP. These are values from the standard 802.11 beacon.
To convert the security information into a more human readable form, use kvrWlanGetSecurityText().
| struct kvrDeviceInfo |
Holds information about a discovered device.
The information in here is returned when a device is discovered. For a WLAN connected device, device_address and client_address are IP addresses, and base_station_id is the ethernet MAC address of the AP.
Depending on the "availability" flag, not all fields may be used. If "availability" includes the flag kvrAvailability_STORED the following fields are set: ean_hi, ean_lo, ser_no, device_address, request_connection, name and accessibility_pwd.
If the field "availability" includes the flag kvrAvailability_FOUND_BY_SCAN, the following fields are set: fw_major_ver, fw_minor_ver, fw_build_ver, usage, accessibility, host_name and client_address.
| Data Fields | ||
|---|---|---|
| int32_t | accessibility | |
| char | accessibility_pwd[256] |
Accessibility password or empty. |
| int32_t | availability |
The device availability. One or more kvrAvailability_xxx flags. |
| kvrAddress | base_station_id |
Unique ID of base station, if any. |
| kvrAddress | client_address |
Address of connected client, if any. |
| kvrAddress | device_address |
Address of remote device. |
| uint32_t | ean_hi |
High part of EAN. |
| uint32_t | ean_lo |
Low part of EAN. |
| char | encryption_key[32] |
Encryption key. |
| int32_t | fw_build_ver |
Firmware build version. |
| int32_t | fw_major_ver |
Major firmware version. |
| int32_t | fw_minor_ver |
Minor firmware version. |
| char | host_name[256] |
DNS hostname or empty. |
| char | name[256] |
User-defined name. |
| int32_t | request_connection |
Activate or deactivate a request for connection to a specified device. Activation means that the device will be connected to when it appears in the future. |
| char | reserved1[256] | |
| char | reserved2[256] | |
| uint32_t | ser_no |
Serial number. |
| uint32_t | struct_size |
Size of struct, used for compatibility. |
| int32_t | usage | |
| #define kvrAccessibility_PRIVATE 3 |
Private (invisible, password needed to connect).
| #define kvrAccessibility_PROTECTED 2 |
Protected (visible for all, password needed to connect).
| #define kvrAccessibility_PUBLIC 1 |
Public (visible for all, no password required to connect).
| #define kvrAccessibility_UNKNOWN 0 |
Unknown (e.g., no reply from device).
| #define kvrAddressType_IPV4 1 |
IP v.4 address.
| #define kvrAddressType_IPV4_PORT 3 |
IP v.4 address with tcp-port.
| #define kvrAddressType_IPV6 2 |
IP v.6 address.
| #define kvrAddressType_MAC 4 |
Ethernet MAC address.
| #define kvrAddressType_UNKNOWN 0 |
Unknown (e.g., no reply from device).
| #define kvrAddressTypeFlag_ALL 0xff |
All defined below
| #define kvrAddressTypeFlag_BROADCAST 0x01 |
Broadcast addresses
| #define kvrAddressTypeFlag_STORED 0x02 |
Previously stored addresses
| #define kvrAvailability_FOUND_BY_SCAN 1 |
Device was found by scan.
| #define kvrAvailability_NONE 0 |
Manually added.
| #define kvrAvailability_STORED 2 |
Device was stored.
| #define kvrBss_ANY 2 |
Any.
| #define kvrBss_INDEPENDENT 1 |
Ad-hoc network.
| #define kvrBss_INFRASTRUCTURE 0 |
Network with AP.
| #define kvrConfigMode_ERASE 2 |
Erase and write.
| #define kvrConfigMode_R 0 |
Read only.
| #define kvrConfigMode_RW 1 |
Read/write.
| #define kvrDeviceUsage_CONFIG 4 |
Device is being configured via USB.
| #define kvrDeviceUsage_FREE 1 |
Not in use.
| #define kvrDeviceUsage_REMOTE 2 |
Connected to a PC (as a remote device).
| #define kvrDeviceUsage_UNKNOWN 0 |
Unknown (e.g., no reply from device).
| #define kvrDeviceUsage_USB 3 |
Connected via USB cable.
| #define kvrNetworkState_AUTHENTICATING 8 |
EAPOL handshake ongoing.
| #define kvrNetworkState_AUTHENTICATION_FAILED 9 |
Authentication have failed.
| #define kvrNetworkState_CONNECTED 7 |
Network is reached.
| #define kvrNetworkState_CONNECTING 6 |
Waiting for connections (ad-hoc).
| #define kvrNetworkState_CONNECTION_DELAY 5 |
Delay during connection (ad-hoc).
| #define kvrNetworkState_FAILED_MIC 11 |
MIC verification (EAPOL-key) failed.
| #define kvrNetworkState_INITIALIZING 3 |
Started, waiting for initialization.
| #define kvrNetworkState_INVALID 1 |
Network hardware has been disabled.
| #define kvrNetworkState_NOT_CONNECTED 4 |
No connection (may auto-connect).
| #define kvrNetworkState_ONLINE 10 |
Authentication completed.
| #define kvrNetworkState_STARTUP 2 |
Configuring network hardware.
| #define kvrNetworkState_UNKNOWN 0 |
Bad state, should never be reported.
| #define kvrRegulatoryDomain_CHINA_MII 4 |
MII
| #define kvrRegulatoryDomain_EUROPE_ETSI 1 |
ETSI
| #define kvrRegulatoryDomain_JAPAN_TELEC 0 |
TELEC
| #define kvrRegulatoryDomain_NORTH_AMERICA_FCC 2 |
FCC
| #define kvrRegulatoryDomain_WORLD 3 |
WORLD
| #define kvrRemoteState_AVAILABLE 1 |
Tries to ping known device.
| #define kvrRemoteState_CLOSING 10 |
Will stop communication.
| #define kvrRemoteState_CONFIG_CHANGED 13 |
Same as UNWILLING.
| #define kvrRemoteState_CONNECTION_DOWN 5 |
Will try and restore connection.
| #define kvrRemoteState_CONNECTION_UP 6 |
Device connected, heartbeat up.
| #define kvrRemoteState_DISCOVERED 2 |
Currently not used.
| #define kvrRemoteState_INSTALLING 15 |
Driver installation is in progress.
| #define kvrRemoteState_REDISCOVER 7 |
Trying to talk to device.
| #define kvrRemoteState_REDISCOVER_PENDING 9 |
Will do rediscover in a moment.
| #define kvrRemoteState_REMOVE_ME 11 |
Device removed, it will be stopped.
| #define kvrRemoteState_STANDBY 12 |
Known device, but unused.
| #define kvrRemoteState_STARTED 4 |
Currently not used.
| #define kvrRemoteState_STARTING 3 |
Initializes for new device.
| #define kvrRemoteState_STOPPING 14 |
Tries to stop device.
| #define kvrRemoteState_UNWILLING 8 |
Device turned down connection req.
| #define kvrRemoteState_VOID 0 |
Marked as not in list.
| #define kvrServiceState_AVAILABLE 1 |
Device available
| #define kvrServiceState_CLOSING 10 |
Closing device
| #define kvrServiceState_CONFIG_CHANGED 13 |
Configuration has changed
| #define kvrServiceState_CONNECTION_DOWN 5 |
Connection is currently down
| #define kvrServiceState_CONNECTION_UP 6 |
Connection is corrently up. The device should be showing up in Kvaser Hardware and be ready to be used from CANlib.
| #define kvrServiceState_DISCOVERED 2 |
Device discovered
| #define kvrServiceState_INSTALLING 15 |
Device is currently being installed
| #define kvrServiceState_REDISCOVER 7 |
We've lost the device - rediscover it
| #define kvrServiceState_REDISCOVER_PENDING 9 |
Rediscover is pending
| #define kvrServiceState_REMOVE_ME 11 |
Removing the device
| #define kvrServiceState_STANDBY 12 |
Standby, the service is not taking any actions against this device
| #define kvrServiceState_STARTED 4 |
Device is started
| #define kvrServiceState_STARTING 3 |
Device is starting, other devices may inhibit this device from being started at the moment (e.g. by installing).
| #define kvrServiceState_STOPPING 14 |
Stopping device
| #define kvrServiceState_UNWILLING 8 |
Unwilling, see sub state for reason
| #define kvrServiceState_VOID 0 |
Void
| #define kvrStartInfo_ERR_CONFIGURING 5 |
I'm being configured so won't start
| #define kvrStartInfo_ERR_ENCRYPTION_PWD 7 |
Wrong encryption password.
| #define kvrStartInfo_ERR_IN_USE 2 |
Already connected to someone else
| #define kvrStartInfo_ERR_NOTME 4 |
This start is not for me
| #define kvrStartInfo_ERR_PARAM 6 |
Invalid parameters in QRV (non matching versions)
| #define kvrStartInfo_ERR_PWD 3 |
Wrong connection pwd
| #define kvrStartInfo_NONE 0 |
No information available
| #define kvrStartInfo_START_OK 1 |
Started OK
| typedef int32_t kvrConfigHandle |
A configuration handle. Created by calling kvrConfigOpen() or kvrConfigOpenEx().
| typedef int32_t kvrDiscoveryHandle |
Handle used for discovery.
| typedef int32_t kvrRssiHistory |
Receive Signal Strength Indicator (RSSI).
| typedef uint32_t kvrRttHistory |
Round-trip delay time (RTT).
| enum kvrStatus |
Return type of kvrlib functions.
| void kvrInitializeLibrary | ( | void | ) |
Initializes library stuff. Call this function before calling any other kvr function.
| kvrStatus kvrServiceQuery | ( | int * | status | ) |
Queries the status of the helper service. The helper service is installed as a part of the driver package and is normally set to automatic start.
| [out] | status | Win32 status code on failure. |
| kvrStatus kvrServiceStart | ( | int * | status | ) |
Starts the helper service. The helper service is installed as a part of the driver package and is normally set to automatic start.
| [out] | status | Win32 status code on failure. |
| kvrStatus kvrServiceStop | ( | int * | status | ) |
Stops the helper service. The helper service is installed as a part of the driver package and is normally set to automatic start.
| [out] | status | Win32 status code on failure. |
| void kvrUnloadLibrary | ( | void | ) |
Unloads library stuff. Call this function after calling all other kvr functions.