ReduxLib C++ 2026.1.2
Loading...
Searching...
No Matches
redux::canand::MessageBus Class Reference

#include <MessageBus.h>

Public Member Functions

 MessageBus (uint16_t descriptorId)
 
uint16_t GetDescriptor ()
 
bool Equals (MessageBus other)
 

Static Public Member Functions

static MessageBus ByBusString (std::string busString)
 

Detailed Description

Class representing message buses that may exist on a robot.

Constructor & Destructor Documentation

◆ MessageBus()

redux::canand::MessageBus::MessageBus ( uint16_t  descriptorId)
inline

Constructs a new bus from a descriptor value.

0 is the Rio's onboard bus, and 0 through 4 inclusive are can_s0 through can_s4 on SystemCore.

Parameters
descriptorIdthe bus descriptor value.

Member Function Documentation

◆ ByBusString()

static MessageBus redux::canand::MessageBus::ByBusString ( std::string  busString)
static

Constructs or fetches a bus by its bus string. If the bus is not opened, it will attempt to be opened.

If the bus cannot be opened, an error will be thrown.

Parameters
busStringbus string, e.g. "halcan", "socketcan:can_s0", or "slcan:115200:/dev/ttyAMA0"
Returns
bus instance

◆ Equals()

bool redux::canand::MessageBus::Equals ( MessageBus  other)
inline

Returns whether two MessageBus objects refer to the same bus.

Parameters
otherother MessageBus object to compare against
Returns
whether or not they refer to the same bus

◆ GetDescriptor()

uint16_t redux::canand::MessageBus::GetDescriptor ( )
inline

Returns the descriptor ID associated with the CAN bus object. Generally not needed to be used directly.

Returns
the descriptor ID.

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