This commit is contained in:
2026-08-11 12:42:16 +03:00
parent 60dbba7a5f
commit 4491f27c68
3 changed files with 94 additions and 4 deletions

31
examples/netmsg_exam.cpp Normal file
View File

@@ -0,0 +1,31 @@
#include <print>
#include <adclib/adclib_netmsg.h>
int main()
{
adc::AdcNetworkMessage msg;
std::println("is ACK: {}", msg.isACK());
msg.createSET("ATTR1", snplib::snplib_serialization_params_t{}, 10, std::vector<char>{'V', 'A', 'L'});
std::println("KEY: <{}>", msg.key());
std::println("VALUE: <{}>", msg.value());
std::println("is SET: {}", msg.isSET());
std::println("is VALID: {}", msg.isValid());
std::string str{"SET ATTRQ 32.235 dwejh kd2jl"};
msg.fromCharRange(str);
std::println("KEY: <{}>", msg.key());
std::println("VALUE: <{}>", msg.value());
return 0;
}