Mercurial > hg > fxanalyse
annotate KKFX80E.c @ 245:b1dc2ba9a315
Revise dedrift automatic slope update disable logic
author | Daniele Nicolodi <daniele@grinta.net> |
---|---|
date | Thu, 26 Feb 2015 23:11:01 +0100 |
parents | 3427013e4f70 |
children |
rev | line source |
---|---|
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
1 #include <ctype.h> |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
2 #include <windows.h> |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
3 #include <utility.h> |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
4 #include <ansi_c.h> |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
5 |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
6 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
7 int (_stdcall *FX_OpenPort)(char **Port) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
8 void (_stdcall *FX_ClosePort)(void) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
9 int (_stdcall *FX_SendCommand)(char **Command) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
10 int (_stdcall *FX_GetReport)(char **Data) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
11 void (_stdcall *FX_Debug)(BOOL DbgFlag) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
12 // int (_stdcall *GetFXM)(char **Data) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
13 // void (_stdcall *Log)(int DbgNum) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
14 // int (_stdcall *ReadMonitor)(char **Data) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
15 // BOOL (_stdcall *EnumeratePorts)(char **PortName, char *PortNamePrefix) = NULL; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
16 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
17 static HMODULE module; |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
18 static char *errormsg; |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
19 |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
20 |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
21 char * FX_Error(void) |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
22 { |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
23 return errormsg; |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
24 } |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
25 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
26 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
27 int FX_Init(void) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
28 { |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
29 FARPROC funcp = NULL; |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
30 errormsg = ""; |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
31 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
32 module = LoadLibrary("KK_FX80E.dll"); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
33 if (! module) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
34 return 0; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
35 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
36 funcp = GetProcAddress(module, "FX_OpenPort"); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
37 if (! funcp) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
38 goto error; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
39 FX_OpenPort = (void *)funcp; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
40 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
41 funcp = GetProcAddress(module, "FX_ClosePort"); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
42 if (! funcp) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
43 goto error; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
44 FX_ClosePort = (void *)funcp; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
45 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
46 funcp = GetProcAddress(module, "FX_SendCommand"); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
47 if (! funcp) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
48 goto error; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
49 FX_SendCommand = (void *)funcp; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
50 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
51 funcp = GetProcAddress(module, "FX_GetReport"); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
52 if (! funcp) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
53 goto error; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
54 FX_GetReport = (void *)funcp; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
55 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
56 funcp = GetProcAddress(module, "FX_Debug"); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
57 if (! funcp) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
58 goto error; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
59 FX_Debug = (void *)funcp; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
60 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
61 return 1; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
62 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
63 error: |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
64 FreeLibrary(module); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
65 return 0; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
66 } |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
67 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
68 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
69 void FX_Free(void) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
70 { |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
71 FreeLibrary(module); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
72 } |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
73 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
74 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
75 int FX_Open(char *port) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
76 { |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
77 int rv = FX_OpenPort(&port); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
78 if (! rv) |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
79 errormsg = port; |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
80 return rv; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
81 } |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
82 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
83 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
84 void FX_Close(void) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
85 { |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
86 FX_ClosePort(); |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
87 } |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
88 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
89 |
193
3427013e4f70
Minor change to the KK FX80 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
102
diff
changeset
|
90 int FX_Send(char cmd) |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
91 { |
193
3427013e4f70
Minor change to the KK FX80 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
102
diff
changeset
|
92 char *p = &cmd; |
3427013e4f70
Minor change to the KK FX80 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
102
diff
changeset
|
93 int rv = FX_SendCommand(&p); |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
94 if (! rv) |
193
3427013e4f70
Minor change to the KK FX80 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
102
diff
changeset
|
95 errormsg = p; |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
96 return rv; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
97 } |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
98 |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
99 |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
100 int FX_Recv(char **ret, int timeout) |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
101 { |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
102 int rv; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
103 char *data; |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
104 double mark = Timer(); |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
105 do { |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
106 data = "."; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
107 rv = FX_GetReport(&data); |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
108 if ((Timer() - mark) > timeout) { |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
109 rv = 0; |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
110 data = "Function FX_Recv: Timeout"; |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
111 } |
193
3427013e4f70
Minor change to the KK FX80 interface
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
102
diff
changeset
|
112 Delay(0.01); |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
113 } while ((! data) && (rv == 1)); |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
114 |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
115 if (! rv) { |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
116 errormsg = data; |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
117 data = NULL; |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
118 } |
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
119 |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
120 if (ret) |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
121 *ret = data; |
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
122 |
102
4f1f353e84f5
Add timeout to FX_Recv() function. Improve error handling in KKDataProvider
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
89
diff
changeset
|
123 return rv; |
89
c9e4f63c2033
Implement data acquisition through direct communication with the KK counter
Daniele Nicolodi <daniele.nicolodi@obspm.fr>
parents:
diff
changeset
|
124 } |