EduArt Sensor Ring Library 3.0.0
Loading...
Searching...
No Matches
SensorBus.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 <vector>
14
16#include "sensorring/platform/SensorringExport.hpp"
18
19#include "SensorBoard.hpp"
20
21namespace eduart {
22
23namespace com {
24class ComInterface;
25}
26
27namespace ring {
28
29using namespace std::chrono_literals;
30
35class SENSORRING_EXPORT SensorBus {
36public:
42 SensorBus(com::ComInterfaceID interface, std::vector<std::unique_ptr<device::SensorBoard> > board_vec);
43
48 void setBitRateSwitching(bool brs_enable);
49
54 unsigned int getSensorCount() const;
55
60 com::ComInterface* getInterface() const;
61
66 std::vector<device::SensorBoard*> getSensorBoards() const;
67
74 static std::vector<device::EnumerationInformation> queryConnectedDevices(com::ComInterfaceID interface, std::chrono::milliseconds timeout = 250ms);
75
76private:
77 com::ComInterface* _interface;
78
79 std::vector<std::unique_ptr<device::SensorBoard> > _board_vec;
80
81 subscription::Subscription _com_subscription;
82};
83
84} // namespace ring
85
86} // namespace eduart
Interface type definition.
Abstraction of a single sensor board.
RAII wrapper pairing a SubscriberToken with its cancel function.
static std::vector< device::EnumerationInformation > queryConnectedDevices(com::ComInterfaceID interface, std::chrono::milliseconds timeout=250ms)
Enumerate boards on an interface.
SensorBus(com::ComInterfaceID interface, std::vector< std::unique_ptr< device::SensorBoard > > board_vec)
Construct the bus with a communication interface and owned sensor boards.
com::ComInterface * getInterface() const
Communication interface used by this bus.
std::vector< device::SensorBoard * > getSensorBoards() const
Non-owning pointers to all sensor boards on this bus.
unsigned int getSensorCount() const
Total number of sensor boards on this bus.
void setBitRateSwitching(bool brs_enable)
Enable or disable bit rate switching on the bus interface.
Move-only RAII wrapper that pairs a SubscriberToken with an unsubscribe callable. Destroying a Subscr...
Definition Subscription.hpp:30
Definition ComInterfaceID.hpp:32