ABS SCPI Driver 0.2.0
ABS SCPI driver library
Loading...
Searching...
No Matches
CommonTypes.h File Reference

Defines common types for use with the SCPI client. More...

+ Include dependency graph for CommonTypes.h:
+ This graph shows which files directly or indirectly include this file:

Classes

struct  DeviceInfo
 General device info. More...
 
struct  EthernetConfig
 Ethernet configuration structure. More...
 
struct  ScpiError
 SCPI error read from device error queue. More...
 
struct  ModelInfo
 Information about a model. More...
 

Namespaces

namespace  bci
 Bloomy Controls root namespace.
 
namespace  bci::abs
 Contains ABS-related code.
 
namespace  bci::abs::alarms
 Bits and masks for interpreting alarms.
 
namespace  bci::abs::model_status
 Bits for interpreting the model status.
 

Typedefs

template<class T >
using Result = tl::expected< T, ErrorCode >
 Result type used to return values or error codes from driver functions.
 

Enumerations

enum class  CellFault : int { kNone , kOpenCircuit , kShortCircuit , kPolarity }
 Cell fault states. More...
 
enum class  CellSenseRange : int { kAuto , kLow , kHigh }
 Cell current sense ranges. Defaults to auto at power up. More...
 
enum class  CellMode : int { kConstantVoltage , kCurrentLimited }
 Cell operating modes. More...
 
enum class  ErrorCode : int {
  kSuccess = 0 , kChannelIndexOutOfRange = -1 , kInvalidIPAddress = -2 , kConnectionTimedOut = -3 ,
  kConnectionFailed = -4 , kSendFailed = -5 , kSendTimedOut = -6 , kReadFailed = -7 ,
  kReadTimedOut = -8 , kNotConnected = -9 , kInvalidResponse = -10 , kInvalidFaultType = -11 ,
  kInvalidSenseRange = -12 , kInvalidArgument = -13 , kInvalidDriverHandle = -14 , kReceiveNotAllowed = -15 ,
  kAlreadyConnected = -16 , kSocketError = -17 , kFailedToBindSocket = -18 , kOpeningSerialPortFailed = -19 ,
  kFailedToConfigurePort = -20 , kFailedToJoinGroup = -21 , kBufferTooSmall = -22 , kAllocationFailed = -23 ,
  kUnexpectedException = -24
}
 Error codes returned by driver functions. More...
 

Functions

const char * ErrorMessage (ErrorCode ec) noexcept
 Get an error message string for a given error code.
 

Variables

constexpr unsigned int kCellCount = 8U
 Total cell count.
 
constexpr unsigned int kAnalogInputCount = 8U
 Total analog input count.
 
constexpr unsigned int kAnalogOutputCount = 8U
 Total analog output count.
 
constexpr unsigned int kDigitalInputCount = 4U
 Total digital input count.
 
constexpr unsigned int kDigitalOutputCount = 4U
 Total digital output count.
 
constexpr unsigned int kGlobalModelInputCount = 8U
 Total global model input count.
 
constexpr unsigned int kLocalModelInputCount = 8U
 Total local model input count.
 
constexpr unsigned int kModelOutputCount = 36U
 Total model output count.
 
constexpr std::uint32_t kRecoverableMask = 0x0000FF
 Recoverable alarms mask.
 
constexpr std::uint32_t kCriticalMask = 0x00FF00
 Critical alarms mask.
 
constexpr std::uint32_t kFatalMask = 0xFF0000
 Fatal alarms mask.
 
constexpr std::uint32_t kSoftInterlock = 0x000001
 Software interlock.
 
constexpr std::uint32_t kFan0Fault = 0x000100
 Fan 0 fault. Cells 1 and 2 are disabled.
 
constexpr std::uint32_t kFan1Fault = 0x000200
 Fan 1 fault. Cells 3 and 4 are disabled.
 
constexpr std::uint32_t kFan2Fault = 0x000400
 Fan 2 fault. Cells 5 and 6 are disabled.
 
constexpr std::uint32_t kFan3Fault = 0x000800
 Fan 3 fault. Cells 7 and 8 are disabled.
 
constexpr std::uint32_t kFan4Fault = 0x010000
 Fan 4 fault. All cells are disabled.
 
constexpr std::uint32_t kHardwareFault = 0x020000
 Hardware fault. All cells are disabled.
 
constexpr std::uint8_t kRunning = 0x01
 The model is running.
 
constexpr std::uint8_t kLoaded = 0x02
 The model is loaded.
 
constexpr std::uint8_t kErrored = 0x04
 The model has errored.
 

Detailed Description

Defines common types for use with the SCPI client.