COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
agent_send.cpp File Reference
#include "agent/agentclass.h"
#include <iostream>
Include dependency graph for agent_send.cpp:

Functions

int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)
38 {
39 
40  Agent *agent;
41 
42  agent = new Agent("telem","send");
43  if (agent->cinfo != nullptr && agent->running())
44  {
45  while (agent->running())
46  {
47  string message {"helloBB"};
48 
49  agent->post((Agent::AgentMessage)0xBB, message);
50 
51  cout << "tx: " << message << endl;
52 
53  COSMOS_SLEEP(1);
54  }
55  }
56 
57  return 0;
58 }
AgentMessage
Type of Agent Message. Types > 127 are binary.
Definition: agentclass.h:216
uint16_t running()
Check if we&#39;re supposed to be running.
Definition: agentclass.cpp:391
int32_t post(messstruc mess)
Post a Cosmos::Agent::messstruc.
Definition: agentclass.cpp:2074
static Agent * agent
ensure the Agent constructor creates only one instance per process
Definition: agent_001.cpp:45
uint8_t message[300]
Definition: kpc9612p_send.cpp:36
Definition: agentclass.h:139
cosmosstruc * cinfo
Definition: agentclass.h:346