ArDrone SDK 1.8 added
[mardrone] / mardrone / ARDrone_SDK_Version_1_8_20110726 / ARDroneLib / VP_SDK / Examples / linux / client.c
1 // ----------------------------------------------
2 //
3 //  Author : <sylvain.gaeremynck\@parrot.fr>
4 //  Date   : 03/01/2007
5 //
6 //  Parrot Video SDK : Examples/linux
7 //
8 // ---------------------------------------------- 
9
10 #include <VP_Os/vp_os_print.h>
11 #include <VP_Api/vp_api_error.h>
12 #include <Examples/common/com_client.h>
13
14 int main(void)
15 {
16   if(FAILED(init_com_client()))
17   {
18     PRINT("Failed to init\n");
19     return -1;
20   }
21
22   if(FAILED(run_com_client(COM_BNEP)))
23   {
24     PRINT("Failed to run\n");
25   }
26   else
27   {
28     int size = 17;
29     char msg[16];
30
31     PRINT("Connected to server\n");
32
33     memset(msg,0,size);
34     while(FAILED(read_client(msg,&size)))
35       size = 16;
36
37     PRINT("received: %s\n",msg);
38   }
39
40   if(FAILED(shutdown_com_client()))
41   {
42     PRINT("Failed to shutdown\n");
43     return -1;
44   }
45
46   return 0;
47 }