source: UH/SAMGAR/SAMGAR LIB/Trunk/TesterFiles/SamgarSend.cpp @ 187

Revision 187, 1.1 KB checked in by KDucasse, 10 years ago (diff)
Line 
1#include <SamgarMainClass.h>
2using namespace std;
3
4int main() {
5
6int ccc =0;
7Network yarp; // setup the network, always needed
8//Create a module, with a given name,category and subcategory all of which must only contain a-z 0-9
9SamgarModule MyFirstTest("Sender","Move","Legs",run);
10//The last option must be run or interrupt both of which have different effects on the module.
11//Run will create a module which runs continuously until a stop command is sent from the GUI or other module.
12//Interrupt will only enable the module to run whilst there is new data on the port, so if no infomation is sent it is then impossible to run the module.
13MyFirstTest.AddPortS("out");
14MyFirstTest.AddPortS("Example");
15// these two commands start two ports that are children of the module
16  while( 1 )
17  {
18                  yarp::os::Time::delay(5);
19// this function sends int data on the specified port
20          MyFirstTest.SendIntData("out",ccc++);
21// in a run module the data given in this function is unimportant but still needs to be called for the module to work properly
22          MyFirstTest.SucceedFail(true,888);
23  }
24 return 0;
25}
Note: See TracBrowser for help on using the repository browser.