#include "Helper.h"
#include <wzcpp/features/utils.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;
}
}
{
try
{
std::cout << "******************************************" << std::endl;
std::cout << "GetParamterByte 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 << "Reading parameter byte 1:" << std::endl;
{
std::cout << "Parameter data (1): " << std::setw(2) << static_cast<std::int32_t>(*parameterByte) << std::endl;
}
std::cout << std::endl;
std::cout << "Reading parameter byte 12:" << std::endl;
{
std::cout << "Parameter data (12): " << std::setw(2) << static_cast<std::int32_t>(*parameterByte) << std::endl;
}
std::cout << std::endl;
std::cout << "Reading parameter bytes 2 - 5:" << std::endl;
std::cout << std::endl << std::endl;
std::cout << "Reading parameter bytes 11 - 60:" << std::endl;
std::cout << std::endl << std::endl;
}
catch (
const std::exception&
e)
{
std::cerr <<
"Failed: " <<
e.what() << std::endl;
return -1;
}
return 0;
}
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.
std::optional< std::uint8_t > getParameterByte(std::uint16_t byteIndex)
Get a single parameter byte.
A specialization for (connection-less) connection to the BAOS device via a TCP connection.
Definition BaosTcpConnection.h:145
A specialization for (connection oriented) connection to the BAOS device via a TCP connection.
Definition BaosTcpConnection.h:182
void open(const std::string &ip4Address, std::uint16_t port=12004)
Open a connection to physical BAOS device.
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)