21#include "sensorring/platform/SensorringExport.hpp"
24using namespace std::chrono_literals;
94 friend struct SensorBoardTestAccess;
96 using Mutex = std::mutex;
97 using UniqueLock = std::unique_lock<Mutex>;
99 using RecursiveMutex = std::recursive_mutex;
100 using RecursiveLock = std::lock_guard<RecursiveMutex>;
107 void comCallback(
const com::ComEndpoint source, std::uint8_t command,
const std::vector<uint8_t>& data);
123 static constexpr std::chrono::milliseconds GET_PARAMETER_SLEEP = 10ms;
124 static constexpr std::chrono::milliseconds GET_PARAMETER_TIMEOUT = 100ms;
130 std::vector<std::unique_ptr<device::Device> > _device_vec;
132 std::atomic<bool> _got_update;
133 com::ComInterface* _interface;
134 mutable RecursiveMutex _com_mutex;
Interface type definition.
Base class for all concrete sensor/actuator devices.
Defines a pose with translation and orientation.
Parameter structure of a sensor board.
Orientation
Possible orientations of a sensor board. Used to rotate/mirror light animations and thermal images.
Definition SensorBoardParams.hpp:26
SensorBoardType
Hardware variant of a sensor board.
Definition SensorBoardType.hpp:28
RAII wrapper pairing a SubscriberToken with its cancel function.
std::vector< device::Device * > getDevices() const
Return non-owning pointers to all devices on this board.
static void cmdEnumerateBoards(com::ComInterfaceID interface)
Send enumeration command on the given interface so boards respond with CMD_ACTIVE_DEVICE_RESPONSE.
const board::EnumerationInformation & getEnumInfo() const
Return the enumeration info received from the hardware.
bool isEnumerated() const
Report whether this board has completed enumeration.
bool configure()
Re-apply runtime configuration after a board reset.
~SensorBoard()
Destructor.
SensorBoard(SensorBoardParams params, com::ComInterfaceID interface, unsigned int idx, std::vector< std::unique_ptr< device::Device > > devices)
Construct the board with parameters, communication interface, index, and owned devices.
static bool resetBoards()
Reset all boards on all interfaces (broadcast reset command).
SensorBoardType getBoardType() const
Board type from configuration (undefined if not set). Used for topology enforcement.
Move-only RAII wrapper that pairs a SubscriberToken with an unsubscribe callable. Destroying a Subscr...
Definition Subscription.hpp:32
Parameter structure of a sensor board. A sensor board is one circuit board.
Definition SensorBoardParams.hpp:51
Uniquely identifies a communication endpoint as a (Direction, BoardAddress, DeviceId) tuple.
Definition ComEndpoint.hpp:37
Uniquely identifies a communication interface by type and name.
Definition ComInterfaceID.hpp:51