14#include <unordered_map>
31#include "sensorring/platform/SensorringExport.hpp"
37class SensorRingFactoryImpl;
79 using EnumerationMap = std::unordered_map<com::ComInterfaceID, std::vector<board::EnumerationInformation> >;
258 std::unique_ptr<SensorRing>
build();
289 std::unique_ptr<SensorRingFactoryImpl> _impl;
Interface type definition.
Parameter structure for the DepthSensor.
Parameter structure for a device.
Enumeration of supported device hardware types.
DeviceType
Supported device hardware types used for device registration and grouping.
Definition DeviceType.hpp:27
Parameter structure for the HTPA32 thermal sensor.
Per-interface-type configuration parameters.
Parameter structure for the Light.
Parameter structure of a sensor board.
ValidationMode
Controls how build() handles mismatches between expectations and discovered hardware.
Definition SensorRingFactory.hpp:43
@ Strict
All expectations must match exactly by index; build() returns nullptr on any mismatch.
Definition SensorRingFactory.hpp:45
@ Relaxed
Definition SensorRingFactory.hpp:49
Top-level container managing multiple sensor buses.
Parameter structure for the TMF8829 Time-of-Flight sensor.
Parameter structure for the ThermalSensorParams.
Parameter structure for the VL53L8CX Time-of-Flight sensor.
Parameter structure for the WS2812b LED strip.
void setDefaultDeviceParams(device::TMF8829_Params params)
Set default params applied to a specific discovered device type that has no explicit params from expe...
void reset()
Reset the factory to its initial state. Enumeration results are preserved.
void setDefaultDeviceParams(device::VL53L8CX_Params params)
Set default params applied to a specific discovered device type that has no explicit params from expe...
void expectBoard(board::SensorBoardParams params={})
Declare an expected board on the current interface.
void expectDevice(device::TMF8829_Params params)
Declare an expected device on the most recently added board.
SensorRingFactory(ValidationMode mode=ValidationMode::Relaxed)
Construct the factory with a validation mode.
void setDefaultDeviceParams(device::LightParams params)
Set default params applied to an entire category of discovered devices.
void setDefaultDeviceParams(device::ThermalSensorParams params)
Set default params applied to an entire category of discovered devices.
void addInterface(com::SocketCanParams params)
Add a SocketCAN interface to scan during build().
EnumerationMap enumerate()
Enumerate hardware on all added interfaces without building a SensorRing.
void expectDevice(device::LightParams params)
Declare an expected device by category (matches any sensor of that category).
void addInterface(com::UsbTingoParams params)
Add a USBtingo interface to scan during build().
void expectDevice(device::ThermalSensorParams params)
Declare an expected device by category (matches any sensor of that category).
std::string printTopology() const
Format the latest enumeration results as a human-readable topology string.
void expectDevice(device::HTPA32_Params params)
Declare an expected device on the most recently added board.
void expectDevice(device::VL53L8CX_Params params)
Declare an expected device on the most recently added board.
void expectDevice(device::DepthSensorParams params)
Declare an expected device by category (matches any sensor of that category).
void setDefaultDeviceParams(device::WS2812b_Params params)
Set default params applied to a specific discovered device type that has no explicit params from expe...
const EnumerationMap & getLatestEnumerationResult() const
Return the enumeration results from the last enumerate() or build() call.
void setDefaultDeviceParams(device::DepthSensorParams params)
Set default params applied to an entire category of discovered devices.
std::unique_ptr< SensorRing > build()
Enumerate hardware on all added interfaces, validate against expectations, and construct the SensorRi...
void expectDevice(device::WS2812b_Params params)
Declare an expected device on the most recently added board.
static constexpr Version MIN_FIRMWARE_VERSION
Minimum sensor board firmware version required by this library version.
Definition SensorRingFactory.hpp:82
void expectDevice(device::DeviceType type)
Declare an expected device type without overriding default parameters.
std::unordered_map< com::ComInterfaceID, std::vector< board::EnumerationInformation > > EnumerationMap
Per-interface enumeration results, keyed by interface ID.
Definition SensorRingFactory.hpp:79
void setDefaultDeviceParams(device::HTPA32_Params params)
Set default params applied to a specific discovered device type that has no explicit params from expe...
Semantic version (major, minor, patch) for firmware or board.
Definition EnumerationInformation.hpp:29
Parameter structure of a sensor board. A sensor board is one circuit board.
Definition SensorBoardParams.hpp:51
Configuration parameters for a Linux SocketCAN interface.
Definition InterfaceParams.hpp:86
Configuration parameters for a USBtingo CAN adapter.
Definition InterfaceParams.hpp:97
Parameter structure of the DepthSensor.
Definition DepthSensorParams.hpp:25
Parameter structure of the thermal sensor of a sensor board.
Definition HTPA32_Params.hpp:28
Parameter structure of the Light.
Definition LightParams.hpp:30
Parameter structure of the TMF8829 sensor of a sensor board.
Definition TMF8829_Params.hpp:72
Parameter structure of the ThermalSensorParams.
Definition ThermalSensorParams.hpp:25
Parameter structure of the Time-of-Flight sensor of a sensor board.
Definition VL53L8CX_Params.hpp:25
Parameter structure of the WS2812b LEDs.
Definition WS2812b_Params.hpp:25