This is an old revision of the document!


HDHomeRun Device Discover API

This is a mirror of the documentation from: https://www.silicondust.com/hdhomerun/hdhomerun_discover_api.pdf

20240203-1

https://download.silicondust.com/hdhomerun/libhdhomerun.tgz

https://github.com/Silicondust/libhdhomerun

The libhdhomerun library is available under a commercial license suitable for compiling directly into an app – contact Silicondust to request.

Requires C99 compliant compiler.

Example code

See hdhomerun_discover_example.c for an example of using the discover API. Header files:

Include hdhomerun.h to access libhdhomerun APIs.

The discover API is declared in hdhomerun_discover.h.

File Purpose
All platforms
hdhomerun_discover.c Discover API
hdhomerun_debug.c Internal debug logging
hdhomerun_pkt.c Internal packet handling
hdhomerun_sock.c Internal socket handling (common code)
Linux / Android
hdhomerun_os_posix.c Internal OS wrapper functions
hdhomerun_sock_posix.c Internal socket handling
hdhomerun_sock_netlink.c Internal IP address detection
Mac / BSD
hdhomerun_os_posix.c Internal OS wrapper functions
hdhomerun_sock_posix.c Internal socket handling
hdhomerun_sock_getifaddrs.c Internal IP address detection
Windows
hdhomerun_os_windows.c Internal OS wrapper functions
hdhomerun_sock_windows.c Internal IP address detection & socket handling
struct hdhomerun_discover_t *hdhomerun_discover_create(struct hdhomerun_debug_t *dbg);

Creates a discover object for managing / executing the discover process. The object may be maintained across the lifespan of the app or may be created and destroyed for each discover.

If the app polls discover often the discover object should be maintained and reused to avoid excessive cycling through local port numbers.

Parameters:

  • dbg: debug object for debug logging or NULL if not using logging.

Returns:

  • Discover object. Free using hdhomerun_discover_destroy().
void hdhomerun_discover_destroy(struct hdhomerun_discover_t *ds);

Frees all resources associated with the given discover object.

Parameters:

  • ds: discover object to free.

Returns:

  • None.
  • Last modified: 2024/02/07 01:51