TSP: The Transport Sample Protocol



Main Page | Modules | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

bb_tsp_provider_main.c

Go to the documentation of this file.
00001 
00037 #include <stdio.h>
00038 #include <malloc.h>
00039 #include <unistd.h>
00040 #include <stdlib.h>
00041 #include <math.h>
00042 #include <signal.h>
00043 
00044 
00045 #include "bb_tsp_provider.h"
00046 #include "tsp_provider_init.h"
00047 
00048 
00049 int 
00050 main (int argc, char ** argv) {
00051 
00052   sigset_t allsigs;
00053   int whatsig;
00054 
00055   sigemptyset(&allsigs);
00056   sigaddset(&allsigs, SIGINT);
00057   sigprocmask(SIG_BLOCK, &allsigs, NULL);
00058 
00059   if (argc<2) {
00060     fprintf(stderr,"%s : argument missing\n",argv[0]);
00061     fprintf(stderr,"Usage: %s <bbname>\n",argv[0]);
00062     exit(-1);
00063   }
00064   
00065   bb_tsp_provider_initialise(&argc,&argv,
00066                              TSP_ASYNC_REQUEST_SIMPLE | TSP_ASYNC_REQUEST_NON_BLOCKING,
00067                              argv[1]);
00068   sigwait(&allsigs, &whatsig);
00069   bb_tsp_provider_finalize();
00070   
00071   return 0;
00072 }
Framework Home Page.

Beware !! TSP wave is coming...