summaryrefslogtreecommitdiff
path: root/libs/ihealth-sdk/doc/nt13b.md
diff options
context:
space:
mode:
Diffstat (limited to 'libs/ihealth-sdk/doc/nt13b.md')
-rw-r--r--libs/ihealth-sdk/doc/nt13b.md38
1 files changed, 38 insertions, 0 deletions
diff --git a/libs/ihealth-sdk/doc/nt13b.md b/libs/ihealth-sdk/doc/nt13b.md
new file mode 100644
index 0000000..6fd45ee
--- /dev/null
+++ b/libs/ihealth-sdk/doc/nt13b.md
@@ -0,0 +1,38 @@
1# NT13B Workflow
2
3## Import NT13B Module
4
5```js
6import {
7 NT13BModule,
8 NT13BProfileModule
9} from '@ihealth/ihealthlibrary-react-native';
10```
11
12## APIs
13
14### Add and remove listener
15
16```js
17// add
18notifyListener = DeviceEventEmitter.addListener(NT13BModule.Event_Notify, (event) => {
19 console.log(event);
20});
21
22// remove
23notifyListener.remove();
24```
25
26### set measurement listener
27
28```js
29NT13BModule.measure(mac);
30
31// response
32notifyListener = DeviceEventEmitter.addListener(NT13BModule.Event_Notify, (event) => {
33 if (event.action === NT13BProfileModule.ACTION_MEASUREMENT_RESULT) {
34 console.log(event[NT13BProfileModule.RESULT]);
35 console.log(event[NT13BProfileModule.UNIT_FLAG]);
36 }
37});
38``` \ No newline at end of file