#include #include #include #include #include #include #include #define DEBUG 0 using namespace std; using namespace net::lliurex::mrpdi; bool quit_requested=false; void quit_handler(int sig) { #if DEBUG cout<<"[SIGNAL]:"< list; vector params; #if DEBUG cout<<"[mrpdi cli]: start"<init(); if(argc>1) { if(strcmp(argv[1],"--help")==0) { display_usage(); } if(strcmp(argv[1],"--list")==0) { core->update_devices(&list); cout<<"* Available devices:"<2) { bool found=false; unsigned int id; unsigned int address; string str(argv[2]); istringstream sp(str,istringstream::in); sp>>hex>>address; core->update_devices(&list); //device look up for(int n=0;nset_input_handler(handler); core->start(id,address); while(!quit_requested) { sleep(1); } core->stop(id,address); core->set_input_handler(NULL); delete handler; } else { cout<<"* Device not found, aborting"< params; handler = new input::InputHandler(); core->set_input_handler(handler); while(!quit_requested) { core->update_devices(&list); if(list.size()>0) { cout<<"* Connecting to "<start(id,address); /* core->get_parameter_list(id,¶ms); for(int n=0;nset_parameter(id,params[n].c_str(),1); break; } } */ while(!quit_dev && !quit_requested) { core->update_devices(&list); found=false; for(int n=0;nstop(id,address); } sleep(1); } delete handler; } } core->shutdown(); #if DEBUG cout<<"[mrpdi cli]: shutdown"<