hololink::module::EnumerationInterfaceV1
hololink::module::EnumerationInterfaceV1
A loadable Module supplements device EnumerationMetadata through this service.
Devices typically announce themselves via BOOTP messages which carry a specific set of identification and configuration information, like device UUID and HSB-IP version (“compat_id”). That’s usually not enough information for most applications to work– for example, the number of sensors and data channels on the system determine the addressing for the specific channels within the device. This service allows the device module, which is loaded via UUID and compat_id, to update EnumerationMetadata with other appropriate configuration data for this device. This supplemented enumeration metadata is passed up to the application layer, and will be used to direct construction of services used on the device.
Inherits from: hololink::module::Service< EnumerationInterfaceV1 > (public)
Methods
update_metadata
Complete the metadata describing an announced device.
Called once per announcement, before the announcement reaches the application; announcements decoded from bootp messages arrive on the Reactor thread.
Returns: HOLOLINK_MODULE_OK once the metadata is complete; HOLOLINK_MODULE_ENUMERATION_SKIPPED to decline the device, which withholds the announcement from the application and lets enumeration of other devices continue; any other status reports a failure, which the Adapter raises as a std::runtime_error.
Parameters
Announcement to complete in place.
The bootp packet metadata was decoded from; a module whose devices carry vendor-specific bytes needs it to complete the metadata. Null when the announcement did not come from a packet.
Length of raw_packet, in bytes.
module
The Module that this service was published from.
The service holds no strong reference to its Module, so this does not extend the Module’s lifetime.
Returns: The owning Module, or an empty pointer if the service has not been published or its Module no longer exists.
Static methods
get_service
Fetch a module's EnumerationInterfaceV1 instance
Overload 2
Fetch a module’s EnumerationInterfaceV1 instance.
Returns: The module’s enumeration service.
Throws: std::runtime_error if the module publishes no enumeration service and allow_null is false.
Parameters
The module that claims the device, from Adapter::get_module.
Return an empty pointer, rather than throwing, when the module publishes no enumeration service.
for_each_type_id
Iterate over every type_id supported by this instance.
The callback signature is bool(const char*) — returning false halts the walk; true continues. Iteration is depth-first, so you’ll see the most specific implementation types first.