EduArt Sensor Ring Library 4.0.0
Loading...
Searching...
No Matches
SensorRingFactory.hpp
Go to the documentation of this file.
1// Copyright (c) 2026 EduArt Robotik GmbH
2
9
10#pragma once
11
12#include <memory>
13#include <string>
14#include <unordered_map>
15#include <vector>
16
31#include "sensorring/platform/SensorringExport.hpp"
32
33namespace eduart {
34
35namespace sensorring {
36
37class SensorRingFactoryImpl;
38
51
76class SENSORRING_EXPORT SensorRingFactory {
77public:
79 using EnumerationMap = std::unordered_map<com::ComInterfaceID, std::vector<board::EnumerationInformation> >;
80
82 static constexpr Version MIN_FIRMWARE_VERSION = { 0, 9, 0 };
83
91
92 // ── Interface configuration ──
93
102
111
112 // ── Board expectations ──
113
127
128 // ── Device expectations (applied to the last expectBoard) ──
129
143
157
162
167
172
183
188
193
194 // ── Default device parameters ──
195
210
215
220
225
238
243
248
249 // ── Build ──
250
258 std::unique_ptr<SensorRing> build();
259
270
276
281 std::string printTopology() const;
282
286 void reset();
287
288private:
289 std::unique_ptr<SensorRingFactoryImpl> _impl;
290};
291
292} // namespace sensorring
293
294} // namespace eduart
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
Version, commit hash, and board enumeration info reported by hardware.
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