微信小程序> 微信小程序蓝牙通讯蓝牙模块demo

微信小程序蓝牙通讯蓝牙模块demo

浏览量:1738 时间: 来源:HY_358116732

开发微信小程序蓝牙的项目,第一次搞,遇到2个坑:

1.安卓和苹果获取的硬件服务UUID顺序不同

2.目前用的这一版 “启用低功耗蓝牙设备特征值变化时的 notify 功能”在安卓和苹果的测试机上都返回启动失败,其实是已经启动成功,在我同事安卓手机上返回的正常。

index.wxml

[html] view plain copy
  1. !--index.wxml--  
  2. view class="content"  
  3.   text class="status"适配器状态:{{ status }}/text  
  4.   text class="sousuo"是否搜索:{{ sousuo }}/text  
  5.   text class="msg"消息:{{ msg }} /text  
  6.   text class="msg1"消息:{{ msg1 }}/text  
  7.   button type="primary" class="button" bindtap="lanya1"1初始化蓝牙适配器/button  
  8.   button type="primary" class="button" bindtap="lanya2"2本机蓝牙适配状态/button  
  9.   button type="primary" class="button" bindtap="lanya3"3搜索周边设备/button  
  10.   button type="primary" class="button" bindtap="lanya4"4获取设备后在列表中连接/button  
  11.   button type="primary" class="button" bindtap="lanya5"5停止搜索周边设备/button  
  12.   button type="primary" class="button" bindtap="lanya6"6获取连接设备所有service/button  
  13.   button type="primary" class="button" bindtap="lanya7"7获取连接设备所有特征值/button  
  14.   button type="primary" class="button" bindtap="lanya8"8发送指定消息/button  
  15.   button type="primary" class="button" bindtap="lanya9"9启用设备特征值变化时的notify/button  

版权声明

即速应用倡导尊重与保护知识产权。如发现本站文章存在版权问题,烦请提供版权疑问、身份证明、版权证明、联系方式等发邮件至197452366@qq.com ,我们将及时处理。本站文章仅作分享交流用途,作者观点不等同于即速应用观点。用户与作者的任何交易与本站无关,请知悉。

产品经理

手机 : 13312967497

擅长 : 小程序流量变现

扫码领取礼包

热门模板

  • 头条
  • 搜狐
  • 微博
  • 百家
  • 一点资讯
  • 知乎