123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- <!--index.wxml-->
- <view class="container">
- <view class="userinfo">
- <button wx:if="{{!hasUserInfo && canIUse}}" open-type="getUserInfo" bindgetuserinfo="getUserInfo"> 获取头像昵称 </button>
- <block wx:else>
- <image bindtap="bindViewTap" class="userinfo-avatar" src="{{userInfo.avatarUrl}}" mode="cover"></image>
- <text class="userinfo-nickname">{{userInfo.nickName}}</text>
- </block>
- </view>
- <view class="usermotto">
- <text class="user-motto">{{motto}}</text>
-
- <button bindtap='openDoor'>开启</button>
- <button bindtap='openadapter'>打开适配器</button>
- <button bindtap='closeadapter'>关闭适配器</button>
- <button bindtap='opendiscovery'>开始搜索</button>
- <button bindtap='closediscovery'>关闭搜索</button>
- <button bindtap='getdevice'>获取设备</button>
- <button bindtap='getconnecteddevice'>获取已连接设备</button>
- <button bindtap='connecteddevice'>连接我的设备</button>
- <button bindtap='getservice'>获取服务</button>
- <button bindtap='getcharacteristics'>获取特征值</button>
- <button bindtap='startread'>读取值</button>
- <button bindtap='startnotify'>开启notify</button>
- <button bindtap='startwrite'>写数据</button>
- <view v-for="(item,index) in devices" :key="index" bindtap="createBLEConnection(item)" class="device_item"
- hover-class="device_item_hover">
- {{item.name}}
- 信号强度: {{item.RSSI}}dBm {{Math.max(0, item.RSSI + 100)}}%
- UUID: {{item.deviceId}}
- Service数量: {{item.advertisServiceUUIDs.length}}
- 已连接到 {{name}}
- 特性UUID: {{item.uuid}}
- 特性值: {{item.value}}
- </view>
- </view>
- </view>
|