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

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

Classes

class  StatusFlags
 This structure represents the status flags provided by some BAOS devices server item ServerItemId::StatusFlags. More...
 
class  StatusFlagsSupported
 Represents which status flags are supported by the device, serveritem 52. More...
 
struct  ServerItem
 Structure to hold information about a serveritem. More...
 
struct  DatapointConfigFlags
 Struct for the communication flags of a datapoint. See KNX spec for more details. More...
 
struct  DatapointStatus
 Internal state for each datapoint in the object server. More...
 
struct  DatapointValueState
 A combination of the status of a datapoint and its actual value. More...
 
struct  DatapointChangeValue
 A pair of the DatapointSetCommand and the Datapoint value for changing datapoint values. More...
 
struct  DatapointDescription
 Represents the information about a datapoint in the BAOS device. More...
 
class  IndicationEvent
 An Indication event. More...
 
struct  BaseResponse
 Baseclass for generic responses. More...
 
struct  BaosBaseResponse
 Baseclass for BAOS Responses. Containes the response code and optional in derived classes the payload. More...
 
struct  BaosResponse
 An actual BAOS response with payload of template parameter T. More...
 

Typedefs

using DatapointValue = wz::baos::Buffer
 An type for the DatapointValues.
 
using DatapointValues = std::map< std::uint16_t, DatapointValue >
 A map with datapoint ids as keys and DatapointValue as values.
 
using ServerItem_StatusFlagType = std::uint16_t
 Serveritem status flag type.
 
using ServerItems = std::vector< ServerItem >
 Type for a list of ServerItems.
 
using DatapointValueStates = std::map< std::uint16_t, DatapointValueState >
 
using DatapointChangeValues = std::map< std::uint16_t, DatapointChangeValue >
 
using DatapointDescriptions = std::map< std::uint16_t, DatapointDescription >
 
using DatapointDescriptionString = std::string
 Strong type for the description string.
 
using DatapointDescriptionStrings = std::map< std::uint16_t, DatapointDescriptionString >
 
using ParameterBytes = std::vector< std::uint8_t >
 Strong type for a list of parameter bytes.
 
using IndPromise = std::promise< protocol::BaseResponse >
 Strong type for a indication promise.
 
using IndFuture = std::future< protocol::BaseResponse >
 Strong type for a indication future.
 
using BaosIndQueue = wzcpp::ConcurrentDeque< IndicationEvent >
 Alias for a wzcpp::ConcurrentDeque holding indication events.
 
using ResponsePromise = std::promise< BaseResponse::SPtr >
 
using ResponseFuture = std::future< BaseResponse::SPtr >
 

Enumerations

enum class  ServerItem_StatusFlag : ServerItem_StatusFlagType {
  RUNNING = 1 ,
  LOADED = 2 ,
  TL_CONNECTED = 4 ,
  SECURE = 8
}
 Enum class representing the flags inside the status flag serveritem. More...
 
enum class  DatapointValueFilter : std::uint8_t {
  ALL ,
  VALID ,
  UPDATED
}
 Requested datapoint value can be filtered by this criteria. More...
 
enum class  DatapointSetCommand : std::uint8_t {
  NoCommand = 0x00 ,
  SetNewValue = 0x01 ,
  SendValueOnBus = 0x02 ,
  SetNewValueAndSendOnBus = 0x03 ,
  ReadNewValueViaBus ,
  ClearTransmissionState = 0x05
}
 Setting a datapoint value there are different modes supported. This enum class gives those modes names. More...
 
enum class  TransmitPriority : std::uint8_t {
  System = 0x00 ,
  High = 0x01 ,
  Alarm = 0x02 ,
  Low = 0x03
}
 The knx transmit priority.
 
enum class  TransmissionStatus : std::uint8_t {
  Idle_OK = 0x00 ,
  Idle_Error = 0x01 ,
  InProgress = 0x02 ,
  Request = 0x03
}
 Internal transmit state of the device.
 
