summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/module/BG1Module.js
blob: ed55f2cda7333329b6b2b003575cda8ad73091ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';


var { NativeModules } = require('react-native');

var RCTModule = NativeModules.BG1Module

/**
 * @module BG1Module
 */
module.exports = {
  Event_Notify: RCTModule.Event_Notify,

    /**
   * Send code to bg1 device
   * @param {string} QRCode the result string of scanning strip bottle(ignore if use GDH strip)
   * @param {int} stripType 1:GOD      2:GDH
   * @param {int} measureType 1:Test with Blood    2:Test with control liquid (CTL)
   */
	sendCode: function(QRCode, stripType, measureType) {
    if (RCTModule != null) {
      RCTModule.sendCode(QRCode, stripType, measureType);
    }else {
      console.log('~~~~~ RCTModule is null')
    }
	},

  /**
   * Parse bottle info from QRCode, include strip expire time,strip number,bottle id
   * @param {string} QRCode
   */
  getBottleInfoFromQR: function(QRCode){
    if (RCTModule != null) {
      RCTModule.getBottleInfoFromQR(QRCode);
    }else {
      console.log('~~~~~ RCTModule is null')
    }
  }

}