代码拉取完成,页面将自动刷新
ionic
的蓝牙通讯框架ionic
: http://ionicframework.com/
bluetoothserial
插件 : https://github.com/don/BluetoothSerial
ngCordova
: http://ngcordova.com/
bluetoothHelper
封装bluetoothSerial
的enable
、list
等细节,便于其他模块使用
init
function
deviceName
: string
| 要连接的蓝牙名称promise
| 连接成功时resolve,失败时rejectdeviceName
,最后进行连接。未开启蓝牙、未配对或者连接失败都将导致rejectsubscribe
function
fn
: function
| 当蓝牙收到数据时要调用的函数length
: number
| 缓冲的字节长度。在缓冲区长度达到length
时才调用fn
write
function
data
: ArrayBuffer
or Uint8Array
or int[]
or string
| 要向蓝牙发送的数据promise
| 发送成功时resolve,失败时rejectdisconnect
function
promise
| 断开成功时resolve,失败时reject此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。
1. 开源生态
2. 协作、人、软件
3. 评估模型