...
This commit is contained in:
31
examples/netmsg_exam.cpp
Normal file
31
examples/netmsg_exam.cpp
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user