BAOS SDK v2  1.0.1
An SDK providing access to IP-BAOS devices through BAOS binary protocol version 2.x
BaosDeviceDataTypes.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_INTERFACE_DATA_TYPES_H__
14 #define __BAOSLIB_INTERFACE_DATA_TYPES_H__
15 
16 #include "baos/config.h"
17 
18 #include "BlockReader.h"
21 #include "baos/protocol/Defines.h"
22 
23 #include "wzcpp/features/algorithm/append.h"
24 #include "wzcpp/features/logging.h"
25 #include "wzcpp/features/utils/ByteArray.h"
26 #include "wzcpp/features/utils/Memory.h"
27 
29 #include <memory>
30 #include <optional>
31 #include <utility>
33 
39 namespace wz::baos
40 {
41 
48 struct BAOSLIB_EXPORT DeviceStaticInfo
49 {
50  wzcpp::SixByteArray hardwareType{0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
51  std::uint8_t hardwareVersion{0};
52  std::uint8_t firmwareVersion{0};
53  std::uint16_t manufactureCodeDevice{0};
54  wzcpp::SixByteArray serialNumber{0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
55  std::uint16_t maxBufferSize{0};
56  std::uint8_t binaryProtocolVersion{0};
57  std::uint8_t webServicesProtocolVersion{0};
58  std::uint8_t restServiceProtocolVersion{0};
59  wzcpp::SixByteArray macAddress{0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
60  std::uint8_t maxManagementClients{0};
61  std::uint8_t maxTunnellingClients{0};
62  std::uint8_t maxBaosUdpClients{0};
63  std::uint8_t maxBaosTcpClients{0};
64  std::uint16_t maxDatapoints{0};
65  std::uint16_t maxParameterBytes{0};
66 
67  static constexpr std::array ids{
83 };
84 
85 
93 struct BAOSLIB_EXPORT DeviceConfigInfo
94 {
95  std::uint16_t manufactureCodeApp{0};
96  std::uint16_t applicationId{0};
98  std::uint8_t applicationVersion{0};
100  std::uint16_t lengthOfDescriptionString{0};
101  std::uint8_t baudrateItem{0};
102  std::uint16_t currentBufferSize{0};
103  bool indicationSetting{
104  false};
105  std::uint16_t individualAddress{0};
106  bool tunnellingEnabled{false};
107  bool baosBinaryEnabled{false};
108  bool baosWebEnabled{false};
109  bool baosRestEnabled{false};
110  bool httpFileEnabled{false};
111  bool searchRequestEnabled{false};
112  bool isStructured{false};
114  std::uint16_t configuredDatapoints{0};
115  std::string deviceFriendlyName;
116  std::uint16_t downloadCounter{0};
120  std::array<std::uint8_t, 4> iPAddress;
122  std::array<std::uint8_t, 4> subnetMask;
123  std::array<std::uint8_t, 4>
126  std::int8_t SystemTimezoneOffset{0};
127  bool menuEnabled{false};
129  bool suspendEnabled{
130  false};
131  wzcpp::SixByteArray rfDomainAddress{
132  0x0, 0x0, 0x0, 0x0, 0x0, 0x0};
133  protocol::StatusFlagsSupported statusFlagsSupported{
134  0x0000};
135  static constexpr std::array ids{
164 };
165 
166 
173 struct BAOSLIB_EXPORT DeviceRuntimeInfo
174 {
175  std::uint32_t timeSinceReset{0};
176  bool busConnected{false};
177  bool programmingMode{false};
178  std::uint8_t connectedManagementClients{0};
179  std::uint8_t connectedTunnellingClients{0};
180  std::uint8_t connectedBaosUdpClients{0};
181  std::uint8_t connectedBaosTcpClients{0};
184  0x0000};
185  static constexpr std::array ids{
195 };
196 
200 struct BAOSLIB_EXPORT DatapointConfig
201 {
205  std::string desc;
206 };
207 
208 std::string BAOSLIB_EXPORT toString(const DatapointConfig& config);
209 
210 
211 using DatapointConfigurations = std::map<std::uint16_t, DatapointConfig>;
213 
215 enum class ServerItemReadStrategy : std::uint8_t
216 {
217  METADATAREAD,
221  ALLATONCE
222 };
223 
226 {
230 };
231 
232 } // namespace wz::baos
233 
234 #endif // __BAOSLIB_INTERFACE_DATA_TYPES_H__
Code regarding a connection to a physical BAOS device.
Provides the structures for additional meta information regarding the various devices.
Global BAOS protocol defines and types.
Represents which status flags are supported by the device, serveritem 52.
Definition: Defines.h:332
This structure represents the status flags provided by some BAOS devices server item ServerItemId::St...
Definition: Defines.h:261
Global types and configuration for the whole SDK.
IpAssigmentMethod
An Ip device may have different methods for ip assigment.
Definition: Defines.h:632
@ dhcp
The ip address is requested from a DHCP server.
@ 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)
@ TimeSinceResetUnit
(Read / Write; 1 byte; from V2.1)
@ 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)
@ 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)
@ StatusFlags
(Read Only; 2 bytes; 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)
@ StatusFlagsSupported
(Read Only; 2 bytes; from V2.1)
DPT
Enumeration value for the supported datapoint types( DPTs )
Definition: Defines.h:172
TimeSinceResetUnit
The ServerItemId::TimeSinceResetUnit current unit for TimeSinceReset. This type gives those units a n...
Definition: Defines.h:620
DatapointSize
Enum class representing the different datapoint lengths.
Definition: Defines.h:147
Global BAOS sdk namespace.
Definition: config.h:62
std::vector< std::uint8_t > Buffer
An alias type for a byte buffer.
Definition: config.h:64
std::map< std::uint16_t, DatapointConfig > DatapointConfigurations
Definition: BaosDeviceDataTypes.h:212
std::string toString(IOEvent::Type typ)
Provides a human readable string for an IOEvent type.
Definition: IOEvent.h:92
ServerItemReadStrategy
Strategy type on how to handle reading the serveritems.
Definition: BaosDeviceDataTypes.h:216
@ ALLATONCE
Read from first to std::uint16_t Max serveritems.
Information about a datapoint object.
Definition: BaosDeviceDataTypes.h:201
std::string desc
Definition: BaosDeviceDataTypes.h:205
protocol::DatapointConfigFlags flags
Definition: BaosDeviceDataTypes.h:203
protocol::DPT dpt
Definition: BaosDeviceDataTypes.h:204
protocol::DatapointSize size
Definition: BaosDeviceDataTypes.h:202
Configuration options for the cpp device class behaviour.
Definition: BaosDeviceDataTypes.h:226
ServerItemReadStrategy siReadStrategy
How server items should be read.
Definition: BaosDeviceDataTypes.h:229
bool blockReadEnabled
Read in blocks if the request is to larger to handle in one telegram.
Definition: BaosDeviceDataTypes.h:228
bool cacheEnabled
Enable the caching of datapoint values and parameter bytes.
Definition: BaosDeviceDataTypes.h:227
A collection of fields representing those serveritems which may change if the configuration of the de...
Definition: BaosDeviceDataTypes.h:94
std::array< std::uint8_t, 4 > defaultGateway
If manual IP assigment is selected, this is the default gateway to be set in the device.
Definition: BaosDeviceDataTypes.h:124
std::array< std::uint8_t, 4 > iPAddress
Definition: BaosDeviceDataTypes.h:120
std::array< std::uint8_t, 4 > subnetMask
If manual IP assignment is selected, this is the subnet mask to set.
Definition: BaosDeviceDataTypes.h:122
protocol::TimeSinceResetUnit timeSinceResetUnit
The unit in which timesincereset is represented.
Definition: BaosDeviceDataTypes.h:125
std::string deviceFriendlyName
For IP devices the same as KNXnet/IP device friendly name.
Definition: BaosDeviceDataTypes.h:115
A collection of fields representing those serveritems which may change during "normal" operation of t...
Definition: BaosDeviceDataTypes.h:174
Buffer SystemTime
The system time of the device in seconds since 1.1.1970 0:00.
Definition: BaosDeviceDataTypes.h:182
A collection of fields representing those serveritems which won't ever change in a device.
Definition: BaosDeviceDataTypes.h:49
Struct for the communication flags of a datapoint. See KNX spec for more details.
Definition: Defines.h:425