4 Star 9 Fork 1

studentzxc / IonicBluetoothSerial

Create your Gitee Account
Explore and code with more than 8 million developers,Free private repositories !:)
Sign up
This repository doesn't specify license. Please pay attention to the specific project description and its upstream code dependency when using it.
Clone or Download
Cancel
Notice: Creating folder will generate an empty file .keep, because not support in Git
Loading...
README.md

基于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

Repository Comments ( 0 )

Sign in to post a comment

About

基于ionic的与蓝牙通讯框架 expand collapse
JavaScript
Cancel

Releases

No release

IonicBluetoothSerial

Contributors

All

Activities

Load More
can not load any more
JavaScript
1
https://gitee.com/studentzxc/IonicBluetoothSerial.git
git@gitee.com:studentzxc/IonicBluetoothSerial.git
studentzxc
IonicBluetoothSerial
IonicBluetoothSerial
master

Search

挂件 关闭按钮