TSP: The Transport Sample Protocol



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

bb_checkid.c

00001 
00002 #include <stdio.h>
00003 #include <malloc.h>
00004 #include <unistd.h>
00005 #include <stdlib.h>
00006 #include <assert.h>
00007 
00008 #include <bb_utils.h>
00009 
00010 int 
00011 main (int argc, char ** argv) {
00012 
00013   /* Définitions des variables */
00014   int retcode=0;
00015   int32_t user_specific_value;
00016   char* shm_name;
00017   char* sem_name;
00018   char* msg_name;
00019   
00020   /* Attach to  BB */
00021   /*****************/
00022   if (argc<3) {
00023     fprintf(stderr,"%s : argument missing\n",argv[0]);
00024     fprintf(stderr,"Usage : %s <bbname> <user_specific_value>\n",argv[0]);
00025     exit(-1);
00026   }
00027 
00028   user_specific_value = atoi(argv[2]);
00029   fprintf(stdout,"Computing BB IPC Id for BB <%s> with specific user value <%d>\n",
00030           argv[1],user_specific_value);
00031 
00032   
00033   shm_name = bb_utils_build_shm_name(argv[1]);
00034   sem_name = bb_utils_build_sem_name(argv[1]);
00035   msg_name = bb_utils_build_msg_name(argv[1]);
00036 
00037   fprintf(stdout,"SHM Key [name=<%s>] is 0x%08x\n",shm_name,bb_utils_ntok_user(shm_name,user_specific_value));
00038   fprintf(stdout,"SEM Key [name=<%s>] is 0x%08x\n",sem_name,bb_utils_ntok_user(sem_name,user_specific_value));
00039   fprintf(stdout,"MSG Key [name=<%s>] is 0x%08x\n",msg_name,bb_utils_ntok_user(msg_name,user_specific_value));
00040 
00041   free(msg_name);
00042   free(sem_name);    
00043   free(shm_name);
00044 
00045   return (retcode);
00046 }
Framework Home Page.

Beware !! TSP wave is coming...