BAOS SDK v2  1.0.1
An SDK providing access to IP-BAOS devices through BAOS binary protocol version 2.x
wz::baos Namespace Reference

Global BAOS sdk namespace. More...

Namespaces

 protocol
 Groups BAOS binary protocol specific types , defines and classes for Indications, Responses etc.
 

Classes

class  BaosConnection
 Represents a connection to a BAOS device. More...
 
class  IOEvent
 Represents an IOEvent. More...
 
class  BaosDevice
 This class represents a BAOS device. More...
 
struct  DeviceStaticInfo
 A collection of fields representing those serveritems which won't ever change in a device. More...
 
struct  DeviceConfigInfo
 A collection of fields representing those serveritems which may change if the configuration of the device is changed. More...
 
struct  DeviceRuntimeInfo
 A collection of fields representing those serveritems which may change during "normal" operation of the device. More...
 
struct  DatapointConfig
 Information about a datapoint object. More...
 
struct  DeviceClassConfig
 Configuration options for the cpp device class behaviour. More...
 
struct  DeviceGroupIdentifier
 Unique identifier for a device. More...
 
struct  DeviceMeta
 Meta information about a device group, which is required be the device class. More...
 

Typedefs

using Buffer = std::vector< std::uint8_t >
 An alias type for a byte buffer.
 
using BaosMsgQueue = wzcpp::ConcurrentDeque< IOEvent >
 Alias for a concurrent queue with IOEvents.
 
using BaosConnection_UPtr = std::unique_ptr< BaosConnection >
 Alias for a std::unique pointer of a BaosConnection.
 
using DatapointConfigurations = std::map< std::uint16_t, DatapointConfig >
 
using DevicesMeta = std::map< DeviceGroupIdentifier, DeviceMeta >
 Maps the unqiue device identifier to an metainformation entry.
 

Enumerations

enum class  BaosParseStatus {
  Success ,
  SizeMismatch ,
  InvalidKnxHeader ,
  InvalidConnectionHeader ,
  InvalidMsgData ,
  InvalidMainService ,
  InvalidSubService ,
  UnknownIndicationType ,
  MalformedResponse
}
 The different result type of the BAOS binary parsing operation.
 
enum class  ServerItemReadStrategy : std::uint8_t {
  METADATAREAD ,
  METADATAREADWITHFALLBACK ,
  ALLATONCE
}
 Strategy type on how to handle reading the serveritems. More...
 
enum class  ErrorCodes {
  BaosError = 2 ,
  SocketError = 3 ,
  AddressResolveError = 4 ,
  TCPConnectionError = 5 ,
  TCPConnectionClosed = 6 ,
  SocketRecvError = 7 ,
  SocketSendError = 8 ,
  SocketInitError = 9 ,
  SocketRxBufferToSmall = 10 ,
  ResponseError = 20 ,
  ResponseTimeoutError = 21 ,
  MaleformedTelegram = 22 ,
  ClosedConnection = 51 ,
  StoppedConnection = 52
}
 Custom error codes for each exception. More...
 

Functions

std::string BAOSLIB_EXPORT parseStatusToString (BaosParseStatus &parseStatus)
 Human readable string of the parse status.
 
std::string toString (IOEvent::Type typ)
 Provides a human readable string for an IOEvent type. More...
 
