EduArt Sensor Ring Library 3.0.0
Loading...
Searching...
No Matches
SensorBoard.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 <mutex>
14
19#include "sensorring/platform/SensorringExport.hpp"
21
22namespace eduart {
23
24namespace com {
25class ComInterface;
26}
27
28namespace device {
29
34class SENSORRING_EXPORT SensorBoard : public IDevice {
35public:
43 SensorBoard(SensorBoardParams params, com::ComInterfaceID interface, unsigned int idx, std::vector<std::unique_ptr<BaseDevice> > devices);
46
51 bool isEnumerated() const;
62
67 std::vector<BaseDevice*> getDevices() const;
68
69private:
75 void comCallback(const com::ComEndpoint source, const std::vector<uint8_t>& data);
76
77 unsigned int _idx;
78 com::ComInterface* _interface;
79 const SensorBoardParams _params;
80 EnumerationInformation _enum_info;
81
82 std::vector<std::unique_ptr<device::BaseDevice> > _device_vec;
83
84 mutable std::recursive_mutex _com_mutex;
85 using LockGuard = std::lock_guard<std::recursive_mutex>;
86
87 subscription::Subscription _com_subscription;
88};
89
90} // namespace device
91
92} // namespace eduart
Base device combining IDevice and BaseSensor with device ID and state.
Interface type definition.
Version, commit hash, and board enumeration info reported by hardware.
Parameter structure of a sensor board.
SensorBoardType
Definition SensorBoardType.hpp:21
RAII wrapper pairing a SubscriberToken with its cancel function.
Uniquely identifies a communication endpoint by its string ID.
Definition ComEndpoint.hpp:25
std::vector< BaseDevice * > getDevices() const
Return non-owning pointers to all devices on this board.
SensorBoard(SensorBoardParams params, com::ComInterfaceID interface, unsigned int idx, std::vector< std::unique_ptr< BaseDevice > > devices)
Construct the board with parameters, communication interface, index, and owned devices.
SensorBoardType getBoardType() const
Board type from configuration (undefined if not set). Used for topology enforcement.
bool isEnumerated() const
Report whether this board has completed enumeration.
const EnumerationInformation & getEnumInfo() const
Return the enumeration info received from the hardware.
Move-only RAII wrapper that pairs a SubscriberToken with an unsubscribe callable. Destroying a Subscr...
Definition Subscription.hpp:30
Definition ComInterfaceID.hpp:32
Information reported by a board during enumeration: index, version, commit hash, board type,...
Definition EnumerationInformation.hpp:157
Thin base interface for all concrete devices in the SensorRing.
Definition IDevice.hpp:18
Parameter structure of a sensor board. A sensor board is one circuit board.
Definition SensorBoardParams.hpp:22