FIU Serial Library 1.0.0
FIU Serial Library
Loading...
Searching...
No Matches
FiuClient Class Reference

Serial client for communicating with the Bloomy Controls Fault Insertion Unit (FIU). More...

#include <FiuClient.h>

Detailed Description

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.

Member Function Documentation

◆ GetBoxID()

FIU_API std::uint8_t GetBoxID ( ) const
noexcept

Get the target box ID.

Returns
Target box ID.

◆ GetChannelStates()

FIU_API Result< std::array< ChannelState, kChannelCount > > GetChannelStates ( ) const

Get the states of all 24 channels.

Returns
Result containing the relay states or an error code.

◆ GetFirmwareVersion()

FIU_API Result< FirmwareVersion > GetFirmwareVersion ( ) const

Get the firmware version loaded onto the FIU.

Returns
Result containing the firmware version or an error code.

◆ GetInterlockState()

FIU_API Result< bool > GetInterlockState ( ) const

Get the interlock state.

Returns
Result containing the interlock state or an error code.

◆ Open()

FIU_API ErrorCode Open ( const std::string & port)

Open a serial port to connect to the FIU.

Parameters
[in]portserial port to open (e.g., COM4)
Returns
An error code.

◆ operator=()

FIU_API FiuClient & operator= ( FiuClient && rhs)
noexcept

Move assignment operator.

Parameters
[in]rhsclient to move from
Returns
Reference to self.

◆ SetAllChannelStates()

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.

Parameters
[in]statedesired channel state
Returns
An error code.

◆ SetBoxID()

FIU_API ErrorCode SetBoxID ( std::uint8_t box_id)
noexcept

Set the target box ID.

This can be done at runtime to quickly target another device.

Parameters
[in]box_idnew target box ID, 0-6
Returns
An error code.

◆ SetChannelState()

FIU_API ErrorCode SetChannelState ( unsigned int channel,
ChannelState state ) const

Set the state of a channel.

Parameters
[in]channeltarget channel, 0-23
[in]statedesired channel state
Returns
An error code.

◆ SetSoftwareInterlock()

FIU_API ErrorCode SetSoftwareInterlock ( bool en) const

Set the state of the software interlock.

Parameters
[in]enwhether to enable the software interlock
Returns
An error code.

◆ Version()

FIU_API unsigned int Version ( )
staticnoexcept

Get the library version as an integer.

For example, version 1.3.2 would return 10302.

Returns
Library version.

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