00001 #ifndef __J2K__BoardClient_CPP__
00002 #define __J2K__BoardClient_CPP__
00003
00004 #include "BoardDef.hpp"
00005
00006
00007 int client() {
00008 board_data_t msg, rmsg;
00009
00010 register int fd = name_open( ATTACH_POINT, NAME_FLAG_ATTACH_GLOBAL );
00011 if ( fd == -1 )
00012 {
00013 printf( "Couldn't find the Board Server !\n" );
00014 return EXIT_FAILURE;
00015 }
00016
00017
00018 msg.hdr.type = 0x00;
00019 msg.hdr.subtype = 0x00;
00020 msg.serialMsgID = BOARD_SerialMsgID;
00021
00022
00023 for (msg.data=0; msg.data < 5; msg.data++)
00024 {
00025 memset( msg.string, 0, 80 );
00026 memset( rmsg.string, 0, 80 );
00027 sprintf( msg.string, "Hi %d", msg.data );
00028
00029 if ( MsgSend(fd, &msg, sizeof(msg), &rmsg, sizeof(rmsg) ) == -1)
00030 {
00031 break;
00032 }
00033
00034
00035 }
00036
00037
00038 name_close( fd );
00039 return EXIT_SUCCESS;
00040 }
00041
00042 int main(int argc, char **argv) {
00043 return client();
00044 }
00045
00046 #endif