enum class  BaosSubServiceTypes : std::uint8_t {
  MinRequest = 0x01 ,
  GetServerItemRequest = 0x01 ,
  SetServerItemRequest = 0x02 ,
  GetDatapointDescriptionRequest = 0x03 ,
  GetDescriptionStringRequest = 0x04 ,
  GetDatapointValueRequest = 0x05 ,
  SetDatapointValueRequest = 0x06 ,
  GetParameterByteRequest = 0x07 ,
  MaxRequest = 0x0C ,
  MinResponse = 0x81 ,
  GetServerItemResponse = 0x81 ,
  SetServerItemResponse = 0x82 ,
  GetDatapointDescriptionResponse = 0x83 ,
  GetDescriptionStringResponse = 0x84 ,
  GetDatapointValueResponse = 0x85 ,
  SetDatapointValueResponse = 0x86 ,
  GetParameterByteResponse = 0x87 ,
  MaxResponse = 0x8C ,
  MinIndication = 0xC1 ,
  DatapointValueIndication = 0xC1 ,
  ServerItemIndication = 0xC2 ,
  MaxIndication = 0xC2
}
 The in the baos binary protocol specified sub services and some internal ranges in them.
 
enum class  BaosResponseCode : std::uint8_t {
  Success = 0 ,
  Internal = 1 ,
  NoItemFound = 2 ,
  BufferTooSmall = 3 ,
  ItemNotWriteable = 4 ,
  ServiceNotSupported = 5 ,
  BadServiceParameter = 6 ,
  WrongDpId = 7 ,
  BadDpCmd = 8 ,
  BadDpValueLength = 9 ,
  MessageInconsistent = 10 ,
  ObjectServerIsBusy = 11
}
 These are the BaosServerErrorCodes. More...
 
enum class  DatapointSize : std::uint8_t {
  BITS_1 = 0 ,
  BITS_2 = 1 ,
  BITS_3 = 2 ,
  BITS_4 = 3 ,
  BITS_5 = 4 ,
  BITS_6 = 5 ,
  BITS_7 = 6 ,
  BYTE_1 = 7 ,
  BYTES_2 = 8 ,
  BYTES_3 = 9 ,
  BYTES_4 = 10 ,
  BYTES_6 = 11 ,
  BYTES_8 = 12 ,
  BYTES_10 = 13 ,
  BYTES_14 = 14
}
 Enum class representing the different datapoint lengths.
 
enum class  DPT : std::uint8_t {
  DPT_1 = 1 ,
  DPT_2 = 2 ,
  DPT_3 = 3 ,
  DPT_4 = 4 ,
  DPT_5 = 5 ,
  DPT_6 = 6 ,
  DPT_7 = 7 ,
  DPT_8 = 8 ,
  DPT_9 = 9 ,
  DPT_10 = 10 ,
  DPT_11 = 11 ,
  DPT_12 = 12 ,
  DPT_13 = 13 ,
  DPT_14 = 14 ,
  DPT_15 = 15 ,
  DPT_16 = 16 ,
  DPT_17 = 17 ,
  DPT_18 = 18
}
 Enumeration value for the supported datapoint types( DPTs ) More...
 
enum class  ServerItemId : std::uint8_t {
  Invalid = 0 ,
  HardwareType = 1 ,
  HardwareVersion = 2 ,
  FirmwareVersion = 3 ,
  ManufactureCodeDevice = 4 ,
  ManufactureCodeApp = 5 ,
  ApplicationId = 6 ,
  ApplicationVersion = 7 ,
  SerialNumber = 8 ,
  TimeSinceReset = 9 ,
  BusConnected = 10 ,
  MaxBufferSize = 11 ,
  LengthOfDescriptionString = 12 ,
  BaudrateItem = 13 ,
  CurrentBufferSize = 14 ,
  ProgrammingMode = 15 ,
  BinaryProtocolVersion = 16 ,
  IndicationSetting = 17 ,
  WebServicesProtocolVersion ,
  RestServiceProtocolVersion = 19 ,
  IndividualAddress = 20 ,
  MacAddress = 21 ,
  TunnellingEnabled = 22 ,
  BaosBinaryEnabled = 23 ,
  BaosWebEnabled = 24 ,
  BaosRestEnabled = 25 ,
  HttpFileEnabled = 26 ,
  SearchRequestEnabled = 27 ,
  IsStructured = 28 ,
  MaxManagementClients = 29 ,
  ConnectedManagementClients = 30 ,
  MaxTunnellingClients = 31 ,
  ConnectedTunnellingClients = 32 ,
  MaxBaosUdpClients = 33 ,
  ConnectedBaosUdpClients = 34 ,
  MaxBaosTcpClients = 35 ,
  ConnectedBaosTcpClients = 36 ,
  DeviceFriendlyName = 37 ,
  MaxDatapoints = 38 ,
  ConfiguredDatapoints = 39 ,
  MaxParameterBytes = 40 ,
  DownloadCounter = 41 ,
  IPAssignment = 42 ,
  IPAddress = 43 ,
  SubnetMask = 44 ,
  DefaultGateway = 45 ,
  TimeSinceResetUnit = 46 ,
  SystemTime = 47 ,
  SystemTimezoneOffset = 48 ,
  MenuEnabled = 49 ,
  SuspendEnabled = 50 ,
  RFDomainAddress = 51 ,
  StatusFlagsSupported = 52 ,
  StatusFlags = 53
}
 An enum class to provide conveniant names to the serveritem ids. More...
 
