microCOR Lab SDK  1.7
 All Classes Files Functions Enumerations Enumerator Modules
microCORLabC.h
Go to the documentation of this file.
1 /* Copyright (C) 2015 Infron Ltd. - All Rights Reserved
2  *
3  * Redistribution of this file without permission is prohibited.
4  *
5  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
6  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
7  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
8  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
9  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
10  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
11  * IN THE SOFTWARE.
12  */
13 
22 #ifndef MICROCORLABC_H
23 #define MICROCORLABC_H
24 
25 #include <stdint.h>
26 #include "microCORLabGlobalC.h"
27 
28 #ifndef _WIN32
29 #include <inttypes.h>
30 #endif
31 
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 /* https://sourceforge.net/p/predef/wiki/OperatingSystems/ */
38 /* http://msdn.microsoft.com/en-us/library/b0084kay(VS.80).aspx */
39 #ifdef _WIN32
40 # if defined(MICROCORLAB_LIBRARY)
41 # define MC_C_EXPORT __declspec(dllexport)
42 # else
43 # define MC_C_EXPORT __declspec(dllimport)
44 # endif
45 #elif __GNUC__
46 # define MC_C_EXPORT __attribute__((visibility("default")))
47 #else
48 # error "Unknown OS"
49 #endif
50 #ifdef MICROCORLAB_DIRECT_USE
51 # undef MC_C_EXPORT
52 # define MC_C_EXPORT
53 #endif
54 
56 #define MICROCORLAB_TIMESIZE 50
57 
58 /* ================================================================ */
59 
60 
61 
62 /* ================================================================ */
63 /* Main API */
64 /* ================================================================ */
65 
71 typedef struct microCORLabStatesStruct {
72 
73  int isInitted;
74 
75  int referenceMode;
76  int isTriggerEnabled;
77  int isShutdownEnabled;
78 
79  int usbDevice;
80  int gateway;
81  int terminal;
82 
83  int terminalType;
84  int terminalRunning;
85  int battery;
86  int sampling;
87 
88  double batteryLevel;
89  double sampleRate;
90 
91  int resolutionShift;
92  int columnCount;
93  int rowCount;
94  int isTimeEnabled;
95  int isChannelEnabled[EKG_CNT];
97 
98 
99 
104 
108 MC_C_EXPORT const char *microCORLab_info();
109 
119 int MC_C_EXPORT microCORLab_init(
120  const char * serialNo, const char * logFile, int64_t timeout);
121 
126 void MC_C_EXPORT microCORLab_free();
127 
142 int MC_C_EXPORT microCORLab_start();
143 
147 void MC_C_EXPORT microCORLab_stop();
148 
171 int MC_C_EXPORT microCORLab_data(double * data, int size);
172 
176 void MC_C_EXPORT microCORLab_setTimeEnabled(int enabled);
177 
187 int MC_C_EXPORT microCORLab_setChannelEnabled(int channel, int enabled);
188 
192 void MC_C_EXPORT microCORLab_setTriggerEnabled(int enabled);
193 
199 void MC_C_EXPORT microCORLab_setReferenceMode(int mode);
200 
205 void MC_C_EXPORT microCORLab_setResolutionShift(int shift);
206 
210 void MC_C_EXPORT microCORLab_setShutdownTerminal(int enabled);
211 
212 /* ================================================================ */
213 /* Helper Functions */
214 /* ================================================================ */
215 
221 int MC_C_EXPORT microCORLab_isNaN(double value);
222 
234 void MC_C_EXPORT microCORLab_timeToString(double t, char * s);
235 
239 MC_C_EXPORT const char * microCORLab_usbDeviceToString(int value);
240 
244 MC_C_EXPORT const char * microCORLab_gatewayToString(int value);
245 
249 MC_C_EXPORT const char * microCORLab_terminalToString(int value);
250 
255 MC_C_EXPORT const char * microCORLab_terminalTypeToString(int value);
256 
260 MC_C_EXPORT const char * microCORLab_terminalRunningToString(int value);
261 
265 MC_C_EXPORT const char * microCORLab_batteryToString(int value);
266 
270 MC_C_EXPORT const char * microCORLab_samplingToString(int value);
271 
275 MC_C_EXPORT const char * microCORLab_referenceModeToString(int value);
276 
277 
278 #ifdef __cplusplus
279 }
280 #endif
281 
282 #endif /* MICROCORLABC_H */
283  /* end of microCORLabCApi */
MC_C_EXPORT const char * microCORLab_referenceModeToString(int value)
returns reference mode name.
MC_C_EXPORT const char * microCORLab_usbDeviceToString(int value)
returns state name.
int MC_C_EXPORT microCORLab_data(double *data, int size)
data
int MC_C_EXPORT microCORLab_isNaN(double value)
is not-a-number
int MC_C_EXPORT microCORLab_setChannelEnabled(int channel, int enabled)
set channel enabled. Channels starts at zero.
int MC_C_EXPORT microCORLab_start()
microCORLab_start
void MC_C_EXPORT microCORLab_free()
Call this function at the end of your program.
void MC_C_EXPORT microCORLab_setResolutionShift(int shift)
set resolution shift
MC_C_EXPORT const char * microCORLab_gatewayToString(int value)
returns state name.
MC_C_EXPORT const char * microCORLab_samplingToString(int value)
returns state name.
void MC_C_EXPORT microCORLab_stop()
stops data acquisition.
MC_C_EXPORT const char * microCORLab_terminalRunningToString(int value)
returns state name.
MC_C_EXPORT const char * microCORLab_batteryToString(int value)
returns state name.
void MC_C_EXPORT microCORLab_setTimeEnabled(int enabled)
set time channel enabled
void MC_C_EXPORT microCORLab_setShutdownTerminal(int enabled)
set shutdown terminal
MC_C_EXPORT const char * microCORLab_info()
returns info string
void MC_C_EXPORT microCORLab_setTriggerEnabled(int enabled)
set trigger
MC_C_EXPORT const char * microCORLab_terminalToString(int value)
returns state name.
Definition: microCORLabC.h:71
void MC_C_EXPORT microCORLab_setReferenceMode(int mode)
set reference mode.
void MC_C_EXPORT microCORLab_timeToString(double t, char *s)
is not-a-number
microCORLabStates MC_C_EXPORT microCORLab_states()
returns state struct
#define EKG_CNT
Definition: microCORLabGlobalC.h:29
MC_C_EXPORT const char * microCORLab_terminalTypeToString(int value)
convert terminal type to string
int MC_C_EXPORT microCORLab_init(const char *serialNo, const char *logFile, int64_t timeout)
Call this function first to use C API.