Skip to content

C API Discovery Functions

ziAPIDiscoveryFindAll

ZIResult_enum ziAPIDiscoveryFindAll(ZIConnection conn, char *deviceIds, uint32_t bufferSize)

Perform a Discovery property look-up for the specified deviceAddress and return its device ID. Attention! This invalidates all pointers previously returned by ziAPIDiscovery* calls. The deviceId need not be deallocated by the user. ziAPIDiscoveryFind, ziAPIDiscoveryGet, ziAPIDiscoveryGetValueI, ziAPIDiscoveryGetValueS

Parameters

Name Type Direction Description
conn ZIConnection in Pointer to ZIConnection with which the value should be retrieved.
deviceIds char * out Pointer to a buffer that is to contain the list of newline-separated IDs of the devices found, e.g. "dev1000\ndev2000\n".
bufferSize uint32_t in The size of the buffer pointed to by deviceIds. If the buffer is too small to hold the complete list of device IDs, its contents remain unchanged.

Returns

  • ZI_INFO_SUCCESS
  • ZI_ERROR_LENGTH The provided buffer is too small to hold the list.
  • Other return codes may also be returned, for a detailed error message use ziAPIGetLastError.

ziAPIDiscoveryFind

ZIResult_enum ziAPIDiscoveryFind(ZIConnection conn, const char *deviceAddress, const char **deviceId)

Perform a Discovery property look-up for the specified deviceAddress and return its device ID. Attention! This invalidates all pointers previously returned by ziAPIDiscovery* calls. The deviceId need not be deallocated by the user. ziAPIDiscoveryFindAll, ziAPIDiscoveryGet, ziAPIDiscoveryGetValueI, ziAPIDiscoveryGetValueS

Parameters

Name Type Direction Description
conn ZIConnection in Pointer to ZIConnection with which the value should be retrieved.
deviceAddress const char * in The address or ID of the device to find, e.g., 'uhf-dev1000' or 'dev1000'.
deviceId const char ** out The ID of the device that was found, e.g. 'DEV1000'.

Returns

  • ZI_INFO_SUCCESS
  • Other return codes may also be returned, for a detailed error message use ziAPIGetLastError.

ziAPIDiscoveryGet

ZIResult_enum ziAPIDiscoveryGet(ZIConnection conn, const char *deviceId, const char **propsJSON)

Returns the device Discovery properties for a given device ID in JSON format. The function ziAPIDiscoveryFind must be called before ziAPIDiscoveryGet can be used. The propsJSON need not be deallocated by the user. ziAPIDiscoveryFind, ziAPIDiscoveryGetValueI, ziAPIDiscoveryGetValueS

Parameters

Name Type Direction Description
conn ZIConnection in Pointer to ZIConnection with which the value should be retrieved.
deviceId const char * in The ID of the device to get Discovery information for, as returned by ziAPIDiscoveryFind, e.g., 'dev1000'.
propsJSON const char ** out The Discovery properties in JSON format of the specified device.

Returns

  • ZI_INFO_SUCCESS
  • Other return codes may also be returned, for a detailed error message use ziAPIGetLastError.

ziAPIDiscoveryGetValueI

ZIResult_enum ziAPIDiscoveryGetValueI(ZIConnection conn, const char *deviceId, const char *propName, ZIIntegerData *value)

Returns the specified integer Discovery property value for a given device ID. The function ziAPIDiscoveryFind must be called with the required device ID before using ziAPIDiscoveryGetValueI. ziAPIDiscoveryFind, ziAPIDiscoveryGet, ziAPIDiscoveryGetValueS

Parameters

Name Type Direction Description
conn ZIConnection in Pointer to ZIConnection with which the value should be retrieved.
deviceId const char * in The ID of the device to get Discovery information for, as returned by ziAPIDiscoveryFind, e.g., 'dev1000'.
propName const char * in The name of the desired integer Discovery property.
value ZIIntegerData * out Pointer to the value of the specified Discovery property.

Returns

  • ZI_INFO_SUCCESS
  • Other return codes may also be returned, for a detailed error message use ziAPIGetLastError.

ziAPIDiscoveryGetValueS

ZIResult_enum ziAPIDiscoveryGetValueS(ZIConnection conn, const char *deviceId, const char *propName, const char **value)

Returns the specified string Discovery property value for a given device ID. The function ziAPIDiscoveryFind must be called with the required device ID before using ziAPIDiscoveryGetValueS. The value must not be deallocated by the user. ziAPIDiscoveryFind, ziAPIDiscoveryGet, ziAPIDiscoveryGetValueI

Parameters

Name Type Direction Description
conn ZIConnection in Pointer to ZIConnection with which the value should be retrieved.
deviceId const char * in The ID of the device to get Discovery information for, as returned by ziAPIDiscoveryFind, e.g., 'dev1000'.
propName const char * in The name of the desired integer Discovery property.
value const char ** out Pointer to the value of the specified Discovery property.

Returns

  • ZI_INFO_SUCCESS
  • Other return codes may also be returned, for a detailed error message use ziAPIGetLastError.