enum class  TimeSinceResetUnit {
  milliseconds ,
  seconds ,
  minutes ,
  hours
}
 The ServerItemId::TimeSinceResetUnit current unit for TimeSinceReset. This type gives those units a name.
 
enum class  IpAssigmentMethod {
  manual = 0x1 ,
  bootp = 0x2 ,
  dhcp = 0x4 ,
  autoIp = 0x8
}
 An Ip device may have different methods for ip assigment. More...
 

Functions

BAOSLIB_EXPORT std::string transmitPriorityToString (TransmitPriority transmitPrio)
 Convert the enum value to a human readable string.
 
BAOSLIB_EXPORT std::string transmissionStatusToString (TransmissionStatus transmissionStatus)
 Convert the enum value to a human readable string.
 
BAOSLIB_EXPORT std::string getBaosSubServiceTypeDescription (BaosSubServiceTypes subServiceType)
 Convert the enum value to a human readable string.
 
std::string baosResponseCodeToString (BaosResponseCode code)
 Convert the enum value to a human readable string.
 
BAOSLIB_EXPORT std::string dpSizeToString (DatapointSize dpSize)
 Convert the enum value to a human readable string.
 
BAOSLIB_EXPORT std::uint8_t dpSizeInBytes (DatapointSize dpSize)
 Convert the enum value to a intergral size in bytes.
 
BAOSLIB_EXPORT std::string dptToString (DPT dpt)
 Convert the enum value to a human readable string.
 
BAOSLIB_EXPORT std::string serverItemIdToString (ServerItemId sid)
 Convert the enum value to a human readable string.
 
BAOSLIB_EXPORT std::string timeSinceResetUnitToString (TimeSinceResetUnit unit)
 Convert the enum value to a human readable string.
 
std::string toString (IndicationEvent::Type typ)
 Convert IndicationEvent into human readable string.
 
template<class T >
waitAndHandleBaosResponse (ResponseFuture &&fut)
 Helper function to wait for a ResponseFuture to become ready and handle it. More...
 
void waitAndHandleEmptyBaosResponse (ResponseFuture &&fut)
 Handle responses with no payload.
 

Variables

Protocol defines and positions
constexpr std::uint8_t BAOS_MAIN_SERVICE = 0xF0
 The main service to identify a BAOS telegram by.
 
constexpr std::size_t POS_MAIN_SERVICE = 0
 The 0 based position of the main service byte.
 
constexpr std::size_t POS_SUB_SERVICE = 1
 The 0 based position of the sub service byte.
 
constexpr std::size_t POS_START
 The 0 based position of the start element (startitem, start datapoint id etc.) More...
 
constexpr std::size_t POS_NUMBER_OF_ELEMENTS = 4
 The 0 based position of the number of elements in the packet.
 
constexpr std::size_t POS_ERRORCODE = 6
 The 0 bases position of the errorcode if available.
 
constexpr std::size_t POS_PAYLOAD_BEGIN = 6
 The 0 based position of the payload in the packet.
 

Detailed Description

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

Typedef Documentation

◆ DatapointValueStates

using DatapointValueStates = std::map<std::uint16_t, DatapointValueState>

A map between the datapoint id as key and the DatapointValueState as value

Examples
DatapointValueIndication.cpp, and GetDatapointValue.cpp.

◆ DatapointChangeValues

using DatapointChangeValues = std::map<std::uint16_t, DatapointChangeValue>

A map between the datapoint id as key and the DatapointChangeValue as value

Examples
SetDatapointValue.cpp.

◆ DatapointDescriptions

using DatapointDescriptions = std::map<std::uint16_t, DatapointDescription>

A map between the datapoint id as key and the DatapointDescription structs as value

Examples
GetDatapointDescription.cpp.

◆ DatapointDescriptionStrings

