This sample shows how to read paramter byte via the device API.
#include "Helper.h"
#include <iostream>
#include <memory>
using namespace wz::baos::ip;
namespace
{
{
std::cout.fill('0');
std::cout << std::hex << std::uppercase;
{
std::cout << std::setw(2) << static_cast<std::int32_t>(
item) <<
" ";
}
std::cout << std::nouppercase << std::dec << std::endl;
}
}
{
try
{
std::cout << "******************************************" << std::endl;
std::cout << "02_BaosParameterBytes 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 << "Parameter data (2 .. 5): ";
std::cout << std::endl;
std::cout <<
"Parameter data (" <<
parameterBytes.size() <<
" Bytes):";
std::cout << std::endl;
}
catch (
const wzcpp::error::WzBaseException&
e)
{
std::cout <<
"Wz Exception in main: " <<
e.msg() << std::endl;
}
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 protocol defines and types.
Global BAOS SDK function and options.
protocol::ParameterBytes getParameterBytes(std::uint16_t byteIndex, std::uint16_t numberOfBytes)
Get a list of parameter bytes.
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
Groups BAOS binary protocol specific types , defines and classes for Indications, Responses etc.
Definition Defines.h:33
std::vector< std::uint8_t > ParameterBytes
Strong type for a list of parameter bytes.
Definition Defines.h:635
Global BAOS sdk namespace.
Definition config.h:69
BAOSLIB_EXPORT void setBaosLogLevel(wz::baos::LogLevel level)