This demo shows how to read datapoint descriptions via the device API.
#include "Helper.h"
#include <iostream>
#include <memory>
using namespace wz::baos::ip;
{
try
{
std::cout << "******************************************" << std::endl;
std::cout << "03_BaosDatapointConfiguration sample" << std::endl;
std::cout << "******************************************" << std::endl;
std::cout << std::endl;
setBaosLogLevel(wz::baos::LogLevel::warn);
{
return 0;
}
std::cout <<
" Connection requested for " <<
ipAddress << std::endl;
std::cout << "Read all datapoint descriptions from device" << std::endl;
{
std::cout <<
"Datapoint id " <<
item.first <<
": ";
std::cout << toString(desc) << std::endl;
}
{
std::cout << "No datapoints configured on the device" << std::endl;
}
std::cout << std::endl;
std::cout << "Read datapoint descriptions (3..12) from device (use cache)" << std::endl;
{
std::cout <<
"Datapoint id " <<
item.first <<
": ";
std::cout << toString(desc) << std::endl;
}
{
std::cout << "Warning! No datapoints configured (in the range 3..12) on the device" << std::endl;
}
std::cout << std::endl;
{
std::cout << "Datapoint id 100: ";
std::cout << toString(desc) << std::endl;
}
else
{
std::cout << "Datapoint id 100: not configured";
}
}
catch (
const std::exception&
e)
{
std::cerr <<
"Failed: " <<
e.what() << std::endl;
return -1;
}
return 0;
}
Specialization for a IP v4 BAOSDevice.
Specialization for a TCP IP v4 BAOSConnection.
Global BAOS SDK function and options.
A specialization for (connection oriented) connection to the BAOS device via a TCP connection.
Definition BaosTcpConnection.h:182
Represents a BAOS IP4 device with an underlying TCP connection (with BAOS unsecure connection-less)
Definition BaosIpv4Device.h:55
Global BAOS sdk namespace.
Definition config.h:69
BAOSLIB_EXPORT void setBaosLogLevel(wz::baos::LogLevel level)
std::map< std::uint16_t, DatapointConfig > DatapointConfigurations
Definition BaosDeviceDataTypes.h:212
Information about a datapoint object.
Definition BaosDeviceDataTypes.h:201