using DatapointDescriptionStrings = std::map<std::uint16_t, DatapointDescriptionString>

A map between the datapoint id as key and the DatapointDescriptionStrings as value

Examples
GetDatapointDescriptionString.cpp.

◆ ResponsePromise

using ResponsePromise = std::promise<BaseResponse::SPtr>

Strong type for a promise containing a shared pointer to a BaseResponse or any from it derived class

◆ ResponseFuture

using ResponseFuture = std::future<BaseResponse::SPtr>

Strong type for a future containing a shared pointer to a BaseResponse or any from it derived class

Enumeration Type Documentation

◆ ServerItem_StatusFlag

Enum class representing the flags inside the status flag serveritem.

Enumerator
RUNNING 

The run state of the application.

LOADED 

The load state of the applcation.

TL_CONNECTED 

If the transport layer is connected or not.

SECURE 

If the device has secure mode enabled.

◆ DatapointValueFilter

enum DatapointValueFilter : std::uint8_t
strong

Requested datapoint value can be filtered by this criteria.

Enumerator
ALL 

No filter, all datapoints.

VALID 

Only the valid datapoints. A datapoint is considered valid if the BAOS device has received a value for it

UPDATED 

Retrieve the datapoints that have changed since the last request. If indication sending is enabled NO datapoint get this state, since the indication clears the updated state

◆ DatapointSetCommand

enum DatapointSetCommand : std::uint8_t
strong

Setting a datapoint value there are different modes supported. This enum class gives those modes names.

Enumerator
NoCommand 

Do nothing, more or less a placeholder.

SetNewValue 

Set the new value inside the baos device object server*‍/.

SendValueOnBus 

Send the new value to bus but does not set it internaly.

SetNewValueAndSendOnBus 

The default: Set the new value in the object server and send it to the bus.

ReadNewValueViaBus 

Issue an group value read on the bus to get the current value of the underlying group object.

ClearTransmissionState 

Clear the device internal transmission state of the datapoints.

◆ BaosResponseCode

enum BaosResponseCode : std::uint8_t
strong

These are the BaosServerErrorCodes.

Enumerator
Success 

No error.

Internal 

Internal error.

NoItemFound 

No item found.

BufferTooSmall 

Buffer is too small.

ItemNotWriteable 

Item is not writable.

ServiceNotSupported 

Service is not supported.

BadServiceParameter 

Bad service parameter.

WrongDpId 

Wrong datapoint ID.

BadDpCmd 

Bad datapoint command.

BadDpValueLength 

Bad length of datapoint value.

MessageInconsistent 

Message inconsistent.

ObjectServerIsBusy 

Object server is busy.

◆ DPT

enum DPT : std::uint8_t
strong

Enumeration value for the supported datapoint types( DPTs )

Enumerator
DPT_1 

(1 Bit, Boolean)

DPT_2 

(2 Bit, Control)

DPT_3 

(4 Bit, Dimming, Blinds)

DPT_4 

(8 Bit, Character Set)

DPT_5 

(8 Bit, Unsigned Value)

DPT_6 

(8 Bit, Signed Value)

DPT_7 

(2 std::uint8_t, Unsigned Value)

DPT_8 

(2 std::uint8_t, Signed Value)

DPT_9 

(2 std::uint8_t, Float Value)

DPT_10 

(3 std::uint8_t, Time)

DPT_11 

(3 std::uint8_t, Date)

DPT_12 

(4 std::uint8_t, Unsigned Value)

DPT_13 

(4 std::uint8_t, Signed Value)

DPT_14 

(4 std::uint8_t, Float Value)

DPT_15 

(4 std::uint8_t, Access)

DPT_16 

(14 std::uint8_t, String)

DPT_17 

(1 std::uint8_t, Scene Number)

DPT_18 

(1 std::uint8_t, Scene Control)

Examples
09_BaosView.cpp.

◆ ServerItemId

enum ServerItemId : std::uint8_t
strong

An enum class to provide conveniant names to the serveritem ids.

Enumerator
Invalid 

Mark item as invalid.

HardwareType 

(Read Only; 6 bytes)

HardwareVersion 

(Read Only; 1 byte)

FirmwareVersion 

(Read Only; 1 byte)

ManufactureCodeDevice 

(Read Only; 2 bytes)

ManufactureCodeApp 

(Read Only; 2 bytes)

ApplicationId 

(Read Only; 2 bytes)

ApplicationVersion 

(Read Only; 1 bytes)

SerialNumber 

