BAOS SDK v2  1.2.1
An SDK providing access to IP-BAOS devices through BAOS binary protocol version 2.x
Defines.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2002-2026 WEINZIERL ENGINEERING GmbH
3 // All rights reserved.
4 //
5 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6 // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7 // FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
8 // SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY,
9 // WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
10 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE
11 //
12 
13 #ifndef __BAOSLIB_DEFINES_H__
14 #define __BAOSLIB_DEFINES_H__
15 
16 #include "baos/config.h"
17 
19 #include <cassert>
20 #include <map>
21 #include <sstream>
22 #include <string>
23 #include <utility>
25 
33 {
36  std::map<std::uint16_t, DatapointValue>;
37 
38 using ServerItem_StatusFlagType = std::uint16_t;
39 
42 {
43  RUNNING = 1,
44  LOADED = 2,
45  TL_CONNECTED = 4,
46  SECURE = 8
47 };
48 
50 enum class DatapointValueFilter : std::uint8_t
51 {
52  ALL,
53  VALID,
55  UPDATED
57 };
58 
60 enum class DatapointSetCommand : std::uint8_t
61 {
62  NoCommand = 0x00,
63  SetNewValue = 0x01,
64  SendValueOnBus = 0x02,
67  0x04,
69 };
70 
72 enum class TransmitPriority : std::uint8_t
73 {
74  System = 0x00,
75  High = 0x01,
76  Alarm = 0x02,
77  Low = 0x03
78 };
79 
80 BAOSLIB_EXPORT std::string transmitPriorityToString(
81  TransmitPriority transmitPrio);
82 
84 enum class TransmissionStatus : std::uint8_t
85 {
86  Idle_OK = 0x00,
87  Idle_Error = 0x01,
88  InProgress = 0x02,
89  Request = 0x03
90 };
91 
92 BAOSLIB_EXPORT std::string transmissionStatusToString(
93  TransmissionStatus transmissionStatus);
94 
96 enum class BaosSubServiceTypes : std::uint8_t
97 {
98  MinRequest = 0x01,
99  GetServerItemRequest = 0x01,
100  SetServerItemRequest = 0x02,
101  GetDatapointDescriptionRequest = 0x03,
102  GetDescriptionStringRequest = 0x04,
103  GetDatapointValueRequest = 0x05,
104  SetDatapointValueRequest = 0x06,
105  GetParameterByteRequest = 0x07,
106  MaxRequest = 0x0C,
107 
108  MinResponse = 0x81,
109  GetServerItemResponse = 0x81,
110  SetServerItemResponse = 0x82,
111  GetDatapointDescriptionResponse = 0x83,
112  GetDescriptionStringResponse = 0x84,
113  GetDatapointValueResponse = 0x85,
114  SetDatapointValueResponse = 0x86,
115  GetParameterByteResponse = 0x87,
116  MaxResponse = 0x8C,
117 
118  MinIndication = 0xC1,
119  DatapointValueIndication = 0xC1,
120  ServerItemIndication = 0xC2,
121  MaxIndication = 0xC2,
122 };
123 
124 BAOSLIB_EXPORT std::string getBaosSubServiceTypeDescription(
125  BaosSubServiceTypes subServiceType);
126 
128 enum class BaosResponseCode : std::uint8_t
129 {
130  Success = 0,
131  Internal = 1,
132  NoItemFound = 2,
133  BufferTooSmall = 3,
134  ItemNotWriteable = 4,
135  ServiceNotSupported = 5,
136  BadServiceParameter = 6,
137  WrongDpId = 7,
138  BadDpCmd = 8,
139  BadDpValueLength = 9,
140  MessageInconsistent = 10,
141  ObjectServerIsBusy = 11,
142 };
143 
144 BAOSLIB_EXPORT std::string baosResponseCodeToString(BaosResponseCode code);
145 
147 enum class DatapointSize : std::uint8_t
148 {
149  BITS_1 = 0,
150  BITS_2 = 1,
151  BITS_3 = 2,
152  BITS_4 = 3,
153  BITS_5 = 4,
154  BITS_6 = 5,
155  BITS_7 = 6,
156  BYTE_1 = 7,
157  BYTES_2 = 8,
158  BYTES_3 = 9,
159  BYTES_4 = 10,
160  BYTES_6 = 11,
161  BYTES_8 = 12,
162  BYTES_10 = 13,
163  BYTES_14 = 14
164 };
165 
166 BAOSLIB_EXPORT std::string dpSizeToString(DatapointSize dpSize);
167 
168 BAOSLIB_EXPORT std::uint8_t dpSizeInBytes(
169  DatapointSize dpSize);
170 
172 enum class DPT : std::uint8_t
173 {
174  DPT_1 = 1,
175  DPT_2 = 2,
176  DPT_3 = 3,
177  DPT_4 = 4,
178  DPT_5 = 5,
179  DPT_6 = 6,
180  DPT_7 = 7,
181  DPT_8 = 8,
182  DPT_9 = 9,
183  DPT_10 = 10,
184  DPT_11 = 11,
185  DPT_12 = 12,
186  DPT_13 = 13,
187  DPT_14 = 14,
188  DPT_15 = 15,
189  DPT_16 = 16,
190  DPT_17 = 17,
191  DPT_18 = 18,
192 };
193 
194 BAOSLIB_EXPORT std::string dptToString(DPT dpt);
195 
196 
198 enum class ServerItemId : std::uint8_t
199 {
200  Invalid = 0,
201  HardwareType = 1,
202  HardwareVersion = 2,
203  FirmwareVersion = 3,
205  ManufactureCodeApp = 5,
206  ApplicationId = 6,
207  ApplicationVersion = 7,
208  SerialNumber = 8,
209  TimeSinceReset = 9,
210  BusConnected = 10,
211  MaxBufferSize = 11,
213  BaudrateItem = 13,
214  CurrentBufferSize = 14,
215  ProgrammingMode = 15,
216  BinaryProtocolVersion = 16,
217  IndicationSetting = 17,
219  18,
221  IndividualAddress = 20,
222  MacAddress = 21,
223  TunnellingEnabled = 22,
224  BaosBinaryEnabled = 23,
225  BaosWebEnabled = 24,
226  BaosRestEnabled = 25,
227  HttpFileEnabled = 26,
228  SearchRequestEnabled = 27,
229  IsStructured = 28,
230  MaxManagementClients = 29,
232  MaxTunnellingClients = 31,
234  MaxBaosUdpClients = 33,
236  MaxBaosTcpClients = 35,
238  DeviceFriendlyName = 37,
239  MaxDatapoints = 38,
240  ConfiguredDatapoints = 39,
241  MaxParameterBytes = 40,
242  DownloadCounter = 41,
243  IPAssignment = 42,
244  IPAddress = 43,
245  SubnetMask = 44,
246  DefaultGateway = 45,
247  TimeSinceResetUnit = 46,
248  SystemTime = 47,
249  SystemTimezoneOffset = 48,
250  MenuEnabled = 49,
251  SuspendEnabled = 50,
252  RFDomainAddress = 51,
253  StatusFlagsSupported = 52,
254  StatusFlags = 53
255 };
256 
257 BAOSLIB_EXPORT std::string serverItemIdToString(
258  ServerItemId sid);
259 
261 class BAOSLIB_EXPORT StatusFlags
262 {
263 public:
265  StatusFlags(const ServerItem_StatusFlagType val) : value_{val} {};
267  StatusFlags(const Buffer& data)
268  {
269  assert(data.size() >= 2);
270  value_ = data[0] << 8 | data[1];
271  }
272 
281  StatusFlags(bool running, bool loaded, bool tl_connected, bool secure)
282  {
283  value_ = 0x00;
284  if (running)
285  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::RUNNING);
286  if (loaded)
287  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::LOADED);
288  if (tl_connected)
289  value_ |=
290  static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::TL_CONNECTED);
291  if (secure)
292  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::SECURE);
293  }
294 
296  bool isRunning() const
297  {
298  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::RUNNING);
299  }
300 
302  bool isLoaded() const
303  {
304  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::LOADED);
305  }
306 
308  bool isTLConnected() const
309  {
310  return value_ &
311  static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::TL_CONNECTED);
312  }
313 
315  bool isSecure() const
316  {
317  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::SECURE);
318  }
319 
321  operator ServerItem_StatusFlagType() const
322  {
323  return value_;
324  }
325 
326 private:
328 };
329 
330 
332 class BAOSLIB_EXPORT StatusFlagsSupported
333 {
334 public:
336  StatusFlagsSupported(const ServerItem_StatusFlagType val) : value_{val} {};
337 
340  {
341  assert(data.size() >= 2);
342  value_ = data[0] << 8 | data[1];
343  }
344 
353  StatusFlagsSupported(bool running, bool loaded, bool tl_connected, bool secure)
354  {
355  value_ = 0x00;
356  if (running)
357  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::RUNNING);
358  if (loaded)
359  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::LOADED);
360  if (tl_connected)
361  value_ |=
362  static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::TL_CONNECTED);
363  if (secure)
364  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::SECURE);
365  }
366 
368  bool hasRunning() const
369  {
370  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::RUNNING);
371  }
372 
374  bool hasLoaded() const
375  {
376  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::LOADED);
377  }
378 
380  bool hasTLConnected() const
381  {
382  return value_ &
383  static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::TL_CONNECTED);
384  }
385 
387  bool hasSecure() const
388  {
389  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::SECURE);
390  }
391 
393  operator ServerItem_StatusFlagType() const
394  {
395  return value_;
396  }
397 
398 private:
400 };
401 
403 struct BAOSLIB_EXPORT ServerItem
404 {
405  ServerItem() = default; // The default constructor
406 
414  ServerItem(ServerItemId id_, std::uint8_t length_, Buffer&& data_)
415  : id{id_},
416  length{length_},
417  data{std::move(data_)}
418  {
419  }
420 
428  ServerItem(ServerItemId id_, std::uint8_t length_, const Buffer& data_)
429  : id{id_},
430  length{length_},
431  data{data_}
432  {
433  }
434 
436  std::uint8_t length{0};
438 };
439 
440 using ServerItems = std::vector<ServerItem>;
441 
443 struct BAOSLIB_EXPORT DatapointConfigFlags
444 {
446  : transmitPriority{0},
447  communication{0},
448  readFromBus{0},
449  writeFromBus{0},
450  readOnInit{0},
451  transmitToBus{0},
452  updateResponse{0}
453  {
454  }
455 
457  DatapointConfigFlags(std::uint8_t&& value)
458  {
459  updateResponse = value >> 7;
460  transmitToBus = value >> 6 & 0x01;
461  readOnInit = value >> 5 & 0x01;
462  writeFromBus = value >> 4 & 0x01;
463  readFromBus = value >> 3 & 0x01;
464  communication = value >> 2 & 0x01;
465  transmitPriority = value & 0x03;
466  }
467 
469  DatapointConfigFlags& operator=(std::uint8_t& value)
470  {
471  updateResponse = value >> 7;
472  transmitToBus = value >> 6 & 0x01;
473  readOnInit = value >> 5 & 0x01;
474  writeFromBus = value >> 4 & 0x01;
475  readFromBus = value >> 3 & 0x01;
476  communication = value >> 2 & 0x01;
477  transmitPriority = value & 0x03;
478  return *this;
479  }
480 
482  operator std::uint8_t() const
483  {
484  std::uint8_t value{0};
485  value = updateResponse << 7 | transmitToBus << 6 | readOnInit << 5 | writeFromBus << 4 | readFromBus << 3 |
486  communication << 2 | transmitPriority;
487  return value;
488  }
489 
492  std::string toString() const
493  {
494  std::ostringstream oss;
495  std::string flags{"______"};
496  if (communication) flags[0] = 'C';
497  if (readFromBus) flags[1] = 'R';
498  if (writeFromBus) flags[2] = 'W';
499  if (transmitToBus) flags[3] = 'T';
500  if (updateResponse) flags[4] = 'U';
501  if (readOnInit) flags[5] = 'I';
502 
503  oss << transmitPriorityToString(static_cast<TransmitPriority>(transmitPriority)) << " " << flags;
504  return oss.str();
505  }
506 
507  std::uint8_t transmitPriority : 2,
515 };
516 
518 struct BAOSLIB_EXPORT DatapointStatus
519 {
521  : transmitStatus{0},
522  readRequest{0},
523  updated{0},
524  valid{0},
525  reserved_1{0},
526  reserved_2{0},
527  reserved_3{0}
528  {
529  }
530 
532  DatapointStatus(std::uint8_t&& value)
533  {
534  reserved_3 = value >> 7;
535  reserved_2 = value >> 6 & 0x01;
536  reserved_1 = value >> 5 & 0x01;
537  valid = value >> 4 & 0x01;
538  updated = value >> 3 & 0x01;
539  readRequest = value >> 2 & 0x01;
540  transmitStatus = value & 0x03;
541  }
542 
544  DatapointStatus& operator=(std::uint8_t& value)
545  {
546  reserved_3 = value >> 7;
547  reserved_2 = value >> 6 & 0x01;
548  reserved_1 = value >> 5 & 0x01;
549  valid = value >> 4 & 0x01;
550  updated = value >> 3 & 0x01;
551  readRequest = value >> 2 & 0x01;
552  transmitStatus = value & 0x03;
553  return *this;
554  }
555 
557  operator std::uint8_t() const
558  {
559  std::uint8_t value{0};
560  value = reserved_3 << 7 | reserved_2 << 6 | reserved_1 << 5 | valid << 4 | updated << 3 | readRequest << 2 |
561  transmitStatus;
562  return value;
563  }
564 
573  std::string toString() const
574  {
575  std::ostringstream oss;
576  valid ? oss << "V" : oss << "_";
577  updated ? oss << "U" : oss << "_";
578  readRequest ? oss << "R" : oss << "W";
579  oss << " ";
580  oss << transmissionStatusToString(static_cast<TransmissionStatus>(transmitStatus));
581  return oss.str();
582  }
583 
585 
588  std::uint8_t transmitStatus : 2,
590  updated : 1,
592  valid : 1,
597 };
598 
600 struct BAOSLIB_EXPORT DatapointValueState
601 {
604 };
605 
606 using DatapointValueStates = std::map<std::uint16_t, DatapointValueState>;
608 
610 struct BAOSLIB_EXPORT DatapointChangeValue
611 {
614 };
615 
616 using DatapointChangeValues = std::map<std::uint16_t, DatapointChangeValue>;
618 
620 struct BAOSLIB_EXPORT DatapointDescription
621 {
625 };
626 
628  std::map<std::uint16_t, DatapointDescription>;
630 using DatapointDescriptionString = std::string;
632  std::map<std::uint16_t, DatapointDescriptionString>;
634 
635 using ParameterBytes = std::vector<std::uint8_t>;
636 
639 {
640  milliseconds,
641  seconds,
642  minutes,
643  hours
644 };
645 
646 BAOSLIB_EXPORT std::string timeSinceResetUnitToString(
647  TimeSinceResetUnit unit);
648 
651 {
652  manual = 0x1,
653  bootp = 0x2,
654  dhcp = 0x4,
655  autoIp = 0x8
656 };
657 
658 
663 constexpr std::uint8_t BAOS_MAIN_SERVICE = 0xF0;
664 constexpr std::size_t POS_MAIN_SERVICE = 0;
665 constexpr std::size_t POS_SUB_SERVICE = 1;
666 constexpr std::size_t POS_START =
667  2;
668 constexpr std::size_t POS_NUMBER_OF_ELEMENTS = 4;
669 constexpr std::size_t POS_ERRORCODE = 6;
670 constexpr std::size_t POS_PAYLOAD_BEGIN = 6;
672 
673 } // namespace wz::baos::protocol
674 
675 #endif
Represents which status flags are supported by the device, serveritem 52.
Definition: Defines.h:333
bool hasRunning() const
Is the running flag supported.
Definition: Defines.h:368
StatusFlagsSupported(const Buffer &data)
Construct from an array of bytes.
Definition: Defines.h:339
bool hasSecure() const
Is the secure mode flag supported.
Definition: Defines.h:387
bool hasLoaded() const
Is the loaded flag supported.
Definition: Defines.h:374
bool hasTLConnected() const
Is the transport layer connected flag supported.
Definition: Defines.h:380
StatusFlagsSupported(bool running, bool loaded, bool tl_connected, bool secure)
Construct a new StatusFlagsSupported object from integral values.
Definition: Defines.h:353
StatusFlagsSupported(const ServerItem_StatusFlagType val)
< Construct from a existing ServerItem_StatusFlagType value
Definition: Defines.h:336
This structure represents the status flags provided by some BAOS devices server item ServerItemId::St...
Definition: Defines.h:262
StatusFlags(bool running, bool loaded, bool tl_connected, bool secure)
Construct a new Status Flags object.
Definition: Defines.h:281
bool isSecure() const
Returns if the device is on secure mode.
Definition: Defines.h:315
StatusFlags(const ServerItem_StatusFlagType val)
Construct from a existing ServerItem_StatusFlagType value.
Definition: Defines.h:265
bool isTLConnected() const
Returns if the transport layer is connected.
Definition: Defines.h:308
bool isRunning() const
Return the value of the running element as boolean.
Definition: Defines.h:296
StatusFlags(const Buffer &data)
Construct from an array of bytes.
Definition: Defines.h:267
bool isLoaded() const
Return if the ETS applicatiopn is loaded or not.
Definition: Defines.h:302
Global types and configuration for the whole SDK.
Groups BAOS binary protocol specific types , defines and classes for Indications, Responses etc.
Definition: Defines.h:33
constexpr std::size_t POS_ERRORCODE
The 0 bases position of the errorcode if available.
Definition: Defines.h:669
IpAssigmentMethod
An Ip device may have different methods for ip assigment.
Definition: Defines.h:651
@ manual
The ip address, subnet mask etc. are explicitly set manualy.
@ autoIp
Configure its own ip address automatically.
@ bootp
Boot mode with network boot vi bootp.
@ dhcp
The ip address is requested from a DHCP server.
BaosResponseCode
These are the BaosServerErrorCodes.
Definition: Defines.h:129
@ ItemNotWriteable
Item is not writable.
@ BadDpValueLength
Bad length of datapoint value.
@ ServiceNotSupported
Service is not supported.
@ ObjectServerIsBusy
Object server is busy.
@ MessageInconsistent
Message inconsistent.
@ BadServiceParameter
Bad service parameter.
@ BufferTooSmall
Buffer is too small.
@ BadDpCmd
Bad datapoint command.
std::map< std::uint16_t, DatapointValue > DatapointValues
A map with datapoint ids as keys and DatapointValue as values.
Definition: Defines.h:36
ServerItem_StatusFlag
Enum class representing the flags inside the status flag serveritem.
Definition: Defines.h:42
@ 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.
constexpr std::uint8_t BAOS_MAIN_SERVICE
The main service to identify a BAOS telegram by.
Definition: Defines.h:663
std::string DatapointDescriptionString
Strong type for the description string.
Definition: Defines.h:630
BAOSLIB_EXPORT std::string baosResponseCodeToString(BaosResponseCode code)
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.
std::map< std::uint16_t, DatapointChangeValue > DatapointChangeValues
Definition: Defines.h:617
ServerItemId
An enum class to provide conveniant names to the serveritem ids.
Definition: Defines.h:199
@ MaxTunnellingClients
(Read Only; 1 byte; from V2.1)
@ ProgrammingMode
(Read/Write; 1 bytes)
@ ConnectedBaosUdpClients
(Read Only; 1 byte; from V2.1)
@ BinaryProtocolVersion
Version of the ObjectServer binary protocol (Read Only; 1 byte; from V2.0)
@ MaxBaosUdpClients
(Read Only; 1 byte; from V2.1)
@ ConnectedTunnellingClients
(Read Only; 1 byte; from V2.1)
@ SearchRequestEnabled
(Read / Write; 1 byte; from V2.1)
@ MenuEnabled
(Read / Write; 1 byte; from V2.1)
@ DownloadCounter
(Read Only; 2 bytes; from V2.1)
@ ManufactureCodeDevice
(Read Only; 2 bytes)
@ FirmwareVersion
(Read Only; 1 byte)
@ LengthOfDescriptionString
(Read Only; 2 bytes)
@ RFDomainAddress
(Read / Write; 6 bytes;)
@ IsStructured
(Read Only; 1 byte; from V2.1)
@ SystemTimezoneOffset
(Read / Write; 1 byte (signed); from V2.1)
@ MaxBaosTcpClients
(Read Only; 1 byte; from V2.1)
@ SystemTime
(Read / Write; variable length; from V2.1)
@ Invalid
Mark item as invalid.
@ TunnellingEnabled
(Read / Write; 1 byte; from V2.1)
@ MaxManagementClients
(Read Only; 1 byte; from V2.1)
@ WebServicesProtocolVersion
Version of the ObjectServer web services protocol (Read Only; 1 byte; from V2.0)
@ ApplicationVersion
(Read Only; 1 bytes)
@ MaxParameterBytes
(Read Only; 2 bytes; from V2.1)
@ ConnectedBaosTcpClients
(Read Read / Write Only; 1 byte; from V2.1)
@ IndicationSetting
Indicates whether indications are sent (Read/Write; 1 byte; from V2.0)
@ MaxBufferSize
(Read/Write; 2 bytes)
@ RestServiceProtocolVersion
(Read Only; 1 byte; from V2.1)
@ IPAddress
(Read / Write; 4 bytes; from V2.1)
@ ConnectedManagementClients
(Read Only; 1 byte; from V2.1)
@ BaudrateItem
(Read/Write; 1 byte)
@ ManufactureCodeApp
(Read Only; 2 bytes)
@ DeviceFriendlyName
(Read / Write; 30 bytes; from V2.1)
@ BaosWebEnabled
(Read / Write; 1 byte; from V2.1)
@ TimeSinceReset
(Read Only; 4 bytes)
@ ConfiguredDatapoints
(Read Only; 2 bytes; from V2.1)
@ ApplicationId
(Read Only; 2 bytes)
@ SerialNumber
(Read Only; 6 bytes)
@ MacAddress
(Read Only; 6 byte; from V2.1)
@ SubnetMask
(Read / Write; 4 bytes; from V2.1)
@ DefaultGateway
(Read / Write; 4 bytes; from V2.1)
@ BaosRestEnabled
(Read / Write; 1 byte; from V2.1)
@ IndividualAddress
(Read / Write; 2 byte; from V2.1)
@ HardwareVersion
(Read Only; 1 byte)
@ BusConnected
(Read Only; 1 byte)
@ MaxDatapoints
(Read Only; 2 bytes; from V2.1)
@ SuspendEnabled
(Read / Write; 1 byte; from 2.1)
@ IPAssignment
(Read / Write; 1 byte; from V2.1)
@ HttpFileEnabled
(Read / Write; 1 byte; from V2.1)
@ HardwareType
(Read Only; 6 bytes)
@ CurrentBufferSize
(Read Only; 2 bytes)
@ BaosBinaryEnabled
(Read / Write; 1 byte; from V2.1)
constexpr std::size_t POS_MAIN_SERVICE
The 0 based position of the main service byte.
Definition: Defines.h:664
constexpr std::size_t POS_START
The 0 based position of the start element (startitem, start datapoint id etc.)
Definition: Defines.h:666
std::map< std::uint16_t, DatapointValueState > DatapointValueStates
Definition: Defines.h:607
DatapointSetCommand
Setting a datapoint value there are different modes supported. This enum class gives those modes name...
Definition: Defines.h:61
@ SetNewValue
Set the new value inside the baos device object server*‍/.
@ NoCommand
Do nothing, more or less a placeholder.
@ ClearTransmissionState
Clear the device internal transmission state of the datapoints.
@ 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.
BAOSLIB_EXPORT std::string dpSizeToString(DatapointSize dpSize)
Convert the enum value to a human readable string.
constexpr std::size_t POS_PAYLOAD_BEGIN
The 0 based position of the payload in the packet.
Definition: Defines.h:670
BAOSLIB_EXPORT std::string transmitPriorityToString(TransmitPriority transmitPrio)
Convert the enum value to a human readable string.
BAOSLIB_EXPORT std::string dptToString(DPT dpt)
Convert the enum value to a human readable string.
std::vector< std::uint8_t > ParameterBytes
Strong type for a list of parameter bytes.
Definition: Defines.h:635
DPT
Enumeration value for the supported datapoint types( DPTs )
Definition: Defines.h:173
@ DPT_2
(2 Bit, Control)
@ DPT_16
(14 std::uint8_t, String)
@ DPT_18
(1 std::uint8_t, Scene Control)
@ DPT_1
(1 Bit, Boolean)
@ DPT_11
(3 std::uint8_t, Date)
@ DPT_10
(3 std::uint8_t, Time)
@ DPT_8
(2 std::uint8_t, Signed Value)
@ DPT_5
(8 Bit, Unsigned Value)
@ DPT_6
(8 Bit, Signed Value)
@ DPT_14
(4 std::uint8_t, Float Value)
@ DPT_3
(4 Bit, Dimming, Blinds)
@ DPT_9
(2 std::uint8_t, Float Value)
@ DPT_12
(4 std::uint8_t, Unsigned Value)
@ DPT_7
(2 std::uint8_t, Unsigned Value)
@ DPT_15
(4 std::uint8_t, Access)
@ DPT_4
(8 Bit, Character Set)
@ DPT_17
(1 std::uint8_t, Scene Number)
@ DPT_13
(4 std::uint8_t, Signed Value)
BAOSLIB_EXPORT std::string getBaosSubServiceTypeDescription(BaosSubServiceTypes subServiceType)
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 timeSinceResetUnitToString(TimeSinceResetUnit unit)
Convert the enum value to a human readable string.
TransmitPriority
The knx transmit priority.
Definition: Defines.h:73
DatapointValueFilter
Requested datapoint value can be filtered by this criteria.
Definition: Defines.h:51
@ ALL
No filter, all datapoints.
TransmissionStatus
Internal transmit state of the device.
Definition: Defines.h:85
constexpr std::size_t POS_NUMBER_OF_ELEMENTS
The 0 based position of the number of elements in the packet.
Definition: Defines.h:668
TimeSinceResetUnit
The ServerItemId::TimeSinceResetUnit current unit for TimeSinceReset. This type gives those units a n...
Definition: Defines.h:639
wz::baos::Buffer DatapointValue
An type for the DatapointValues.
Definition: Defines.h:34
std::map< std::uint16_t, DatapointDescription > DatapointDescriptions
Definition: Defines.h:629
BaosSubServiceTypes
The in the baos binary protocol specified sub services and some internal ranges in them.
Definition: Defines.h:97
std::map< std::uint16_t, DatapointDescriptionString > DatapointDescriptionStrings
Definition: Defines.h:633
BAOSLIB_EXPORT std::uint8_t dpSizeInBytes(DatapointSize dpSize)
Convert the enum value to a intergral size in bytes.
std::vector< ServerItem > ServerItems
Type for a list of ServerItems.
Definition: Defines.h:440
std::uint16_t ServerItem_StatusFlagType
Serveritem status flag type.
Definition: Defines.h:38
DatapointSize
Enum class representing the different datapoint lengths.
Definition: Defines.h:148
constexpr std::size_t POS_SUB_SERVICE
The 0 based position of the sub service byte.
Definition: Defines.h:665
std::vector< std::uint8_t > Buffer
An alias type for a byte buffer.
Definition: config.h:71
A pair of the DatapointSetCommand and the Datapoint value for changing datapoint values.
Definition: Defines.h:611
DatapointSetCommand command
The command for the value change.
Definition: Defines.h:613
DatapointValue value
The actual value of the datapoint.
Definition: Defines.h:612
Struct for the communication flags of a datapoint. See KNX spec for more details.
Definition: Defines.h:444
std::uint8_t transmitPriority
The KNX transmit priority.
Definition: Defines.h:507
std::uint8_t writeFromBus
The writable from bus flag.
Definition: Defines.h:511
std::string toString() const
Definition: Defines.h:492
DatapointConfigFlags(std::uint8_t &&value)
Construct from a byte value.
Definition: Defines.h:457
std::uint8_t readOnInit
The perform read request in onit flag.
Definition: Defines.h:512
std::uint8_t updateResponse
Define the bitfield for the flags and transmitPriority.
Definition: Defines.h:514
std::uint8_t communication
Definition: Defines.h:509
std::uint8_t transmitToBus
The devices send changes on the group object to the KNX bus.
Definition: Defines.h:513
DatapointConfigFlags & operator=(std::uint8_t &value)
Assign a byte to this object.
Definition: Defines.h:469
std::uint8_t readFromBus
The readable from bus flag.
Definition: Defines.h:510
Represents the information about a datapoint in the BAOS device.
Definition: Defines.h:621
DatapointSize size
The size as an enum value.
Definition: Defines.h:622
DPT dpt
The datapoint type (e.G. DPT1 for boolean, see KNX Spec datapoint types for more details)
Definition: Defines.h:624
DatapointConfigFlags flags
The communication flags.
Definition: Defines.h:623
Internal state for each datapoint in the object server.
Definition: Defines.h:519
std::uint8_t reserved_1
Reserved bit 1.
Definition: Defines.h:593
std::uint8_t updated
Definition: Defines.h:591
std::string toString() const
Represent the flags in a human readable form.
Definition: Defines.h:573
std::uint8_t valid
0 Object value is invalid or 1 the device has seen at least one value for the group object.
Definition: Defines.h:592
std::uint8_t readRequest
0 Write request should be sent, 1 Read request should be sent
Definition: Defines.h:589
std::uint8_t reserved_2
Reserved bit 2.
Definition: Defines.h:594
std::uint8_t transmitStatus
See BAOS binary protocol spec GetDatapointValue.Res state byte for details.
Definition: Defines.h:588
DatapointStatus(std::uint8_t &&value)
Construct from byte value.
Definition: Defines.h:532
DatapointStatus & operator=(std::uint8_t &value)
Assign value from byte.
Definition: Defines.h:544
std::uint8_t reserved_3
Reserved bit 3.
Definition: Defines.h:595
A combination of the status of a datapoint and its actual value.
Definition: Defines.h:601
DatapointValue value
The actual value of the datapoint.
Definition: Defines.h:602
DatapointStatus status
The status of the datapoint object.
Definition: Defines.h:603
Structure to hold information about a serveritem.
Definition: Defines.h:404
ServerItem(ServerItemId id_, std::uint8_t length_, const Buffer &data_)
Construct a new Server Item object.
Definition: Defines.h:428
ServerItem(ServerItemId id_, std::uint8_t length_, Buffer &&data_)
Construct a new Server Item object.
Definition: Defines.h:414
Buffer data
the data
Definition: Defines.h:437