Class Command::IoBank

Nested Relationships

This class is a nested type of Class Command.

Class Documentation

class IoBank

A message field for interfacing with a bank of I/O pins.

Public Functions

IoBank(HebiCommandPtr internal, HebiCommandRef &internal_ref, HebiCommandIoPinBank bank)
bool hasInt(size_t pinNumber) const

True if (and only if) the particular numbered pin in this bank has an integer (e.g., digital) value.

Parameters:

pinNumber – Which pin to check; valid values for pinNumber depend on the bank.

bool hasFloat(size_t pinNumber) const

True if (and only if) the particular numbered pin in this bank has an floating point (e.g., analog or PWM) value.

Parameters:

pinNumber – Which pin to check; valid values for pinNumber depend on the bank.

int64_t getInt(size_t pinNumber) const

If this numbered pin in this bank has an integer (e.g., digital) value, returns that value; otherwise returns a default.

Parameters:

pinNumber – Which pin to get; valid values for pinNumber depend on the bank.

float getFloat(size_t pinNumber) const

If this numbered pin in this bank has an floating point (e.g., analog or PWM) value, returns that value; otherwise returns a default.

Parameters:

pinNumber – Which pin to get; valid values for pinNumber depend on the bank.

void setInt(size_t pinNumber, int64_t value)

Sets the particular pin to a integer value (representing a digital output).

Parameters:

pinNumber – Which pin to set; valid values for pinNumber depend on the bank.

void setFloat(size_t pinNumber, float value)

Sets the particular pin to a floating point value (representing a PWM output).

Parameters:

pinNumber – Which pin to set; valid values for pinNumber depend on the bank.

bool hasLabel(size_t pinNumber) const

True if (and only if) the particular numbered pin in this bank has a string label set in this message.

Parameters:

pinNumber – Which pin to set; valid values for pinNumber depend on the bank.

std::string getLabel(size_t pinNumber) const

If this numbered pin in this bank has a string label value, returns that value; otherwise returns an empty string.

Parameters:

pinNumber – Which pin to get; valid values for pinNumber depend on the bank.

void setLabel(size_t pinNumber, const std::string&)

Sets the string label for a particular pin.

Parameters:

pinNumber – Which pin to set; valid values for pinNumber depend on the bank.

void clear(size_t pinNumber)

Removes any currently set value for this pin.

Parameters:

pinNumber – Which pin to clear; valid values for pinNumber depend on the bank.