(Read Only; 6 bytes)

TimeSinceReset 

(Read Only; 4 bytes)

BusConnected 

(Read Only; 1 byte)

MaxBufferSize 

(Read/Write; 2 bytes)

LengthOfDescriptionString 

(Read Only; 2 bytes)

BaudrateItem 

(Read/Write; 1 byte)

CurrentBufferSize 

(Read Only; 2 bytes)

ProgrammingMode 

(Read/Write; 1 bytes)

BinaryProtocolVersion 

Version of the ObjectServer binary protocol (Read Only; 1 byte; from V2.0)

IndicationSetting 

Indicates whether indications are sent (Read/Write; 1 byte; from V2.0)

WebServicesProtocolVersion 

Version of the ObjectServer web services protocol (Read Only; 1 byte; from V2.0)

RestServiceProtocolVersion 

(Read Only; 1 byte; from V2.1)

IndividualAddress 

(Read / Write; 2 byte; from V2.1)

MacAddress 

(Read Only; 6 byte; from V2.1)

TunnellingEnabled 

(Read / Write; 1 byte; from V2.1)

BaosBinaryEnabled 

(Read / Write; 1 byte; from V2.1)

BaosWebEnabled 

(Read / Write; 1 byte; from V2.1)

BaosRestEnabled 

(Read / Write; 1 byte; from V2.1)

HttpFileEnabled 

(Read / Write; 1 byte; from V2.1)

SearchRequestEnabled 

(Read / Write; 1 byte; from V2.1)

IsStructured 

(Read Only; 1 byte; from V2.1)

MaxManagementClients 

(Read Only; 1 byte; from V2.1)

ConnectedManagementClients 

(Read Only; 1 byte; from V2.1)

MaxTunnellingClients 

(Read Only; 1 byte; from V2.1)

ConnectedTunnellingClients 

(Read Only; 1 byte; from V2.1)

MaxBaosUdpClients 

(Read Only; 1 byte; from V2.1)

ConnectedBaosUdpClients 

(Read Only; 1 byte; from V2.1)

MaxBaosTcpClients 

(Read Only; 1 byte; from V2.1)

ConnectedBaosTcpClients 

(Read Read / Write Only; 1 byte; from V2.1)

DeviceFriendlyName 

(Read / Write; 30 bytes; from V2.1)

MaxDatapoints 

(Read Only; 2 bytes; from V2.1)

ConfiguredDatapoints 

(Read Only; 2 bytes; from V2.1)

MaxParameterBytes 

(Read Only; 2 bytes; from V2.1)

DownloadCounter 

(Read Only; 2 bytes; from V2.1)

IPAssignment 

(Read / Write; 1 byte; from V2.1)

IPAddress 

(Read / Write; 4 bytes; from V2.1)

SubnetMask 

(Read / Write; 4 bytes; from V2.1)

DefaultGateway 

(Read / Write; 4 bytes; from V2.1)

TimeSinceResetUnit 

(Read / Write; 1 byte; from V2.1)

SystemTime 

(Read / Write; variable length; from V2.1)

SystemTimezoneOffset 

(Read / Write; 1 byte (signed); from V2.1)

MenuEnabled 

(Read / Write; 1 byte; from V2.1)

SuspendEnabled 

(Read / Write; 1 byte; from 2.1)

RFDomainAddress 

(Read / Write; 6 bytes;)

StatusFlagsSupported 

(Read Only; 2 bytes; from V2.1)

StatusFlags 

(Read Only; 2 bytes; from V2.1)

◆ IpAssigmentMethod

enum IpAssigmentMethod
strong

An Ip device may have different methods for ip assigment.

Enumerator
manual 

The ip address, subnet mask etc. are explicitly set manualy.

bootp 

Boot mode with network boot vi bootp.

dhcp 

The ip address is requested from a DHCP server.

autoIp 

Configure its own ip address automatically.

Function Documentation

◆ waitAndHandleBaosResponse()

T wz::baos::protocol::waitAndHandleBaosResponse ( ResponseFuture &&  fut)

Helper function to wait for a ResponseFuture to become ready and handle it.

Template Parameters
TThe Type of the payload in the response
Parameters
futAn rvalue reference of the response future to handle
Returns
T Returns the payload of type T

Variable Documentation

◆ POS_START

constexpr std::size_t POS_START
constexpr
Initial value:
=
2

The 0 based position of the start element (startitem, start datapoint id etc.)