0.1.19 • Published 5 months ago

react-native-bt-sdk-trops v0.1.19

Weekly downloads
-
License
MIT
Repository
github
Last release
5 months ago

react-native-bt-sdk-trops

BLE

安装

npm install react-native-bt-sdk-trops

监听器

蓝牙回调

使用

DeviceEventEmitter.addListener("Monitor", (data) => {
  console.log("monitor", data);
});

格式

type
0扫描设备
1硬件发送
2硬件回调
{
    type:0, 
    data:"扫描失败"
}

脚环方法

import { init } from 'react-native-bt-sdk-trops';


const result = await init();

初始化

const data = await init();
console.log(data);

搜索蓝牙设备

const data = await startScan();
console.log(data);

连接蓝牙设备

const data = await connect(mac);
console.log(data);

设置用户Id

const data = await setDebugUserId();
console.log(data);

订阅

const data = await notify(mac);
console.log(data);

脚环方法

绑定用户id

参数

  1. MAC地址
  2. 用户id
bindUser(address, id);

解绑用户id

参数

  1. MAC地址
  2. 用户id
unBindUser(address, id);

获取设备信息

queryHardwareInfo();

获取设备状态

queryHardwareStatus();

请求实时数据

startRealData();

结束实时数据

stopRealData();

开始数据采集

startGatherData();

结束数据采集

stopGatherData();

获取传感器文件信息

getFileInfo();

传输传感器文件

参数:

  1. 传1 代表1号文件 2代表2号文件
  2. 文件大小
requestFile(fileIndex, size);

删除传感器文件

参数

  1. 传1 代表1号文件 2代表2号文件
deleteFile(fileIndex);

获取log文件信息

getLogFileInfo();

传输log文件

参数

  1. 传1 代表1号文件 2代表2号文件
  2. 文件大小
requestLogFile(fileIndex, size);

删除log文件

参数

  1. 传1 代表1号文件 2代表2号文件
deleteLogFile(fileIndex);

更新蓝牙名字

参数

  1. 蓝牙名称
updateBtName(btName);

更新设备时间

updateTime();

更新固件(DFU)

参数

  1. uri
ota(path);

关机

requestPowerOff();

贡献

See the contributing guide to learn how to contribute to the repository and the development workflow.

许可证

MIT


Made with create-react-native-library

0.1.19

5 months ago

0.1.11

5 months ago

0.1.12

5 months ago

0.1.13

5 months ago

0.1.14

5 months ago

0.1.15

5 months ago

0.1.16

5 months ago

0.1.17

5 months ago

0.1.18

5 months ago

0.1.10

5 months ago

0.1.8

5 months ago

0.1.7

5 months ago

0.1.9

5 months ago

0.1.6

5 months ago

0.1.5

5 months ago

0.1.2

5 months ago

0.1.1

5 months ago

0.1.4

5 months ago

0.1.3

5 months ago

0.1.0

5 months ago