COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Agent Talk Free

Send generic messages to the network.

You can use Cosmos::Agent::post to broadcast specific information that does not fit into the COSMOS namespace format (ex: your payload counts the number of reboots and you want to collect that information easily over the network)

Just define your specific message type in one byte (ex: 0xBF), generate your data in a custom format for your parser and send it using agent_post.

1 // generate data to broadcast
2 dataToBroadcast = "#PLD," to_string(num_resets) + "*" + chksum;
3 
4 // post information on the network with header 0xBF
5 iretn = agent_post(cdata, 0xBF, dataToBroadcast);
1 // receive new posts
2 iretn = agent_poll(cdata, meta, rxmessage, AGENT_MESSAGE_ALL, 1);
3 
4 if (meta.type == 0xBF) {
5  // do your stuff
6 }