BAOS SDK v2  1.0.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-2023 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>
24 
32 {
35  std::map<std::uint16_t, DatapointValue>;
36 
37 using ServerItem_StatusFlagType = std::uint16_t;
38 
41 {
42  RUNNING = 1,
43  LOADED = 2,
44  TL_CONNECTED = 4,
45  SECURE = 8
46 };
47 
49 enum class DatapointValueFilter : std::uint8_t
50 {
51  ALL,
52  VALID,
54  UPDATED
56 };
57 
59 enum class DatapointSetCommand : std::uint8_t
60 {
61  NoCommand = 0x00,
62  SetNewValue = 0x01,
63  SendValueOnBus = 0x02,
66  0x04,
68 };
69 
71 enum class TransmitPriority : std::uint8_t
72 {
73  System = 0x00,
74  High = 0x01,
75  Alarm = 0x02,
76  Low = 0x03
77 };
78 
79 BAOSLIB_EXPORT std::string transmitPriorityToString(
80  TransmitPriority transmitPrio);
81 
83 enum class TransmissionStatus : std::uint8_t
84 {
85  Idle_OK = 0x00,
86  Idle_Error = 0x01,
87  InProgress = 0x02,
88  Request = 0x03
89 };
90 
91 BAOSLIB_EXPORT std::string transmissionStatusToString(
92  TransmissionStatus transmissionStatus);
93 
95 enum class BaosSubServiceTypes : std::uint8_t
96 {
97  MinRequest = 0x01,
98  GetServerItemRequest = 0x01,
99  SetServerItemRequest = 0x02,
100  GetDatapointDescriptionRequest = 0x03,
101  GetDescriptionStringRequest = 0x04,
102  GetDatapointValueRequest = 0x05,
103  SetDatapointValueRequest = 0x06,
104  GetParameterByteRequest = 0x07,
105  MaxRequest = 0x0C,
106 
107  MinResponse = 0x81,
108  GetServerItemResponse = 0x81,
109  SetServerItemResponse = 0x82,
110  GetDatapointDescriptionResponse = 0x83,
111  GetDescriptionStringResponse = 0x84,
112  GetDatapointValueResponse = 0x85,
113  SetDatapointValueResponse = 0x86,
114  GetParameterByteResponse = 0x87,
115  MaxResponse = 0x8C,
116 
117  MinIndication = 0xC1,
118  DatapointValueIndication = 0xC1,
119  ServerItemIndication = 0xC2,
120  MaxIndication = 0xC2,
121 };
122 
123 BAOSLIB_EXPORT std::string getBaosSubServiceTypeDescription(
124  BaosSubServiceTypes subServiceType);
125 
127 enum class BaosResponseCode : std::uint8_t
128 {
129  Success = 0,
130  Internal = 1,
131  NoItemFound = 2,
132  BufferTooSmall = 3,
133  ItemNotWriteable = 4,
134  ServiceNotSupported = 5,
135  BadServiceParameter = 6,
136  WrongDpId = 7,
137  BadDpCmd = 8,
138  BadDpValueLength = 9,
139  MessageInconsistent = 10,
140  ObjectServerIsBusy = 11,
141 };
142 
144 
146 enum class DatapointSize : std::uint8_t
147 {
148  BITS_1 = 0,
149  BITS_2 = 1,
150  BITS_3 = 2,
151  BITS_4 = 3,
152  BITS_5 = 4,
153  BITS_6 = 5,
154  BITS_7 = 6,
155  BYTE_1 = 7,
156  BYTES_2 = 8,
157  BYTES_3 = 9,
158  BYTES_4 = 10,
159  BYTES_6 = 11,
160  BYTES_8 = 12,
161  BYTES_10 = 13,
162  BYTES_14 = 14
163 };
164 
165 BAOSLIB_EXPORT std::string dpSizeToString(DatapointSize dpSize);
166 
167 BAOSLIB_EXPORT std::uint8_t dpSizeInBytes(
168  DatapointSize dpSize);
169 
171 enum class DPT : std::uint8_t
172 {
173  DPT_1 = 1,
174  DPT_2 = 2,
175  DPT_3 = 3,
176  DPT_4 = 4,
177  DPT_5 = 5,
178  DPT_6 = 6,
179  DPT_7 = 7,
180  DPT_8 = 8,
181  DPT_9 = 9,
182  DPT_10 = 10,
183  DPT_11 = 11,
184  DPT_12 = 12,
185  DPT_13 = 13,
186  DPT_14 = 14,
187  DPT_15 = 15,
188  DPT_16 = 16,
189  DPT_17 = 17,
190  DPT_18 = 18,
191 };
192 
193 BAOSLIB_EXPORT std::string dptToString(DPT dpt);
194 
195 
197 enum class ServerItemId : std::uint8_t
198 {
199  Invalid = 0,
200  HardwareType = 1,
201  HardwareVersion = 2,
202  FirmwareVersion = 3,
204  ManufactureCodeApp = 5,
205  ApplicationId = 6,
206  ApplicationVersion = 7,
207  SerialNumber = 8,
208  TimeSinceReset = 9,
209  BusConnected = 10,
210  MaxBufferSize = 11,
212  BaudrateItem = 13,
213  CurrentBufferSize = 14,
214  ProgrammingMode = 15,
215  BinaryProtocolVersion = 16,
216  IndicationSetting = 17,
218  18,
220  IndividualAddress = 20,
221  MacAddress = 21,
222  TunnellingEnabled = 22,
223  BaosBinaryEnabled = 23,
224  BaosWebEnabled = 24,
225  BaosRestEnabled = 25,
226  HttpFileEnabled = 26,
227  SearchRequestEnabled = 27,
228  IsStructured = 28,
229  MaxManagementClients = 29,
231  MaxTunnellingClients = 31,
233  MaxBaosUdpClients = 33,
235  MaxBaosTcpClients = 35,
237  DeviceFriendlyName = 37,
238  MaxDatapoints = 38,
239  ConfiguredDatapoints = 39,
240  MaxParameterBytes = 40,
241  DownloadCounter = 41,
242  IPAssignment = 42,
243  IPAddress = 43,
244  SubnetMask = 44,
245  DefaultGateway = 45,
246  TimeSinceResetUnit = 46,
247  SystemTime = 47,
248  SystemTimezoneOffset = 48,
249  MenuEnabled = 49,
250  SuspendEnabled = 50,
251  RFDomainAddress = 51,
252  StatusFlagsSupported = 52,
253  StatusFlags = 53
254 };
255 
256 BAOSLIB_EXPORT std::string serverItemIdToString(
257  ServerItemId sid);
258 
260 class BAOSLIB_EXPORT StatusFlags
261 {
262 public:
264  StatusFlags(const ServerItem_StatusFlagType val) : value_{val} {};
266  StatusFlags(const Buffer& data)
267  {
268  assert(data.size() >= 2);
269  value_ = data[0] << 8 | data[1];
270  }
271 
280  StatusFlags(bool running, bool loaded, bool tl_connected, bool secure)
281  {
282  value_ = 0x00;
283  if (running)
284  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::RUNNING);
285  if (loaded)
286  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::LOADED);
287  if (tl_connected)
288  value_ |=
289  static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::TL_CONNECTED);
290  if (secure)
291  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::SECURE);
292  }
293 
295  bool isRunning() const
296  {
297  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::RUNNING);
298  }
299 
301  bool isLoaded() const
302  {
303  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::LOADED);
304  }
305 
307  bool isTLConnected() const
308  {
309  return value_ &
310  static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::TL_CONNECTED);
311  }
312 
314  bool isSecure() const
315  {
316  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::SECURE);
317  }
318 
320  operator ServerItem_StatusFlagType() const
321  {
322  return value_;
323  }
324 
325 private:
327 };
328 
329 
331 class BAOSLIB_EXPORT StatusFlagsSupported
332 {
333 public:
335  StatusFlagsSupported(const ServerItem_StatusFlagType val) : value_{val} {};
336 
339  {
340  assert(data.size() >= 2);
341  value_ = data[0] << 8 | data[1];
342  }
343 
352  StatusFlagsSupported(bool running, bool loaded, bool tl_connected, bool secure)
353  {
354  value_ = 0x00;
355  if (running)
356  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::RUNNING);
357  if (loaded)
358  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::LOADED);
359  if (tl_connected)
360  value_ |=
361  static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::TL_CONNECTED);
362  if (secure)
363  value_ |= static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::SECURE);
364  }
365 
367  bool hasRunning() const
368  {
369  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::RUNNING);
370  }
371 
373  bool hasLoaded() const
374  {
375  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::LOADED);
376  }
377 
379  bool hasTLConnected() const
380  {
381  return value_ &
382  static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::TL_CONNECTED);
383  }
384 
386  bool hasSecure() const
387  {
388  return value_ & static_cast<std::underlying_type<ServerItem_StatusFlag>::type>(ServerItem_StatusFlag::SECURE);
389  }
390 
392  operator ServerItem_StatusFlagType() const
393  {
394  return value_;
395  }
396 
397 private:
399 };
400 
402 struct BAOSLIB_EXPORT ServerItem
403 {
404  ServerItem() = default; // The default constructor
405 
413  ServerItem(ServerItemId id_, std::uint8_t length_, Buffer&& data_) : id{id_}, length{length_}, data{data_}
414  {
415  }
417  std::uint8_t length{0};
419 };
420 
421 using ServerItems = std::vector<ServerItem>;
422 
424 struct BAOSLIB_EXPORT DatapointConfigFlags
425 {
427  : transmitPriority{0},
428  communication{0},
429  readFromBus{0},
430  writeFromBus{0},
431  readOnInit{0},
432  transmitToBus{0},
433  updateResponse{0}
434  {
435  }
436 
438  DatapointConfigFlags(std::uint8_t&& value)
439  {
440  updateResponse = value >> 7;
441  transmitToBus = value >> 6 & 0x01;
442  readOnInit = value >> 5 & 0x01;
443  writeFromBus = value >> 4 & 0x01;
444  readFromBus = value >> 3 & 0x01;
445  communication = value >> 2 & 0x01;
446  transmitPriority = value & 0x03;
447  }
448 
450  DatapointConfigFlags& operator=(std::uint8_t& value)
451  {
452  updateResponse = value >> 7;
453  transmitToBus = value >> 6 & 0x01;
454  readOnInit = value >> 5 & 0x01;
455  writeFromBus = value >> 4 & 0x01;
456  readFromBus = value >> 3 & 0x01;
457  communication = value >> 2 & 0x01;
458  transmitPriority = value & 0x03;
459  return *this;
460  }
461 
463  operator std::uint8_t() const
464  {
465  std::uint8_t value{0};
466  value = updateResponse << 7 | transmitToBus << 6 | readOnInit << 5 | writeFromBus << 4 | readFromBus << 3 |
467  communication << 2 | transmitPriority;
468  return value;
469  }
470 
473  std::string toString() const
474  {
475  std::ostringstream oss;
476  std::string flags{"______"};
477  if (communication) flags[0] = 'C';
478  if (readFromBus) flags[1] = 'R';
479  if (writeFromBus) flags[2] = 'W';
480  if (transmitToBus) flags[3] = 'T';
481  if (updateResponse) flags[4] = 'U';
482  if (readOnInit) flags[5] = 'I';
483 
484  oss << transmitPriorityToString(static_cast<TransmitPriority>(transmitPriority)) << " " << flags;
485  return oss.str();
486  }
487 
488  std::uint8_t transmitPriority : 2,
496 };
497 
499 struct BAOSLIB_EXPORT DatapointStatus
500 {
502  : transmitStatus{0},
503  readRequest{0},
504  updated{0},
505  valid{0},
506  reserved_1{0},
507  reserved_2{0},
508  reserved_3{0}
509  {
510  }
511 
513  DatapointStatus(std::uint8_t&& value)
514  {
515  reserved_3 = value >> 7;
516  reserved_2 = value >> 6 & 0x01;
517  reserved_1 = value >> 5 & 0x01;
518  valid = value >> 4 & 0x01;
519  updated = value >> 3 & 0x01;
520  readRequest = value >> 2 & 0x01;
521  transmitStatus = value & 0x03;
522  }
523 
525  DatapointStatus& operator=(std::uint8_t& value)
526  {
527  reserved_3 = value >> 7;
528  reserved_2 = value >> 6 & 0x01;
529  reserved_1 = value >> 5 & 0x01;
530  valid = value >> 4 & 0x01;
531  updated = value >> 3 & 0x01;
532  readRequest = value >> 2 & 0x01;
533  transmitStatus = value & 0x03;
534  return *this;
535  }
536 
538  operator std::uint8_t() const
539  {
540  std::uint8_t value{0};
541  value = reserved_3 << 7 | reserved_2 << 6 | reserved_1 << 5 | valid << 4 | updated << 3 | readRequest << 2 |
542  transmitStatus;
543  return value;
544  }
545 
554  std::string toString() const
555  {
556  std::ostringstream oss;
557  valid ? oss << "V" : oss << "_";
558  updated ? oss << "U" : oss << "_";
559  readRequest ? oss << "R" : oss << "W";
560  oss << " ";
561  oss << transmissionStatusToString(static_cast<TransmissionStatus>(transmitStatus));
562  return oss.str();
563  }
564 
566 
569  std::uint8_t transmitStatus : 2,
571  updated : 1,
573  valid : 1,
578 };
579 
581 struct BAOSLIB_EXPORT DatapointValueState
582 {
585 };
586 
587 using DatapointValueStates = std::map<std::uint16_t, DatapointValueState>;
589 
591 struct BAOSLIB_EXPORT DatapointChangeValue
592 {
595 };
596 
597 using DatapointChangeValues = std::map<std::uint16_t, DatapointChangeValue>;
599 
601 struct BAOSLIB_EXPORT DatapointDescription
602 {
606 };
607 
609  std::map<std::uint16_t, DatapointDescription>;
611 using DatapointDescriptionString = std::string;
613  std::map<std::uint16_t, DatapointDescriptionString>;
615 
616 using ParameterBytes = std::vector<std::uint8_t>;
617 
620 {
621  milliseconds,
622  seconds,
623  minutes,
624  hours
625 };
626 
627 BAOSLIB_EXPORT std::string timeSinceResetUnitToString(
628  TimeSinceResetUnit unit);
629 
632 {
633  manual = 0x1,
634  bootp = 0x2,
635  dhcp = 0x4,
636  autoIp = 0x8
637 };
638 
639 
644 constexpr std::uint8_t BAOS_MAIN_SERVICE = 0xF0;
645 constexpr std::size_t POS_MAIN_SERVICE = 0;
646 constexpr std::size_t POS_SUB_SERVICE = 1;
647 constexpr std::size_t POS_START =
648  2;
649 constexpr std::size_t POS_NUMBER_OF_ELEMENTS = 4;
650 constexpr std::size_t POS_ERRORCODE = 6;
651 constexpr std::size_t POS_PAYLOAD_BEGIN = 6;
653 
654 } // namespace wz::baos::protocol
655 
656 #endif
Represents which status flags are supported by the device, serveritem 52.
Definition: Defines.h:332
bool hasRunning() const
Is the running flag supported.
Definition: Defines.h:367
StatusFlagsSupported(const Buffer &data)
Construct from an array of bytes.
Definition: Defines.h:338
bool hasSecure() const
Is the secure mode flag supported.
Definition: Defines.h:386
bool hasLoaded() const
Is the loaded flag supported.
Definition: Defines.h:373
bool hasTLConnected() const
Is the transport layer connected flag supported.
Definition: Defines.h:379
StatusFlagsSupported(bool running, bool loaded, bool tl_connected, bool secure)
Construct a new StatusFlagsSupported object from integral values.
Definition: Defines.h:352
StatusFlagsSupported(const ServerItem_StatusFlagType val)
< Construct from a existing ServerItem_StatusFlagType value
Definition: Defines.h:335
This structure represents the status flags provided by some BAOS devices server item ServerItemId::St...
Definition: Defines.h:261
StatusFlags(bool running, bool loaded, bool tl_connected, bool secure)
Construct a new Status Flags object.
Definition: Defines.h:280
bool isSecure() const
Returns if the device is on secure mode.
Definition: Defines.h:314
StatusFlags(const ServerItem_StatusFlagType val)
Construct from a existing ServerItem_StatusFlagType value.
Definition: Defines.h:264
bool isTLConnected() const
Returns if the transport layer is connected.
Definition: Defines.h:307
bool isRunning() const
Return the value of the running element as boolean.
Definition: Defines.h:295
StatusFlags(const Buffer &data)
Construct from an array of bytes.
Definition: Defines.h:266
bool isLoaded() const
Return if the ETS applicatiopn is loaded or not.
Definition: Defines.h:301
Global types and configuration for the whole SDK.
Groups BAOS binary protocol specific types , defines and classes for Indications, Responses etc.
Definition: Defines.h:32
constexpr std::size_t POS_ERRORCODE
The 0 bases position of the errorcode if available.
Definition: Defines.h:650
IpAssigmentMethod
An Ip device may have different methods for ip assigment.
Definition: Defines.h:632
@ 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:128
@ 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:35
ServerItem_StatusFlag
Enum class representing the flags inside the status flag serveritem.
Definition: Defines.h:41
@ 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:644
std::string DatapointDescriptionString
Strong type for the description string.
Definition: Defines.h:611
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:598
ServerItemId
An enum class to provide conveniant names to the serveritem ids.
Definition: Defines.h:198
@ 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:645
constexpr std::size_t POS_START
The 0 based position of the start element (startitem, start datapoint id etc.)
Definition: Defines.h:647
std::map< std::uint16_t, DatapointValueState > DatapointValueStates
Definition: Defines.h:588
DatapointSetCommand
Setting a datapoint value there are different modes supported. This enum class gives those modes name...
Definition: Defines.h:60
@ 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:651
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:616
DPT
Enumeration value for the supported datapoint types( DPTs )
Definition: Defines.h:172
@ 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:72
DatapointValueFilter
Requested datapoint value can be filtered by this criteria.
Definition: Defines.h:50
@ ALL
No filter, all datapoints.
TransmissionStatus
Internal transmit state of the device.
Definition: Defines.h:84
constexpr std::size_t POS_NUMBER_OF_ELEMENTS
The 0 based position of the number of elements in the packet.
Definition: Defines.h:649
std::string baosResponseCodeToString(BaosResponseCode code)
Convert the enum value to a human readable string.
TimeSinceResetUnit
The ServerItemId::TimeSinceResetUnit current unit for TimeSinceReset. This type gives those units a n...
Definition: Defines.h:620
wz::baos::Buffer DatapointValue
An type for the DatapointValues.
Definition: Defines.h:33
std::map< std::uint16_t, DatapointDescription > DatapointDescriptions
Definition: Defines.h:610
BaosSubServiceTypes
The in the baos binary protocol specified sub services and some internal ranges in them.
Definition: Defines.h:96
std::map< std::uint16_t, DatapointDescriptionString > DatapointDescriptionStrings
Definition: Defines.h:614
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:421
std::uint16_t ServerItem_StatusFlagType
Serveritem status flag type.
Definition: Defines.h:37
DatapointSize
Enum class representing the different datapoint lengths.
Definition: Defines.h:147
constexpr std::size_t POS_SUB_SERVICE
The 0 based position of the sub service byte.
Definition: Defines.h:646
std::vector< std::uint8_t > Buffer
An alias type for a byte buffer.
Definition: config.h:64
A pair of the DatapointSetCommand and the Datapoint value for changing datapoint values.
Definition: Defines.h:592
DatapointSetCommand command
The command for the value change.
Definition: Defines.h:594
DatapointValue value
The actual value of the datapoint.
Definition: Defines.h:593
Struct for the communication flags of a datapoint. See KNX spec for more details.
Definition: Defines.h:425
std::uint8_t transmitPriority
The KNX transmit priority.
Definition: Defines.h:488
std::uint8_t writeFromBus
The writable from bus flag.
Definition: Defines.h:492
std::string toString() const
Definition: Defines.h:473
DatapointConfigFlags(std::uint8_t &&value)
Construct from a byte value.
Definition: Defines.h:438
std::uint8_t readOnInit
The perform read request in onit flag.
Definition: Defines.h:493
std::uint8_t updateResponse
Define the bitfield for the flags and transmitPriority.
Definition: Defines.h:495
std::uint8_t communication
Definition: Defines.h:490
std::uint8_t transmitToBus
The devices send changes on the group object to the KNX bus.
Definition: Defines.h:494
DatapointConfigFlags & operator=(std::uint8_t &value)
Assign a byte to this object.
Definition: Defines.h:450
std::uint8_t readFromBus
The readable from bus flag.
Definition: Defines.h:491
Represents the information about a datapoint in the BAOS device.
Definition: Defines.h:602
DatapointSize size
The size as an enum value.
Definition: Defines.h:603
DPT dpt
The datapoint type (e.G. DPT1 for boolean, see KNX Spec datapoint types for more details)
Definition: Defines.h:605
DatapointConfigFlags flags
The communication flags.
Definition: Defines.h:604
Internal state for each datapoint in the object server.
Definition: Defines.h:500
std::uint8_t reserved_1
Reserved bit 1.
Definition: Defines.h:574
std::uint8_t updated
Definition: Defines.h:572
std::string toString() const
Represent the flags in a human readable form.
Definition: Defines.h:554
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:573
std::uint8_t readRequest
0 Write request should be sent, 1 Read request should be sent
Definition: Defines.h:570
std::uint8_t reserved_2
Reserved bit 2.
Definition: Defines.h:575
std::uint8_t transmitStatus
See BAOS binary protocol spec GetDatapointValue.Res state byte for details.
Definition: Defines.h:569
DatapointStatus(std::uint8_t &&value)
Construct from byte value.
Definition: Defines.h:513
DatapointStatus & operator=(std::uint8_t &value)
Assign value from byte.
Definition: Defines.h:525
std::uint8_t reserved_3
Reserved bit 3.
Definition: Defines.h:576
A combination of the status of a datapoint and its actual value.
Definition: Defines.h:582
DatapointValue value
The actual value of the datapoint.
Definition: Defines.h:583
DatapointStatus status
The status of the datapoint object.
Definition: Defines.h:584
Structure to hold information about a serveritem.
Definition: Defines.h:403
ServerItem(ServerItemId id_, std::uint8_t length_, Buffer &&data_)
Construct a new Server Item object.
Definition: Defines.h:413
Buffer data
the data
Definition: Defines.h:418