Finding your remote device.
More...
|
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) |
|
Finding your remote device.
◆ kvrDeviceGetServiceStatus()
kvrStatus kvrDeviceGetServiceStatus |
( |
const kvrDeviceInfo * |
device_info, |
|
|
int32_t * |
state, |
|
|
int32_t * |
start_info |
|
) |
| |
◆ 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. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
- 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. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
◆ kvrDiscoveryClose()
◆ 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 |
- Returns
- kvrOK on success or any other kvrStatus on failure.
- Examples:
- example/c/kvrConnect.c.
◆ kvrDiscoveryGetResults()
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. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
- Examples:
- example/c/kvrConnect.c.
◆ kvrDiscoveryOpen()
◆ kvrDiscoverySetAddresses()
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. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
- Examples:
- example/c/kvrConnect.c.
◆ kvrDiscoverySetEncryptionKey()
Sets the encryption key to use when encrypting communication.
- Parameters
-
[in] | device_info | The device to set the password for. |
[in] | key | The key as a C string. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
◆ kvrDiscoverySetPassword()
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. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
- Examples:
- example/c/kvrConnect.c.
◆ kvrDiscoveryStart()
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. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
- Examples:
- example/c/kvrConnect.c.
◆ kvrDiscoveryStartEx()
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. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
◆ kvrDiscoveryStoreDevices()
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. |
- Returns
- kvrOK on success or any other kvrStatus on failure.
- Examples:
- example/c/kvrConnect.c.