4 Star 9 Fork 1

studentzxc / IonicBluetoothSerial

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README

基于ionic的蓝牙通讯框架

Service bluetoothHelper

封装bluetoothSerialenablelist等细节,便于其他模块使用

init

  • type : function
  • parameters
    1. deviceName : string | 要连接的蓝牙名称
  • return : promise | 连接成功时resolve,失败时reject
  • 此函数先开启蓝牙,然后在已配对设备中寻找deviceName,最后进行连接。未开启蓝牙、未配对或者连接失败都将导致reject

subscribe

  • type : function
  • parameters
    1. fn : function | 当蓝牙收到数据时要调用的函数
    2. length : number | 缓冲的字节长度。在缓冲区长度达到length时才调用fn
  • 注册一个回调函数用于监听蓝牙数据

write

  • type : function
  • parameters
    1. data : ArrayBuffer or Uint8Array or int[] or string | 要向蓝牙发送的数据
  • return : promise | 发送成功时resolve,失败时reject

disconnect

  • type : function
  • parameters : none
  • return : promise | 断开成功时resolve,失败时reject

空文件

简介

基于ionic的与蓝牙通讯框架 展开 收起
JavaScript
取消

发行版

暂无发行版

贡献者

全部

近期动态

加载更多
不能加载更多了
JavaScript
1
https://gitee.com/studentzxc/IonicBluetoothSerial.git
git@gitee.com:studentzxc/IonicBluetoothSerial.git
studentzxc
IonicBluetoothSerial
IonicBluetoothSerial
master

搜索帮助