EduArt Sensor Ring Library 3.0.0
Loading...
Searching...
No Matches
eduart::ring::SensorBus Class Reference

One communication interface (e.g. CAN) owning multiple SensorBoards and forwarding COM messages. More...

#include <SensorBus.hpp>

Public Member Functions

 SensorBus (com::ComInterfaceID interface, std::vector< std::unique_ptr< device::SensorBoard > > board_vec)
 Construct the bus with a communication interface and owned sensor boards.
void setBitRateSwitching (bool brs_enable)
 Enable or disable bit rate switching on the bus interface.
unsigned int getSensorCount () const
 Total number of sensor boards on this bus.
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.

Static Public Member Functions

static std::vector< device::EnumerationInformationqueryConnectedDevices (com::ComInterfaceID interface, std::chrono::milliseconds timeout=250ms)
 Enumerate boards on an interface.

Detailed Description

One communication interface (e.g. CAN) owning multiple SensorBoards and forwarding COM messages.

Constructor & Destructor Documentation

◆ SensorBus()

eduart::ring::SensorBus::SensorBus ( com::ComInterfaceID interface,
std::vector< std::unique_ptr< device::SensorBoard > > board_vec )

Construct the bus with a communication interface and owned sensor boards.

Parameters
[in]interfaceCommunication interface ID for this bus.
[in]board_vecOwned sensor boards.

Member Function Documentation

◆ getInterface()

com::ComInterface * eduart::ring::SensorBus::getInterface ( ) const

Communication interface used by this bus.

Returns
Pointer to the ComInterface.

◆ getSensorBoards()

std::vector< device::SensorBoard * > eduart::ring::SensorBus::getSensorBoards ( ) const

Non-owning pointers to all sensor boards on this bus.

Returns
Vector of SensorBoard pointers.

◆ getSensorCount()

unsigned int eduart::ring::SensorBus::getSensorCount ( ) const

Total number of sensor boards on this bus.

Returns
Number of boards.

◆ queryConnectedDevices()

std::vector< device::EnumerationInformation > eduart::ring::SensorBus::queryConnectedDevices ( com::ComInterfaceID interface,
std::chrono::milliseconds timeout = 250ms )
static

Enumerate boards on an interface.

Parameters
[in]interfaceCommunication interface ID to enumerate.
[in]timeoutTime to wait for responses before returning.
Returns
Vector of enumeration info. May be empty if none or on error.

◆ setBitRateSwitching()

void eduart::ring::SensorBus::setBitRateSwitching ( bool brs_enable)

Enable or disable bit rate switching on the bus interface.

Parameters
[in]brs_enableEnable flag.

The documentation for this class was generated from the following file: