Skip to main content

TS28B

API Reference

Import TS28B Module

import {
TS28BModule,
TS28BProfileModule
} from '@ihealth/ihealthlibrary-react-native';

Add and remove listener

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

// remove
notifyListener.remove();

set measurement listener

TS28BModule.measure(mac);

// response
notifyListener = DeviceEventEmitter.addListener(TS28BModule.Event_Notify, (event) => {
if (event.action === TS28BProfileModule.ACTION_MEASUREMENT_RESULT) {
console.log(event[TS28BProfileModule.RESULT]);
console.log(event[TS28BProfileModule.UNIT_FLAG]);
}
});