Esempio n. 1
0
int main(int argc, char * argv[])
{
	MOOS::CommandLineParser P(argc,argv);

	std::string db_host = "localhost";
	P.GetVariable("--moos_host",db_host);

	int db_port = 9000;
	P.GetVariable("--moos_port",db_port);

	std::string my_name = "Practice App 03";
	P.GetVariable("--moos_name",my_name);

	MOOS::MOOSAsyncCommClient Comms;

	Comms.SetOnMailCallBack(OnMail,&Comms);
	Comms.SetOnConnectCallBack(OnConnect,&Comms);

	Comms.Run(db_host,db_port,my_name);

	std::vector<unsigned char> X(100);
	int Y = 0;

	while(1)
	{
		MOOSPause(1000);
		Comms.Notify("X",X);
		Comms.Notify("Y",Y++);
	}
	return 0;
}
Esempio n. 2
0
int main(int argc, char * argv[]){

	//configure the comms
	MOOS::MOOSAsyncCommClient Comms;
	Comms.SetOnMailCallBack(OnMail,&Comms);
	Comms.SetOnConnectCallBack(OnConnect,&Comms);

	//start the comms running
	Comms.Run("localhost",9000,"EX20");

	for(;;){
		MOOSPause(1000);
		Comms.Notify("Greeting","Hello");
	}
	return 0;
}