Skip to main content

BG1A

info
  1. BG1A is a low-power Bluetooth glucose meter with indicator lights, but without a screen or buttons.
  2. The BG1A is only turned on by inserting test strip.
  3. BG1A only support online measurement.
  4. Once the device is turned on, it begins Bluetooth broadcasting and can be scanned and connected to by the app.
  5. After blood glucose measurement is completed, or the test strip is removed, the device will shut down and Bluetooth will also disconnect.

API Reference

Import BG1A module

import {
BG1AModule,
BG1AProfileModule
} from '@ihealth/ihealthlibrary-react-native';

Add and remove listener

// add
notifyListener = DeviceEventEmitter.addListener(BG1AModule.Event_Notify, (event) => {
console.log(event);
});

// remove
notifyListener.remove();

Get All connected BG1A devices

Return all connected devices.

BG1AModule.getAllConnectedDevices()

// Response
const notifyListener = DeviceEventEmitter.addListener(BG1AModule.Event_Notify, (event) => {
if (event.action === BG1AProfileModule.ACTION_GET_ALL_CONNECTED_DEVICES) {
// Example: {"action":"action_get_all_connected_devices","devices":["004D32DDC704"]}
console.log(event);
}
});

Get BG1A device information

BG1AModule.getDeviceInfo(mac);

// Response
const notifyListener = DeviceEventEmitter.addListener(BG1AModule.Event_Notify, (event) => {
if (event.action === BG1AProfileModule.ACTION_GET_DEVICE_INFO) {
// Example: {"accessoryname": "BG1A", "action": "action_get_device_info", "battery": 20, "firmwareversion": "1.0.0", "hardwareversion": "3.0.0", "info_history_status_bg1a": 0, "info_local_time": "2023-08-23 11:07:34", "mac": "004D323146E3", "manufacture": "iHealth", "modenumber": "BG1A 11070", "protocol": "com.jiuan.BGV44", "type": "BG1A"}
console.log(event);
}
});

Set BG1A measurement mode

/**
* mode type
* 0: Blood mode
* 1: CTL mode
* */
BG1AModule.setMeasureMode(mac, mode);

// response
const notifyListener = DeviceEventEmitter.addListener(BG1AModule.Event_Notify, (event) => {
if (event.action === BG1AProfileModule.ACTION_SET_MEASURE_MODE) {
// Example: {status: 0, type: 'BG1A', mac: '004D32DDC704', action: 'action_set_measure_mode'}
console.log(event);

} else if (event.action === BG1AProfileModule.ACTION_ERROR_BG1A) {
// Please finish this measurement, before set measurement mode
// Example: {type: 'BG1A', mac: '004D32DDC704', action: 'action_error', "error_num": 240}
console.log(event);

}
});

Set BG1A device time

BG1AModule.setDeviceTime(mac);

// response
const notifyListener = DeviceEventEmitter.addListener(BG1AModule.Event_Notify, (event) => {
if (event.action === BG1AProfileModule.ACTION_SET_DEVICE_TIME) {
// Example: {status: 0, type: 'BG1A', mac: '004D32DDC704', action: 'action_set_device_time'}
console.log(event);
}
});

Get BG1A history data

BG1AModule.getHistoryData(mac);

// Response
const notifyListener = DeviceEventEmitter.addListener(BG1AModule.Event_Notify, (event) => {
if (event.action === BG1AProfileModule.ACTION_MEASURE_RESULT_HISTORY) {
// Example: {"action": "action_measure_result_history", "history": [{"error_num": 0, "measure_time_device": "2023-08-23 11:25:20", "measure_time_is_error": 0, "mode": 0, "result": 89}], "mac": "004D323146E3", "type": "BG1A"}
console.log(event);
}
});

Delete BG1A history data

BG1AModule.deleteHistoryData(mac);

// Response
const notifyListener = DeviceEventEmitter.addListener(BG1AModule.Event_Notify, (event) => {
if (event.action === BG1AProfileModule.ACTION_DELETE_HISTORY_RESULT) {
// Example: {"action": "action_delete_history_result", "mac": "004D323146E3", "type": "BG1A"}
console.log(event);
}
});

Start a measurement

BG1A don't have power button, when you insert test strip into moniter, BG1A will open and begin Bluetooth broadcasting. When BG1A is connected, it will return the strip insertion status.

// response
const notifyListener = DeviceEventEmitter.addListener(BG1AModule.Event_Notify, (event) => {
if (event.action === BG1AProfileModule.ACTION_STRIP_INSERTION_STATUS) {
// {"action": "action_strip_insertion_status", "mac": "004D323146E3", "status": 1, "stripType": 1, "type": "BG1A"}
if (0 == status) {
Log.i("The test strip is inserted, and blood can be dripped.");

} else if (1 == status) {
Log.i("The test strip is removed.");

} else if (2 == status) {
Log.i("Blood sucking starts.");

} else if (3 == status) {
Log.i("The blood sucking volume is insufficient for 1.");

} else if (4 == status) {
Log.i("The blood sucking volume is insufficient for 1 state for more than 5 seconds.");

} else if (5 == status) {
Log.i("The blood sucking volume is insufficient for 2.");

} else if (6 == status) {
Log.i("The blood sucking is completed.");

}

} else if (event.action === BG1AProfileModule.ACTION_MEASURE_RESULT) {
// {"action": "action_measure_result", "mac": "004D32DDC704", "measure_result": 0, "type": "BG1A"}
console.log(event[BG1AProfileModule.MEASURE_MODE]);
console.log(event[BG1AProfileModule.MEASURE_RESULT]);
}
});