#pragma once
// ExtMonitor.h
//----------------------------
//library should be compiled with flags:
//   Project/Properties/Configuration properties/General/Use of MFC: Use MFC in a static Library
//   Project/Properties/Configuration properties/General/Character set: Not Set
//----------------------------
//should be used in main program:
//#define LIBMONITOR_IMPORTS
//should be used in library:
#define LIBMONITOR_EXPORTS
//----------------------------
#ifdef LIBMONITOR_EXPORTS
#define LIBMONITOR_FUN __declspec(dllexport)
#else
#ifdef LIBMONITOR_IMPORTS
#define LIBMONITOR_FUN __declspec(dllimport)
#else
#define LIBMONITOR_FUN 
#endif
#endif
//----------------------------
typedef void  (*TWFMessageBox_)(const char *str);
typedef int (*TSetData)(void *value,int type,int subtype, double v);
//----------------------------
//is called once at program start
//return pointer to identificator 
//Out: 
//MonitorName - string with monitor name; e.g. "MARG"
//In:
//WFMessageBox("...") should be called from library to show text message
LIBMONITOR_FUN void *Monitor3AllocateIdentificator(TWFMessageBox_ WFMessageBox, char *MonitorName);
//----------------------------
//is called once at program stop
//free identificator memory
LIBMONITOR_FUN int Monitor3FreeIdentificator(void *ID);
//----------------------------
//is called to connect
//return 0 = success
//   value - this value should be used in SetData() call
//   SetData() - callback function, called from library, when data is appeared
//   return 0; 
//             type = 1)HR (subtype = data source; value = type of data), 
//                    2)SpO2, 
//                    3)temperature, 
//                    4)systolic [maximum] blood pressure
//                    5)diastolic [minimum] blood pressure
//                    6)respiration rate
//                    7)ECG (subtype=electrocardiogram lead (from 1 to leads number))
//...
//                    -1000)connection is closed
LIBMONITOR_FUN int Monitor3Connect(void *ID, void *value, TSetData SetData);
//----------------------------
//is called to disconnect
//return 0 = success
LIBMONITOR_FUN int Monitor3Disconnect(void *ID);
//----------------------------
//is called to set some parameter
//return 0 = success
//   type:   1 = if *(int*)data != then library should be stopped
//   type:   2 = (char*)data  - IP-string for Triton
//   type:   3 = (char*)data  - IP-string for this computer
//   type:   4 = (int (*)(const char *s))data  - function to output any messages
//     ...
LIBMONITOR_FUN int Monitor3SetParameter(void *ID, int type, void *data);
//===========================================================================================
LIBMONITOR_FUN int Monitor3PressureMeasureStart(void *ID);
//===========================================================================================
LIBMONITOR_FUN int Monitor3PressureMeasureStop(void *ID);
//===========================================================================================
