EduArt Sensor Ring Library 3.0.0
Loading...
Searching...
No Matches
eduart::device::EnumerationInformation Struct Reference

Information reported by a board during enumeration: index, version, commit hash, board type, and state. More...

#include <EnumerationInformation.hpp>

Collaboration diagram for eduart::device::EnumerationInformation:
[legend]

Public Member Functions

bool isUndefined () const noexcept
 Return true if this instance has not been filled from a valid enumeration response.
bool hasDevice (DeviceType type) const noexcept
 Check if a specific device type is reported as populated.
bool operator== (unsigned int other) const noexcept
 Compare enumeration index to an integer.
bool operator== (const EnumerationInformation &other) const noexcept
 Compare two EnumerationInformation values for equality.
bool operator< (const EnumerationInformation &other) const noexcept
 Order by index for sorting.
std::string toString () const
 Format this board's enumeration info as a human-readable string.

Static Public Member Functions

static EnumerationInformation fromBuffer (const std::vector< uint8_t > &buffer)
 Parse enumeration info from the raw response buffer (e.g. CMD_ACTIVE_DEVICE_RESPONSE payload).

Public Attributes

unsigned int idx = 0
 Board index.
Version version = {}
 Firmware/board version from enumeration response.
CommitHash hash = {}
 Commit hash from enumeration response.
SensorBoardType type = SensorBoardType::Undefined
 Detected or configured board type.
std::uint16_t device_options = 0
 Bitmask describing which devices are physically populated on the board.
std::vector< DeviceTypedevices
 Devices on the board.
ConnectionState state = ConnectionState::Undefined
 Configuration/connection state after enumeration.
ConfigurationState config_state = ConfigurationState::Undefined
 Configuration state set by the factory during build().
std::vector< DeviceTypeconfigured_devices
 Device types that were instantiated by the factory (subset of devices).

Detailed Description

Information reported by a board during enumeration: index, version, commit hash, board type, and state.

Member Function Documentation

◆ fromBuffer()

EnumerationInformation eduart::device::EnumerationInformation::fromBuffer ( const std::vector< uint8_t > & buffer)
static

Parse enumeration info from the raw response buffer (e.g. CMD_ACTIVE_DEVICE_RESPONSE payload).

Parameters
[in]bufferRaw bytes from the device.
Returns
Parsed EnumerationInformation.

◆ hasDevice()

bool eduart::device::EnumerationInformation::hasDevice ( DeviceType type) const
noexcept

Check if a specific device type is reported as populated.

Parameters
[in]typeDevice type to check.
Returns
true if the corresponding bit is set in device_options.

◆ isUndefined()

bool eduart::device::EnumerationInformation::isUndefined ( ) const
noexcept

Return true if this instance has not been filled from a valid enumeration response.

Returns
true if state/type are Undefined and idx is 0.

◆ operator<()

bool eduart::device::EnumerationInformation::operator< ( const EnumerationInformation & other) const
noexcept

Order by index for sorting.

Parameters
[in]otherValue to compare with.
Returns
true if idx < other.idx.

◆ operator==() [1/2]

bool eduart::device::EnumerationInformation::operator== ( const EnumerationInformation & other) const
noexcept

Compare two EnumerationInformation values for equality.

Parameters
[in]otherValue to compare with.
Returns
true if all fields are equal.

◆ operator==() [2/2]

bool eduart::device::EnumerationInformation::operator== ( unsigned int other) const
noexcept

Compare enumeration index to an integer.

Parameters
[in]otherIndex to compare with idx.
Returns
true if idx == other.

◆ toString()

std::string eduart::device::EnumerationInformation::toString ( ) const

Format this board's enumeration info as a human-readable string.

Returns
Multi-line string describing the board.

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