std::string BAOSLIB_EXPORT toString (const DatapointConfig &config)
 Convert to human readable string.
 
 DECLARE_WZ_EXCEPTION (WzBaosException, ErrorCodes::BaosError, wzcpp::error::WzBaseException)
 Generic exception from this SDK.
 
 DECLARE_WZ_EXCEPTION (WzSocketException, ErrorCodes::SocketError, WzBaosException)
 Thrown if errors occur in the underlying sockets.
 
 DECLARE_WZ_EXCEPTION (WzIpAddressResolveException, ErrorCodes::AddressResolveError, WzSocketException)
 Thrown if the ip address could not be resolved.
 
 DECLARE_WZ_EXCEPTION (WzTCPConnectionException, ErrorCodes::TCPConnectionError, WzSocketException)
 Thrown for error during establishing of the TCP connection.
 
 DECLARE_WZ_EXCEPTION (WzTCPConnectionClosedException, ErrorCodes::TCPConnectionClosed, WzSocketException)
 Thrown if the TCP connection is unexpectely closed.
 
 DECLARE_WZ_EXCEPTION (WzRecvException, ErrorCodes::SocketRecvError, WzSocketException)
 Thrown on error during a read on a socket.
 
 DECLARE_WZ_EXCEPTION (WzSendException, ErrorCodes::SocketSendError, WzSocketException)
 Thrown on error during a send to a socket.
 
 DECLARE_WZ_EXCEPTION (WzSocketInitException, ErrorCodes::SocketInitError, WzSocketException)
 Thrown if creation or initialization of the socket failed.
 
 DECLARE_WZ_EXCEPTION (WzRxBufferOverflowException, ErrorCodes::SocketRxBufferToSmall, WzSocketException)
 
 DECLARE_WZ_EXCEPTION (WzMaleformedTelegramException, ErrorCodes::MaleformedTelegram, WzBaosException)
 Thrown if incoming telegrams are not wellformed.
 
 DECLARE_WZ_EXCEPTION (WzResponseException, ErrorCodes::ResponseError, WzBaosException)
 Thrown if the response contains an errorcode other then success.
 
 DECLARE_WZ_EXCEPTION (WzResponseTimeoutException, ErrorCodes::ResponseTimeoutError, WzBaosException)
 Thrown if an expected response was not received in time.
 
 DECLARE_WZ_EXCEPTION (WzClosedConnectionException, ErrorCodes::ClosedConnection, WzBaosException)
 Thrown if the connection was not open for some task.
 
 DECLARE_WZ_EXCEPTION (WzStoppedConnectionException, ErrorCodes::StoppedConnection, WzBaosException)
 Thrown if attempted to open a connection which underlying system is not running.
 
void setBaosLogLevel (wzcpp::LogLevel level)
 

Variables

constexpr std::uint16_t MAX_TELEGRAM_LENGTH {1024}
 The maximum supported length for one BAOS telegram.
 

Detailed Description

Global BAOS sdk namespace.

Typedef Documentation

◆ DatapointConfigurations

using DatapointConfigurations = std::map<std::uint16_t, DatapointConfig>

A map with the datapoint ids as keys and the DatapointConfig struct as values

Examples
03_BaosDatapointConfiguration.cpp, 07_SwitchingActuator.cpp, and 09_BaosView.cpp.

Enumeration Type Documentation

◆ ServerItemReadStrategy

enum ServerItemReadStrategy : std::uint8_t
strong

Strategy type on how to handle reading the serveritems.

Enumerator
METADATAREAD 

Read the information for DeviceGroupIdentifier first an then rely on the metadata provided in DevicesMeta.h to read the remaining serveritems

METADATAREADWITHFALLBACK 

The same as METADATAREAD but instead of throwing an exception if no meta data is available a fallback to read ALLATONCE is executed

ALLATONCE 

Read from first to std::uint16_t Max serveritems.

◆ ErrorCodes

enum ErrorCodes
strong

Custom error codes for each exception.

Each custom exception has it's own error code. The reasoning behind this is that when creating wrapper around this code for other languages like C, that do not support exceptions its easy to catch the SDK exceptions extract the errorcode and forward it.

Function Documentation

◆ toString()

std::string wz::baos::toString ( IOEvent::Type  typ)
inline

Provides a human readable string for an IOEvent type.

Parameters
typThe IOEvent type
Returns
std::string
Examples
03_BaosDatapointConfiguration.cpp.

◆ DECLARE_WZ_EXCEPTION()

wz::baos::DECLARE_WZ_EXCEPTION ( WzRxBufferOverflowException  ,
ErrorCodes::SocketRxBufferToSmall  ,
WzSocketException   
)

Thrown if the incoming telegram is to big for the buffer. The buffer size is defined in MAX_TELEGRAM_LENGTH

◆ setBaosLogLevel()