Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
discovery_api [2024/02/07 02:45] – neds | discovery_api [2024/02/07 19:05] (current) – [Low level C Library] neds | ||
---|---|---|---|
Line 17: | Line 17: | ||
**Example code:** | **Example code:** | ||
- | See hdhomerun_discover_example.c for an example of using the discover API. | + | See [[https:// |
Header files: | Header files: | ||
Line 133: | Line 133: | ||
* IPv6 link-local – the Scope ID is used if specified, auto-detected if 0. | * IPv6 link-local – the Scope ID is used if specified, auto-detected if 0. | ||
* IPv6 non link-local – set Scope ID to 0. | * IPv6 non link-local – set Scope ID to 0. | ||
- | * **device_types: | + | * **device_types: |
* **device_types_count: | * **device_types_count: | ||
Line 154: | Line 154: | ||
**Parameters: | **Parameters: | ||
* **ds:** discover object. | * **ds:** discover object. | ||
- | * **flags:** specify which IP types to use for discover. See hdhomerun_discover2_find_devices_broadcast() for the description. | + | * **flags:** specify which IP types to use for discover. See [[#hdhomerun_discover2_find_devices_broadcast()]] for the description. |
* **device_id: | * **device_id: | ||
Line 176: | Line 176: | ||
**Parameters: | **Parameters: | ||
* **ds:** discover object. | * **ds:** discover object. | ||
- | * **flags:** specify which IP types to use for discover. See hdhomerun_discover2_find_devices_broadcast() for the description. | + | * **flags:** specify which IP types to use for discover. See [[#hdhomerun_discover2_find_devices_broadcast()]] for the description. |
* **target_addr: | * **target_addr: | ||
* IPv4 and IPv6 addresses supported. | * IPv4 and IPv6 addresses supported. | ||
Line 213: | Line 213: | ||
<WRAP indent> | <WRAP indent> | ||
**Parameters: | **Parameters: | ||
- | * device: device object from hdhomerun_discover2_iter_device_first() or previous call to hdhomerun_discover2_iter_device_next(). | + | |
**Returns: | **Returns: | ||
* Device object. Resource maintained by the ds discover object – do not store or free. | * Device object. Resource maintained by the ds discover object – do not store or free. | ||
Line 287: | Line 287: | ||
* UUID string Storage ID. The returned result must be copied if the value needs to be accessed by the app beyond the scope of the current discover action. | * UUID string Storage ID. The returned result must be copied if the value needs to be accessed by the app beyond the scope of the current discover action. | ||
* NULL if the device does not have a Storage ID, for example a tuner without storage capabilities. | * NULL if the device does not have a Storage ID, for example a tuner without storage capabilities. | ||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== hdhomerun_discover2_device_get_tuner_count() ===== | ||
+ | <WRAP indent> | ||
+ | < | ||
+ | Return the number of tuners the device has. | ||
+ | |||
+ | <WRAP indent> | ||
+ | **Parameters: | ||
+ | * **device:** device object from hdhomerun_discover2_iter_device_first() or hdhomerun_discover2_iter_device_next(). | ||
+ | |||
+ | **Returns: | ||
+ | * The number of tuners the device has. | ||
+ | * 0 if the device does not have tuners. | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== hdhomerun_discover2_device_get_device_auth() ===== | ||
+ | <WRAP indent> | ||
+ | < | ||
+ | The DeviceAuth string reported by the device. Used to access HDHomeRun cloud APIs. | ||
+ | |||
+ | <WRAP indent> | ||
+ | **Parameters: | ||
+ | * **device:** device object from hdhomerun_discover2_iter_device_first() or hdhomerun_discover2_iter_device_next(). | ||
+ | |||
+ | **Returns: | ||
+ | * The DeviceAuth string reported by the device. The returned result must be copied if the value needs to be accessed by the app beyond the scope of the current discover action. | ||
+ | * NULL if the device did not report a DeviceAuth string during discovery. | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== hdhomerun_discover2_iter_device_if_first() ===== | ||
+ | <WRAP indent> | ||
+ | < | ||
+ | A device can have multiple IP addresses, for example IPv4, IPv6 global, and IPv6 link-local. Use hdhomerun_discover2_iter_device_if_first() to obtain the first device-if object (IP address object) in the list associated with a device. This object is used to query the IP address and associated URLs. | ||
+ | |||
+ | A typical application only needs to get the first device-if object and does not need to iterate through the list of device-if objects. | ||
+ | |||
+ | <WRAP indent> | ||
+ | **Parameters: | ||
+ | * **device:** device object from hdhomerun_discover2_iter_device_first() or hdhomerun_discover2_iter_device_next(). | ||
+ | |||
+ | **Returns: | ||
+ | * Device-IF object. Resource maintained by the ds discover object – do not store or free. A device-if object is always present and cannot be NULL. | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== hdhomerun_discover2_iter_device_if_next() ===== | ||
+ | <WRAP indent> | ||
+ | < | ||
+ | Return the next device-if object (IP address object) in the list associated with a device. This object is used to query the IP address and associated URLs. | ||
+ | |||
+ | A typical application only needs to get the first device-if object and does not need to iterate through the list of device-if objects. | ||
+ | |||
+ | <WRAP indent> | ||
+ | **Parameters: | ||
+ | * **device_if: | ||
+ | |||
+ | **Returns: | ||
+ | * Device-IF object. Resource maintained by the ds discover object – do not store or free. | ||
+ | * NULL when the end of the list has been reached. | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== hdhomerun_discover2_device_if_get_ip_addr() ===== | ||
+ | <WRAP indent> | ||
+ | < | ||
+ | Return the IP address of the device. | ||
+ | |||
+ | <WRAP indent> | ||
+ | **Parameters: | ||
+ | * **device_if: | ||
+ | * **ip_addr: | ||
+ | |||
+ | **Returns: | ||
+ | * None. | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== hdhomerun_discover2_device_if_get_base_url() ===== | ||
+ | <WRAP indent> | ||
+ | < | ||
+ | Return the base URL of the device as a string. | ||
+ | |||
+ | <WRAP indent> | ||
+ | **Parameters: | ||
+ | * **device_if: | ||
+ | |||
+ | **Returns: | ||
+ | * Base URL as a string. The returned result must be copied if the value needs to be accessed by the app beyond the scope of the current discover action. The Base URL is always present and cannot be NULL. | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== hdhomerun_discover2_device_if_get_lineup_url() ===== | ||
+ | <WRAP indent> | ||
+ | < | ||
+ | Return the lineup URL (lineup.json) of the device as a string. Only present for devices of type TUNER. | ||
+ | |||
+ | <WRAP indent> | ||
+ | **Parameters: | ||
+ | * **device_if: | ||
+ | |||
+ | **Returns: | ||
+ | * Lineup URL as a string. The returned result must be copied if the value needs to be accessed by the app beyond the scope of the current discover action. | ||
+ | * NULL if the device is not type TUNER. | ||
+ | |||
+ | </ | ||
+ | </ | ||
+ | |||
+ | ===== hdhomerun_discover2_device_if_get_storage_url() ===== | ||
+ | <WRAP indent> | ||
+ | < | ||
+ | Return the storage URL (recorded_files.json) of the device as a string. Only present for devices of type STORAGE. | ||
+ | |||
+ | <WRAP indent> | ||
+ | **Parameters: | ||
+ | * **device_if: | ||
+ | |||
+ | **Returns: | ||
+ | * Storage URL as a string. The returned result must be copied if the value needs to be accessed by the app beyond the scope of the current discover action. | ||
+ | * NULL if the device is not type STORAGE. | ||
+ | |||
</ | </ | ||
</ | </ | ||
{{tag> | {{tag> |