|
FIU Serial Library 1.0.0
FIU Serial Library
|
Serial client for communicating with the Bloomy Controls Fault Insertion Unit (FIU). More...
#include <FiuClient.h>
Serial client for communicating with the Bloomy Controls Fault Insertion Unit (FIU).
Public Member Functions | |
| FIU_API | FiuClient () |
| Default constructor. | |
| FIU_API | FiuClient (FiuClient &&other) noexcept |
| Move constructor. | |
| FIU_API FiuClient & | operator= (FiuClient &&rhs) noexcept |
| Move assignment operator. | |
| FIU_API | ~FiuClient () |
| Destructor. | |
| FIU_API ErrorCode | Open (const std::string &port) |
| Open a serial port to connect to the FIU. | |
| FIU_API void | Close () noexcept |
| Close the serial port. | |
| FIU_API ErrorCode | SetBoxID (std::uint8_t box_id) noexcept |
| Set the target box ID. | |
| FIU_API std::uint8_t | GetBoxID () const noexcept |
| Get the target box ID. | |
| FIU_API ErrorCode | SetChannelState (unsigned int channel, ChannelState state) const |
| Set the state of a channel. | |
| FIU_API ErrorCode | SetAllChannelStates (ChannelState state) const |
| Set the state of all channels. | |
| FIU_API Result< std::array< ChannelState, kChannelCount > > | GetChannelStates () const |
| Get the states of all 24 channels. | |
| FIU_API Result< FirmwareVersion > | GetFirmwareVersion () const |
| Get the firmware version loaded onto the FIU. | |
| FIU_API ErrorCode | SetSoftwareInterlock (bool en) const |
| Set the state of the software interlock. | |
| FIU_API Result< bool > | GetInterlockState () const |
| Get the interlock state. | |
Static Public Member Functions | |
| static FIU_API unsigned int | Version () noexcept |
| Get the library version as an integer. | |
|
noexcept |
Get the target box ID.
| FIU_API Result< std::array< ChannelState, kChannelCount > > GetChannelStates | ( | ) | const |
Get the states of all 24 channels.
| FIU_API Result< FirmwareVersion > GetFirmwareVersion | ( | ) | const |
Get the firmware version loaded onto the FIU.
| FIU_API Result< bool > GetInterlockState | ( | ) | const |
Get the interlock state.
| FIU_API ErrorCode Open | ( | const std::string & | port | ) |
Open a serial port to connect to the FIU.
| [in] | port | serial port to open (e.g., COM4) |
Move assignment operator.
| [in] | rhs | client to move from |
| FIU_API ErrorCode SetAllChannelStates | ( | ChannelState | state | ) | const |
Set the state of all channels.
This function can only be used with the connected and disconnected states, as the others require the use of shared resources.
| [in] | state | desired channel state |
|
noexcept |
Set the target box ID.
This can be done at runtime to quickly target another device.
| [in] | box_id | new target box ID, 0-6 |
| FIU_API ErrorCode SetChannelState | ( | unsigned int | channel, |
| ChannelState | state ) const |
Set the state of a channel.
| [in] | channel | target channel, 0-23 |
| [in] | state | desired channel state |
| FIU_API ErrorCode SetSoftwareInterlock | ( | bool | en | ) | const |
Set the state of the software interlock.
| [in] | en | whether to enable the software interlock |
|
staticnoexcept |
Get the library version as an integer.
For example, version 1.3.2 would return 10302.