FACT++  1.0
test_client1.c
Go to the documentation of this file.
1 #include <dic.h>
2 #include <time.h>
3 #include <string.h>
4 #include <stdio.h>
5 
6 int Data[4000];
7 int no_link = -1;
8 
9 void rout( tag, buf, size )
10 int *buf;
11 int *tag, *size;
12 {
13 
14  printf("Received beam%d Data : %d\n",*tag, buf[0]);
15 }
16 
17 int main(int argc, char **argv)
18 {
19  int i;
20  char aux[80];
21  int id = 123;
22 
23  dic_info_service( "Beam1/Data", MONITORED, 0, 0, 0, rout, 1,
24  &no_link, 4 );
25  dic_info_service( "Beam1/Data", MONITORED, 0, 0, 0, rout, 1,
26  &no_link, 4 );
27  dic_info_service( "Beam1/Data", MONITORED, 0, 0, 0, rout, 1,
28  &no_link, 4 );
29  dic_info_service( "Beam2/Data", MONITORED, 0, 0, 0, rout, 2,
30  &no_link, 4 );
31  dic_info_service( "Beam2/Data", MONITORED, 0, 0, 0, rout, 2,
32  &no_link, 4 );
33  dic_info_service( "Beam2/Data", MONITORED, 0, 0, 0, rout, 2,
34  &no_link, 4 );
35 
36  while(1)
37  {
38  usleep(1000);
39  dic_cmnd_service("Beam1/Cmd","Update",7);
40  dic_cmnd_service("Beam2/Cmd","Update",7);
41  }
42  return 1;
43 }
unsigned dic_info_service(char *serv_name, int req_type, int req_timeout, void *serv_address, int serv_size, void(*usr_routine)(), dim_long tag, void *fill_addr, int fill_size)
Definition: dic.c:601
int i
Definition: db_dim_client.c:21
#define MONITORED
Definition: dim_common.h:9
void rout(int *tag, int *buf, int *size)
Definition: test_client1.c:9
int dic_cmnd_service(char *serv_name, void *serv_address, int serv_size)
Definition: dic.c:694
int no_link
Definition: test_client1.c:7
int Data[4000]
Definition: test_client1.c:6
int main(int argc, char **argv)
Definition: test_client1.c:17
int size
Definition: db_dim_server.c:17