source: trunk/FACT++/dim/src/examples/demo_client.c@ 14645

Last change on this file since 14645 was 11071, checked in by tbretz, 13 years ago
Replaced v19r21 by a version extracted with 'unzip -a' to get proper unix text format.
File size: 539 bytes
Line 
1#include <dic.h>
2
3int no_link = -1;
4
5void got_data( tag, data, size )
6int *data;
7int *tag, *size;
8{
9
10 if(*data == -1)
11 printf("Server is dead\n");
12 else
13 printf("got data: %d\n",*data);
14}
15
16main(argc,argv)
17int argc;
18char **argv;
19{
20 char aux[80], cmnd[16];
21
22
23 sprintf(aux,"DEVICE/%s/DATA",argv[1]);
24 dic_info_service( aux, MONITORED, 0, 0, 0, got_data, 0,
25 &no_link, 4 );
26
27 sprintf(aux,"DEVICE/%s/CMD",argv[1]);
28 while(1)
29 {
30 scanf("%s",cmnd);
31 printf("Sending Command: %s\n",cmnd);
32 dic_cmnd_service(aux,cmnd,strlen(cmnd)+1);
33 }
34}
Note: See TracBrowser for help on using the repository browser.