23 #include <netcomm/fawkes/client.h>
24 #include <netcomm/fawkes/client_handler.h>
25 #include <utils/system/argparser.h>
26 #include <utils/system/signal.h>
31 using namespace fawkes;
49 virtual void deregistered(
unsigned int id)
throw()
51 printf(
"Got deregistered\n");
60 unsigned int id)
throw()
62 if ( m->payload_size() ==
sizeof(
unsigned int) ) {
63 unsigned int *u = (
unsigned int *)m->payload();
64 printf(
"Received message of type %hu with payload u=%u\n", m->msgid(), *u);
66 printf(
"Received message of invalid size, ignoring\n");
71 virtual void connection_died(
unsigned int id)
throw()
73 printf(
"Connection died.\n");
78 virtual void connection_established(
unsigned int id)
throw()
80 printf(
"Connection established\n");
95 main(
int argc,
char **argv)
106 unsigned int *u = (
unsigned int *)malloc(
sizeof(
unsigned int));;
108 if ( (tmp = argp.
arg(
"n")) != NULL ) {
115 if ( (tmp = argp.
arg(
"i")) != NULL ) {
127 c->
wait(FAWKES_CID_EXAMPLE_PLUGIN);