Finding your remote device. More...
Detailed Description
Finding your remote device.
Function Documentation
kvrDeviceGetServiceStatus()
| kvrStatus kvrDeviceGetServiceStatus | ( | const kvrDeviceInfo * | device_info, |
| int32_t * | state, | ||
| int32_t * | start_info | ||
| ) |
Returns local connection status of the selected device.
- Parameters
-
[in] device_info The device to request the status information from. [out] state The service state as a kvrServiceState_xxx [out] start_info The start information as a kvrStartInfo_xxx
- Examples:
- example/c/kvrConnect.c.
kvrDeviceGetServiceStatusText()
| kvrStatus kvrDeviceGetServiceStatusText | ( | const kvrDeviceInfo * | device_info, |
| char * | buffer, | ||
| uint32_t | buffer_size | ||
| ) |
Returns local connection status of the selected device as ASCII text.
- Parameters
-
[in] device_info The device to request the status information from. [out] buffer The service status as a C string. [in] buffer_size The service status buffer size.
- Examples:
- example/c/kvrConnect.c.
kvrDiscoveryClearDevicesAtExit()
| kvrStatus kvrDiscoveryClearDevicesAtExit | ( | int | onoff | ) |
Turn automatic clearing of the stored devices on/off.
- Parameters
-
[in] onoff Turn auto-clear on/off. TRUE: Stored devices will be cleared automatically when the application exits, even if the application terminates abnormally. FALSE: Stored devices will be stored until removed.
kvrDiscoveryClose()
| kvrStatus kvrDiscoveryClose | ( | kvrDiscoveryHandle | handle | ) |
Closes the discovery handle opened with kvrDiscoveryOpen().
- Parameters
-
[in] handle Discovery handle.
- Examples:
- example/c/kvrConnect.c.
kvrDiscoveryGetDefaultAddresses()
| kvrStatus kvrDiscoveryGetDefaultAddresses | ( | kvrAddress | address_list[], |
| uint32_t | address_list_size, | ||
| uint32_t * | address_list_count, | ||
| uint32_t | address_type_flags | ||
| ) |
Read out the list of default broadcast addresses. If address_type_flags is set to kvrAddressTypeFlag_ALL the returned list will contain all found addresses (both broadcast addresses and earlier stored addresses).
- Parameters
-
[out] address_list An array of addresses. [in] address_list_size Number of entries in address_list. [out] address_list_count Number of addresses returned. [in] address_type_flags Which kvrAddressTypeFlag_xxx types of addresses to return
- Examples:
- example/c/kvrConnect.c.
kvrDiscoveryGetResults()
| kvrStatus kvrDiscoveryGetResults | ( | kvrDiscoveryHandle | handle, |
| kvrDeviceInfo * | device_info | ||
| ) |
Call this after calling kvrDiscoveryStart(). The first call will return the first result, second call will return the second etc. Will return found devices until kvrERR_BLANK is returned.
- Parameters
-
[in] handle Discovery handle. [out] device_info Device info.
- Examples:
- example/c/kvrConnect.c.
kvrDiscoveryOpen()
| kvrStatus kvrDiscoveryOpen | ( | kvrDiscoveryHandle * | handle | ) |
Create a handle for device discovery. Used by for instance kvrDiscoveryStart(). Close with kvrDiscoveryClose().
- Parameters
-
[out] handle Discovery handle.
- Examples:
- example/c/kvrConnect.c.
kvrDiscoverySetAddresses()
| kvrStatus kvrDiscoverySetAddresses | ( | kvrDiscoveryHandle | handle, |
| const kvrAddress | address_list[], | ||
| uint32_t | address_list_size | ||
| ) |
Set a list of addresses to use for discovery (overwrites any existing addresses). Setting address_list_size with size = 0 will cause kvrDiscoveryStart() to only return stored devices (no network traffic).
- Parameters
-
[in] handle Discovery handle. [in] address_list An array of addresses. [in] address_list_size Number of entries in address_list.
- Examples:
- example/c/kvrConnect.c.
kvrDiscoverySetEncryptionKey()
| kvrStatus kvrDiscoverySetEncryptionKey | ( | kvrDeviceInfo * | device_info, |
| const char * | key | ||
| ) |
kvrDiscoverySetPassword()
| kvrStatus kvrDiscoverySetPassword | ( | kvrDeviceInfo * | device_info, |
| const char * | password | ||
| ) |
Sets the accessibility password to use when connecting to a device.
- Parameters
-
[in] device_info The device to set the password for. [in] password The password as a C string.
- Examples:
- example/c/kvrConnect.c.
kvrDiscoveryStart()
| kvrStatus kvrDiscoveryStart | ( | kvrDiscoveryHandle | handle, |
| uint32_t | delay_ms, | ||
| uint32_t | timeout_ms | ||
| ) |
Start discovering devices on the addresses previously specified with kvrDiscoverySetAddresses(). A delay of delay_ms ms is inferred between each device address request. After the last device address is probed, one more delay of timeout_ms is added before returning.
This means that the function will return in (about) <address_list_size> * delay_ms + timeout_ms ms
The results can be retrieved using kvrDiscoveryGetResults(). A new call to kvrDiscoveryStart() will discard any results not yet retrieved by kvrDiscoveryGetResults().
To decide if an address is a broadcast address, the ip address and subnet mask for all availible network cards are considered.
Beside returning the devices discovered by scan, it will also return any devices previously stored with kvrDiscoveryStoreDevices().
- Note
- A remote device with accessibility set to "private" will not reply to a broadcast scan.
- Parameters
-
[in] handle Discovery handle. [in] delay_ms Delay (in ms) in between sending discovery messages to addresses in the address list. [in] timeout_ms Stop waiting for device discovery after timeout_ms milliseconds.
- Examples:
- example/c/kvrConnect.c.
kvrDiscoveryStartEx()
| kvrStatus kvrDiscoveryStartEx | ( | kvrDiscoveryHandle | handle, |
| uint32_t | delay_ms, | ||
| uint32_t | timeout_ms, | ||
| int | add_stored | ||
| ) |
An extension of kvrDiscoveryStart() that allows to skip devices, which were previously stored by kvrDiscoveryStoreDevices(). If user specifies parameter show_stored as "true", subsequent kvrDiscoveryGetResults() calls will report only those devices that responded to the scan.
- Note
- A remote device with accessibility set to "private" will not reply to a broadcast scan.
- If stored devices are ignored, information about them will be unrecoverable after subsequent call to kvrDiscoveryStoreDevices()
- Parameters
-
[in] handle Discovery handle. [in] delay_ms Delay (in ms) in between sending discovery messages to addresses in the address list. [in] timeout_ms Stop waiting for device discovery after timeout_ms milliseconds. [in] add_stored An indication whether stored devices are to be discovered. TRUE: kvrDiscoveryGetResults() will report stored devices. FALSE: kvrDiscoveryGetResults() will not find stored devices.
kvrDiscoveryStoreDevices()
| kvrStatus kvrDiscoveryStoreDevices | ( | const kvrDeviceInfo | device_info_list[], |
| uint32_t | device_info_list_size | ||
| ) |
Store a list of devices that can be discovered later.
- Parameters
-
[in] device_info_list A list of devices to remember. [in] device_info_list_size The number of elements in device_info_list.
- Examples:
- example/c/kvrConnect.c.