SHARE
TWEET

Untitled

a guest Jul 17th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // WhaleTeqSECG_SDK.h
  2.  
  3. if def WHALETEQSECG_SDK_EXPORTS
  4.   ifdef LINUX_GCC
  5.     define WHALETEQSECG_SDK_API __attribute__ ((visibility ("default")))
  6.   else
  7.     define WHALETEQSECG_SDK_API __declspec(dllexport)
  8.   endif
  9. else
  10.   if defined(LINUX_GCC) || defined(ANDROID)
  11.     define WHALETEQSECG_SDK_API
  12.   else
  13.     define WHALETEQSECG_SDK_API __declspec(dllimport)
  14.   endif
  15. endif
  16.  
  17. extern "C"{
  18.         WHALETEQSECG_SDK_API void SpecifyCOMPort(int portNum);
  19.  
  20.     WHALETEQSECG_SDK_API bool InitSECG();
  21.     WHALETEQSECG_SDK_API void ResetSECG();
  22.     WHALETEQSECG_SDK_API void CloseSECG();
  23.  
  24.     WHALETEQSECG_SDK_API bool TriggerDeviceChanged();
  25.  
  26.     WHALETEQSECG_SDK_API char* GetUSBPort();
  27.  
  28.     WHALETEQSECG_SDK_API char* GetSerialNo();
  29.  
  30.     WHALETEQSECG_SDK_API char* GetHWInfo();
  31.     WHALETEQSECG_SDK_API char* GetFWVersion();
  32.     WHALETEQSECG_SDK_API char* GetHWVersion();
  33.  
  34.     WHALETEQSECG_SDK_API unsigned char* GetLicenseKey();
  35.     WHALETEQSECG_SDK_API void WriteLicenseKey(unsigned char** B, int len, int offset);
  36.  
  37.     WHALETEQSECG_SDK_API int GetAD();
  38.  
  39.     //Parameter - time
  40.     //  unit: second
  41.     //  time from the output signal changed(function, amplitude, frequency ...)
  42.     //Parameter - amp
  43.     //  unit: microvolt
  44.     typedef void (*TimeAmplitudeCB)(double time, double amp);
  45.  
  46.     //About 0.006 second(6ms) interval between each callback be triggered
  47.     WHALETEQSECG_SDK_API void RegisterTimeAmpCB(TimeAmplitudeCB cb);
  48.  
  49.     WHALETEQSECG_SDK_API void RegisterPacingTimeAmpCB(TimeAmplitudeCB cb);
  50.  
  51.  
  52.     enum OutputFunction_E {
  53.         Output_Off  = 0,
  54.         Output_Sine,
  55.         Output_Triangle,
  56.         Output_Square,
  57.         Output_RectanglePulse,
  58.         Output_TrianglePulse,
  59.         Output_Exponential,
  60.         Output_ECG2_27,//add specialwaveform 0713
  61.         Output_IEC227W,
  62.         Output_IEC251W,
  63.         Output_JJG1041,
  64.         Output_JJG1041_HR,
  65.         Output_JJG_Hysteresis,
  66.         Output_ECG_File
  67.  
  68.     };
  69.    
  70.     enum SpecialWave227_E{
  71.         IEC227W_3A_A1 = 0,
  72.         IEC227W_3B_A2,
  73.         IEC227W_3C_A3,
  74.         IEC227W_3D_A4,
  75.         IEC227W_4A_B1,
  76.         IEC227W_4A_B1x2,
  77.         IEC227W_4A_B1d2,
  78.         IEC227W_4B_B2,
  79.         IEC227W_4B_B2x2,
  80.         IEC227W_4B_B2d2,
  81.  
  82.     };
  83.     enum SpecialWave251_E{
  84.         IEC251W_1 = 0,
  85.         IEC251W_2,
  86.         IEC251W_3,
  87.         IEC251W_4,
  88.         IEC251W_6,
  89.         IEC251W_10,
  90.     };
  91.  
  92.     //Return value:
  93.     // 0:  succeed
  94.     // -1: Mainfunction not set to IEC227W
  95.     // Call after set main func to Output_IEC227w
  96.     WHALETEQSECG_SDK_API int SetSpecialWave227(SpecialWave227_E spec);
  97.     WHALETEQSECG_SDK_API SpecialWave227_E GetSpecialWave227();
  98.     //Return value:
  99.     // 0:  succeed
  100.     // -1: Mainfunction not set to IEC251W
  101.     // Call after set main func to Output_IEC251w
  102.     WHALETEQSECG_SDK_API int SetSpecialWave251(SpecialWave251_E spec);
  103.     WHALETEQSECG_SDK_API SpecialWave251_E GetSpecialWave251();
  104.     //Return value:
  105.     //  0:  succeed
  106.     //  -1: SECG not be initialized
  107.     WHALETEQSECG_SDK_API int SetOutputFunc(OutputFunction_E func);
  108.     WHALETEQSECG_SDK_API OutputFunction_E GetOutputFunc();
  109.  
  110.     //Parameter - amp:
  111.     //  value range: -10 ~ 10
  112.     //  unit: microvolt(mV)
  113.     //Return value:
  114.     //  0: succeed
  115.     //  -1: SECG not be initialized
  116.     //  -2: value out of range
  117.     //  -3: "Baseline Reset Test" is working
  118.     //Default value after InitSECG(): 1mV
  119.     WHALETEQSECG_SDK_API int SetAmplitude(double amp);
  120.     WHALETEQSECG_SDK_API double GetAmplitude();
  121.     #define DefaultAmplitude    1.0
  122.     #define MaxAmplitude        10.0
  123.     #define MinAmplitude        -10.0
  124.  
  125.     //Parameter - freq:
  126.     //  value range: 0.05 ~ 500
  127.     //               0.05 ~ 3 when Output as Pulse Waveforms
  128.     //  unit: hertz
  129.     //Return value:
  130.     //  0: succeed
  131.     //  -1: SECG not be initialized
  132.     //  -2: value out of range
  133.     //  -3: "Frequency Scan" is working
  134.     //  -4: "Baseline Reset Test" is working
  135.     //Default value after InitSECG(): 1Hz
  136.     WHALETEQSECG_SDK_API int SetFrequency(double freq);
  137.     WHALETEQSECG_SDK_API double GetFrequency();
  138.     #define DefaultFrequency        1.0
  139.     #define MaxFrequency            500.0
  140.     #define MinFrequency            0.05
  141.     #define MaxFrequencyPulseWave   3.0
  142.  
  143.     //Parameter - setting:
  144.     //  value range: -300 ~ 300 - DCOffset Variable mode Off
  145.     //               -1000 ~ 1000 - DCOffset Variable mode On
  146.     //  unit: microvolt(mV)
  147.     //Return value:
  148.     //  0: succeed
  149.     //  -1: SECG not be initialized
  150.     //  -2: value out of range
  151.     //Default value after InitSECG(): 0mV
  152.     WHALETEQSECG_SDK_API int SetDCOffset(int setting);
  153.     WHALETEQSECG_SDK_API int GetDCOffset();
  154.     #define DefaultDCOffset     0
  155.     #define MaxDCOffset         300
  156.     #define MinDCOffset         -300
  157.     #define MaxDCOffsetVarMode  1000
  158.     #define MinDCOffsetVarMode  -1000
  159.  
  160.     //Return value:
  161.     //  0: succeed
  162.     //  -1: SECG not be initialized
  163.     //Default value after InitSECG(): false(Off)
  164.     WHALETEQSECG_SDK_API int SetDCOffsetVariableMode(bool OnOff);
  165.     WHALETEQSECG_SDK_API bool GetDCOffsetVariableMode();
  166.  
  167.     //Return value:
  168.     //  0: succeed
  169.     //  -1: SECG not be initialized
  170.     //Default value after InitSECG(): false(Off)
  171.     WHALETEQSECG_SDK_API int SetDCOffsetCommoneMode(bool OnOff);
  172.     WHALETEQSECG_SDK_API bool GetDCOffsetCommoneMode();
  173.  
  174.     enum OutputLead_E {
  175.         Lead_RA     = 0,    //(R)
  176.         Lead_LA,            //(L)
  177.         Lead_LL,            //(F)
  178.         Lead_V1,
  179.         Lead_V2,
  180.         Lead_V3,
  181.         Lead_V4,
  182.         Lead_V5,
  183.         Lead_V6
  184.     };
  185.     //Return value:
  186.     //  0: succeed
  187.     //  -1: SECG not be initialized
  188.     //Default value after InitSECG(): Lead_RA - On; all others - Off;
  189.     WHALETEQSECG_SDK_API int SetOutputLead(OutputLead_E lead, bool OnOff);
  190.     WHALETEQSECG_SDK_API bool GetOutputLead(OutputLead_E lead);
  191.  
  192.     //Parameter - width:
  193.     //  value range: 2 ~ 300
  194.     //  unit: milisecond(ms)
  195.     //Return value:
  196.     //  0: succeed
  197.     //  -1: SECG not be initialized
  198.     //  -2: value out of range
  199.     //Default value after InitSECG(): 100ms
  200.     WHALETEQSECG_SDK_API int SetPulseWidth(double width);
  201.     WHALETEQSECG_SDK_API double GetPulseWidth();
  202.     #define DefaultPulseWidth   100
  203.     #define MaxPulseWidth       300
  204.     #define MinPulseWidth       2
  205.  
  206.     //Return value:
  207.     //  0: succeed
  208.     //  -1: SECG not be initialized
  209.     //Default value after InitSECG(): true(On - 620k&/4.7nF shorted)
  210.     WHALETEQSECG_SDK_API int SetInputImpedanceMode(bool OnOff);
  211.     WHALETEQSECG_SDK_API bool GetInputImpedanceMode();
  212.  
  213.     enum PacingPulse_E {
  214.         SinglePulse = 0,
  215.         DoublePulse_150ms,
  216.         DoublePulse_250ms
  217.     };
  218.     //Return value:
  219.     //  0:  succeed
  220.     //  -1: SECG not be initialized
  221.     //Default value after InitSECG(): SinglePulse
  222.     WHALETEQSECG_SDK_API int SetPacingPulseMode(PacingPulse_E mode);
  223.     WHALETEQSECG_SDK_API PacingPulse_E GetPacingPulseMode();
  224.  
  225.     //Parameter - time:
  226.     //  value range: 5 ~ 200
  227.     //  unit: milisecond(ms)
  228.     //Return value:
  229.     //  0: succeed
  230.     //  -1: SECG not be initialized
  231.     //  -2: value out of range
  232.     //Default value after InitSECG(): 100ms
  233.     WHALETEQSECG_SDK_API int SetQRSDuration(double time);
  234.     WHALETEQSECG_SDK_API double GetQRSDuration();
  235.     #define DefaultQRSDuration  100
  236.     #define MaxQRSDuration  200
  237.     #define MinQRSDuration  5
  238.  
  239.     //Parameter - amp:
  240.     //  value range: 0 ~ 2.5
  241.     //  unit: microvolt(mV)
  242.     //Return value:
  243.     //  0: succeed
  244.     //  -1: SECG not be initialized
  245.     //  -2: value out of range
  246.     //Default value after InitSECG(): 0.2mV
  247.     WHALETEQSECG_SDK_API int SetTWave(double amp);
  248.     WHALETEQSECG_SDK_API double GetTWave();
  249.     #define DefaultTWave    0.2
  250.     #define MaxTWave        2.5
  251.     #define MinTWave        0
  252.  
  253.     //Parameter - amp:
  254.     //  value range: -700 ~ 700
  255.     //  unit: microvolt(mV)
  256.     //Return value:
  257.     //  0: succeed
  258.     //  -1: SECG not be initialized
  259.     //  -2: value out of range
  260.     //Default value after InitSECG(): 0mV
  261.     WHALETEQSECG_SDK_API int SetPacingAmplitude(double amp);
  262.     WHALETEQSECG_SDK_API double GetPacingAmplitude();
  263.     #define DefaultPacingAmplitude  0
  264.     #define MaxPacingAmplitude      700
  265.     #define MinPacingAmplitude      -700
  266.  
  267.     //Parameter - time:
  268.     //  value range: 0.1 ~ 2
  269.     //  unit: milisecond(ms)
  270.     //Return value:
  271.     //  0: succeed
  272.     //  -1: SECG not be initialized
  273.     //  -2: value out of range
  274.     //Default value after InitSECG(): 2ms
  275.     WHALETEQSECG_SDK_API int SetPacingDuration(double time);
  276.     WHALETEQSECG_SDK_API double GetPacingDuration();
  277.     #define DefaultPacingDuration   2.0
  278.     #define MaxPacingDuration       3.0
  279.     #define MinPacingDuration       0.1
  280.  
  281.     //Parameter - BPM:
  282.     //  value range: 10 ~ 300
  283.     //  unit: beats per minute(BPM)
  284.     //Return value:
  285.     //  0: succeed
  286.     //  -1: SECG not be initialized
  287.     //  -2: value out of range
  288.     //Default value after InitSECG(): 60BPM
  289.     WHALETEQSECG_SDK_API int SetPacingRate(unsigned BPM);
  290.     WHALETEQSECG_SDK_API unsigned GetPacingRate();
  291.     #define DefaultPacingRate   60
  292.     #define MaxPacingRate       300
  293.     #define MinPacingRate       10
  294.  
  295.     //Parameter - time:
  296.     //  value range: 0 ~ 100
  297.     //  unit: milisecond(ms)
  298.     //Return value:
  299.     //  0: succeed
  300.     //  -1: SECG not be initialized
  301.     //  -2: value out of range
  302.     //Default value after InitSECG(): 0ms
  303.     WHALETEQSECG_SDK_API int SetOvershootTimeConstant(unsigned time);
  304.     WHALETEQSECG_SDK_API unsigned GetOvershootTimeConstant();
  305.     #define DefaultOvershootTimeConstant    0
  306.     #define MaxOvershootTimeConstant        100
  307.     #define MinOvershootTimeConstant        0
  308.  
  309.     //Parameter - freq
  310.     //  unit: hertz
  311.     //  frequency value changed during "Baseline Reset Test" or "Frequency Scanning"
  312.     typedef void (*SyncFreqCB)(double freq);
  313.  
  314.     WHALETEQSECG_SDK_API void RegisterSyncFreqCB(SyncFreqCB cb);
  315.  
  316.     enum BaselineReset_E {
  317.         Baseline_Off    = 0,
  318.         Baseline_50Hz,
  319.         Baseline_60Hz,
  320.         Baseline_80Hz,
  321.         Baseline_100Hz
  322.     };
  323.     //Return value:
  324.     //  0: succeed
  325.     //  -1: SECG not be initialized
  326.     //  -2: current main output function not be "Output_Sine"
  327.     //Default value after InitSECG(): Baseline_Off
  328.     //"Output Function" must be set to "Output_Sine" before setting as "non - Baseline_Off" value
  329.     //After setting as "non - Baseline_Off" value, "Amplitude" would be locked to "2.5mV"
  330.     //and "Frequency" would be locked as "50/60/80/100" Hz.
  331.     WHALETEQSECG_SDK_API int SetBaselineResetTest(BaselineReset_E mode);
  332.     WHALETEQSECG_SDK_API BaselineReset_E GetBaselineResetTest();
  333.  
  334.     enum ECG2_27_NoiseFreq_E {
  335.         Noise_None  = 0,
  336.         Noise_50Hz,
  337.         Noise_60Hz
  338.     };
  339.     //Parameter - freq:
  340.     //  Default value after InitSECG(): Noise_None
  341.     //Parameter - amp:
  342.     //  value range: 0.01 ~ 0.2
  343.     //  unit: microvolt(mV)
  344.     //  Default value after InitSECG(): 0.1mV
  345.     //Return value:
  346.     //  0: succeed
  347.     //  -1: SECG not be initialized
  348.     //  -2: current main output function not be "Output_ECG2_27"
  349.     //  -3: amp out of range
  350.     WHALETEQSECG_SDK_API int SetECG2_27_Noise(ECG2_27_NoiseFreq_E freq, double amp);
  351.     WHALETEQSECG_SDK_API ECG2_27_NoiseFreq_E GetECG2_27_NoiseFreq();
  352.     WHALETEQSECG_SDK_API double GetECG2_27_NoiseAmp();
  353.     #define DefaultECG2_27_NoiseAmp 0.1
  354.     #define MaxECG2_27_NoiseAmp     0.2
  355.     #define MinECG2_27_NoiseAmp     0.01
  356.  
  357.  
  358.     //Parameter - enableDriftTest
  359.     //    true, enable AAMI EC 13 Drift test; adds 4mVpp 0.1Hz triangle waveform to the ECG signal
  360.     //    false, disable AAMI EC 13 Drift test
  361.     //Return value:
  362.     //  0: succeed
  363.     //  -1: SECG not be initialized
  364.     WHALETEQSECG_SDK_API int SetECG2_27_AAMIDriftTest (bool enableDriftTest);
  365.     WHALETEQSECG_SDK_API bool GetECG2_27_AAMIDriftTest ();
  366.  
  367.     //Parameter - amp:
  368.     //  value range: 0 ~ 5
  369.     //  unit: microvolt(mV)
  370.     //  Default value after InitSECG(): 1mV
  371.     //Parameter - freq:
  372.     //  value range: 10 ~ 50
  373.     //  unit: hertz
  374.     //  Default value after InitSECG(): 40Hz
  375.     //Return value:
  376.     //  0: succeed
  377.     //  -1: SECG not be initialized
  378.     //  -2: current main output function not be "Output_Square"
  379.     //  -3: amp out of range
  380.     //  -4: freq out of range
  381.     WHALETEQSECG_SDK_API int SetDynamicRangeTest(bool OnOff, double amp, double freq);
  382.     WHALETEQSECG_SDK_API bool GetDynamicRangeTest();
  383.     WHALETEQSECG_SDK_API double GetDynamicRangeTestAmp();
  384.     WHALETEQSECG_SDK_API double GetDynamicRangeTestFreq();
  385.     #define DefaultDynamicRangeTestAmp  1.0
  386.     #define MaxDynamicRangeTestAmp      5.0
  387.     #define MinDynamicRangeTestAmp      0
  388.     #define DefaultDynamicRangeTestFreq 40
  389.     #define MaxDynamicRangeTestFreq     50
  390.     #define MinDynamicRangeTestFreq     10
  391.  
  392.     //Parameter - func
  393.     //  main function changed during "Frequency Scanning"
  394.     typedef void (*SyncMainFuncCB)(OutputFunction_E func);
  395.  
  396.     WHALETEQSECG_SDK_API void RegisterSyncMainFuncCB(SyncMainFuncCB cb);
  397.  
  398.     //Parameter - startFreq:
  399.     //  value range: 0.67 ~ 500
  400.     //  unit: hertz
  401.     //  Default value after InitSECG(): 0.67Hz
  402.     //Parameter - stopFreq:
  403.     //  value range: 0.05 ~ 500
  404.     //  unit: hertz
  405.     //  Default value after InitSECG(): 150Hz
  406.     //Parameter - duration:
  407.     //  value range: 10 ~ 180
  408.     //  unit: milisecond(ms)
  409.     //  Default value after InitSECG(): 30ms
  410.     //Return value:
  411.     //  0: succeed
  412.     //  -1: SECG not be initialized
  413.     //  -2: startFreq out of range
  414.     //  -3: stopFreq out of range
  415.     //  -4: duration out of range
  416.     //"Output Function" would be set to "Output_Sine" when setting "OnOff" as true,
  417.     //then "Frequency" would be locked(SetFrequency() return -3) for periodly scanning change.
  418.     //"Output Function" would be set to "Output_Off" when setting "OnOff" as false.
  419.     WHALETEQSECG_SDK_API int SetFreqScanSine(bool OnOff, double startFreq,
  420.                                              double stopFreq, int duration);
  421.     WHALETEQSECG_SDK_API bool GetFreqScanSine();
  422.     WHALETEQSECG_SDK_API double GetFreqScanSineStartFreq();
  423.     WHALETEQSECG_SDK_API double GetFreqScanSineStopFreq();
  424.     WHALETEQSECG_SDK_API int GetFreqScanSineDuration();
  425.     #define DefaultScanSineStartFreq    0.67
  426.     #define DefaultScanSineStopFreq     150
  427.     #define MaxScanSineFreq             500.0
  428.     #define MinScanSineFreq             0.67
  429.     #define DefaultScanSineDuration     30
  430.     #define MaxScanSineDuration         180
  431.     #define MinScanSineDuration         10
  432.  
  433.     //Start Frequency as 3BPM(0.05Hz)
  434.     //Stop Frequency as 30BPM(0.5Hz)
  435.     //Duration as 30ms
  436.     //"Output Function" would be set to "Output_ECG2_27" when setting "OnOff" as true,
  437.     //then "Frequency" would be locked(SetFrequency() return -3) for periodly scanning change.
  438.     //"Output Function" would be set to "Output_Off" when setting "OnOff" as false.
  439.     WHALETEQSECG_SDK_API int SetFreqScanECG(bool OnOff);
  440.     WHALETEQSECG_SDK_API bool GetFreqScanECG();
  441.  
  442.     //Return value:
  443.     // >0: succeed, the number of sample data loaded
  444.     // -1: Open file failed
  445.     // -2: Can't solve sample rate in Line 1
  446.     // -3: Can't solve sample number in Line 2
  447.     // -4: Raw data file is too large to fit the memory
  448.     WHALETEQSECG_SDK_API int LoadECGtxt(wchar_t* file);
  449.     WHALETEQSECG_SDK_API int LoadECGbin(wchar_t* file);
  450.  
  451.     WHALETEQSECG_SDK_API char* GetSDKVersion();
  452. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top