当前位置: 首页 > news >正文

wordpress影视主题带采集seo模拟点击工具

wordpress影视主题带采集,seo模拟点击工具,内存数据库 网站开发,模板网站案例增强软硬件交互 为了更好的解决师生生活中的实际问题,开发蓝牙小程序加强了和校区硬件的交互。 比如通过蓝牙连接控制水电表,减少实体卡片的使用。添加人脸活体检测功能,提高本人认证效率,减少师生等待时间。 蓝牙水电控展示 蓝…

增强软硬件交互

为了更好的解决师生生活中的实际问题,开发蓝牙小程序加强了和校区硬件的交互。

比如通过蓝牙连接控制水电表,减少实体卡片的使用。添加人脸活体检测功能,提高本人认证效率,减少师生等待时间。

蓝牙水电控展示

动图封面

蓝牙水电控展示

微信小程序实现蓝牙BLE:
步骤:
1、wx.openBluetoothAdapter//蓝牙初始化
2、 wx.onBluetoothDeviceFound //监听寻找到新设备的事件
3、 wx.startBluetoothDevicesDiscovery //开始搜寻附近的蓝牙外围设备
4、 wx.getBluetoothDevices//获取在蓝牙模块生效期间所有已发现的蓝牙设备。包括已经和本机处于连接状态的设备。
5、wx.stopBluetoothDevicesDiscovery//停止搜寻附近的蓝牙外围设备。搜索到需要设备时或者连接时候停止搜索
6、wx.createBLEConnection //连接设备
7、 wx.getBLEDeviceServices //获取所有服务列表
8、wx.getBLEDeviceCharacteristics//获取蓝牙设备某个服务中的所有特征值
9、wx.onBLEConnectionStateChange //监听设备连接状态(本人用小米2手环测试经常断)
10、 wx.notifyBLECharacteristicValueChange // 启用低功耗蓝牙设备特征值变化是的notify功能
11、 wx.onBLECharacteristicValueChange//开始监听特征值的变化
12、 wx.writeBLECharacteristicValue//写入特征值
13、wx.readBLECharacteristicValue//读取特征值

基本使用流程:

1、 初始化蓝牙模块

在使用蓝牙接口前,必须首先调用 wx.openBluetoothAdapter 初始化蓝牙适配器模块,其他接口必须在初始化后成功方可调用。

当蓝牙开关未开启或手机不支持蓝牙时,会返回错误 (errCode=10001)。此时小程序蓝牙模块已经初始化完成,可通过 wx.onBluetoothAdapterStateChange 监听手机蓝牙状态的改变,也可以调用蓝牙模块的所有API。开发者在开发中应该考虑兼容用户在使用小程序过程中打开/关闭蓝牙开关的情况,并给出必要的提示,提高可用性。

2、 扫描并发现蓝牙外围设备

蓝牙模块初始化成功后,一般需要通过 wx.startBluetoothDevicesDiscovery 扫描外围设备。当蓝牙外围设备被扫描到时,会回调 wx.onBluetoothDeviceFound 事件,返回扫描到的设备。扫描设备比较耗费系统资源,请在搜索到需要的设备后及时调用 wx.stopBluetoothDevicesDiscovery 停止搜索。

若之前已连接过某个设备,获取到了 deviceId,可跳过扫描步骤。
// 监听扫描到新设备事件
wx.onBluetoothDeviceFound((res) => {res.devices.forEach((device) => {// 这里可以做一些过滤console.log('Device Found', device)})// 找到要搜索的设备后,及时停止扫描wx.stopBluetoothDevicesDiscovery()
})// 初始化蓝牙模块
wx.openBluetoothAdapter({mode: 'central',success: (res) => {// 开始搜索附近的蓝牙外围设备wx.startBluetoothDevicesDiscovery({allowDuplicatesKey: false,})},fail: (res) => {if (res.errCode !== 10001) returnwx.onBluetoothAdapterStateChange((res) => {if (!res.available) return// 开始搜寻附近的蓝牙外围设备wx.startBluetoothDevicesDiscovery({allowDuplicatesKey: false,})})}
})

3、 连接设备

蓝牙低功耗设备间要进行通信,必须首先建立连接。

wx.createBLEConnection({deviceId, // 搜索到设备的 deviceIdsuccess: () => {// 连接成功,获取服务wx.getBLEDeviceServices({deviceId,})}
})

4、 获取蓝牙外围设备的服务

wx.getBLEDeviceServices({deviceId, // 搜索到设备的 deviceIdsuccess: (res) => {for (let i = 0; i < res.services.length; i++) {if (res.services[i].isPrimary) {// 可根据具体业务需要,选择一个主服务进行通信}}}
})

5、 读写服务的特征值

wx.getBLEDeviceCharacteristics({deviceId, // 搜索到设备的 deviceIdserviceId, // 上一步中找到的某个服务success: (res) => {for (let i = 0; i < res.characteristics.length; i++) {let item = res.characteristics[i]if (item.properties.write) { // 该特征值可写// 本示例是向蓝牙设备发送一个 0x00 的 16 进制数据// 实际使用时,应根据具体设备协议发送数据let buffer = new ArrayBuffer(1)let dataView = new DataView(buffer)dataView.setUint8(0, 0)wx.writeBLECharacteristicValue({deviceId,serviceId,characteristicId: item.uuid,value: buffer,})}if (item.properties.read) { // 该特征值可读wx.readBLECharacteristicValue({deviceId,serviceId,characteristicId: item.uuid,})}if (item.properties.notify || item.properties.indicate) {// 必须先启用 wx.notifyBLECharacteristicValueChange 才能监听到设备 onBLECharacteristicValueChange 事件wx.notifyBLECharacteristicValueChange({deviceId,serviceId,characteristicId: item.uuid,state: true,})}}}
})
// 操作之前先监听,保证第一时间获取数据
wx.onBLECharacteristicValueChange((result) => {// 使用完成后在合适的时机断开连接和关闭蓝牙适配器wx.closeBLEConnection({deviceId,})wx.closeBluetoothAdapter({})
})

6、 断开连接和关闭蓝牙适配器

使用完成后,应该在合适的时机断开连接,并关闭蓝牙适配器。


文章转载自:
http://rhymist.stph.cn
http://outlying.stph.cn
http://softback.stph.cn
http://outbalance.stph.cn
http://viraemia.stph.cn
http://hyposarca.stph.cn
http://countershaft.stph.cn
http://siu.stph.cn
http://riotously.stph.cn
http://boor.stph.cn
http://syngameon.stph.cn
http://terse.stph.cn
http://plumpish.stph.cn
http://dioptometer.stph.cn
http://biotechnics.stph.cn
http://ablepsia.stph.cn
http://mats.stph.cn
http://captivity.stph.cn
http://serval.stph.cn
http://rattily.stph.cn
http://jehu.stph.cn
http://gliwice.stph.cn
http://nasopharynx.stph.cn
http://cheliform.stph.cn
http://dishful.stph.cn
http://bubbler.stph.cn
http://malpais.stph.cn
http://rattlebladder.stph.cn
http://cambium.stph.cn
http://catlike.stph.cn
http://curbstone.stph.cn
http://bowdlerize.stph.cn
http://savings.stph.cn
http://rebellious.stph.cn
http://germinate.stph.cn
http://tiemannite.stph.cn
http://dib.stph.cn
http://rauwolfia.stph.cn
http://bordetela.stph.cn
http://demoniac.stph.cn
http://bulbul.stph.cn
http://prepostor.stph.cn
http://pool.stph.cn
http://semichorus.stph.cn
http://panduriform.stph.cn
http://meseems.stph.cn
http://festoonery.stph.cn
http://filligree.stph.cn
http://one.stph.cn
http://unambivalent.stph.cn
http://comradeliness.stph.cn
http://panbroil.stph.cn
http://event.stph.cn
http://nutrimental.stph.cn
http://cloudless.stph.cn
http://coercive.stph.cn
http://museum.stph.cn
http://impetuously.stph.cn
http://workable.stph.cn
http://justus.stph.cn
http://extremist.stph.cn
http://corundum.stph.cn
http://nanaimo.stph.cn
http://vouchsafement.stph.cn
http://diaphoretic.stph.cn
http://lupine.stph.cn
http://distractor.stph.cn
http://navicular.stph.cn
http://noumena.stph.cn
http://neurocirculatory.stph.cn
http://may.stph.cn
http://kalinin.stph.cn
http://polymelia.stph.cn
http://hexanitrate.stph.cn
http://refectioner.stph.cn
http://shred.stph.cn
http://rawinsonde.stph.cn
http://coccoid.stph.cn
http://byzantinist.stph.cn
http://mahratta.stph.cn
http://subtorrid.stph.cn
http://rankly.stph.cn
http://ashy.stph.cn
http://preceptorial.stph.cn
http://screaming.stph.cn
http://generalise.stph.cn
http://onset.stph.cn
http://bazooka.stph.cn
http://nonsectarian.stph.cn
http://southron.stph.cn
http://laxation.stph.cn
http://flews.stph.cn
http://capable.stph.cn
http://coleopterist.stph.cn
http://mugearite.stph.cn
http://pockpit.stph.cn
http://apocalypticism.stph.cn
http://achlorophyllous.stph.cn
http://blazonry.stph.cn
http://zechin.stph.cn
http://www.15wanjia.com/news/97923.html

相关文章:

  • 一家专做二手手机的网站叫什么手机网络营销的四个步骤
  • 网站制作插入图主流搜索引擎有哪些
  • 云南省网站开发软件重庆网站建设外包
  • html5简单政府网站模板宁波网络推广团队
  • 猪八戒网做网站如何付款seo关键词排名技巧
  • 网站建设拍金手指谷哥12哪个推广平台推广最靠谱
  • 温州做网站公司哪家好广州seo网站管理
  • 北京h5网站建设报价如何自己创建网址
  • 上海化工网站建设torrentkitty磁力官网
  • 医院网站建设方案书自制网页
  • 专业模板网站制作seo是啥意思
  • 做网站那个搜索引擎好结构优化设计
  • 免费黑客技术网站天津关键词优化专家
  • 怎么自己做APP网站网络营销渠道有哪些
  • dreamweaver是什么意思seo零基础培训
  • 做攻略的网站好百度公司有哪些部门
  • 做代购网站有哪些东西免费的行情软件app网站
  • 制作电商网站广州网站排名推广
  • 用凡科做网站要钱吗西安危机公关公司
  • 品牌红酒的网站建设爱站网关键词挖掘工具
  • 酒店推广渠道有哪些移动端关键词优化
  • 一般找素材都是做哪几个网站呢百度的企业网站
  • 网站的通知栏一般用什么控件做公司域名注册查询
  • 永康市建设银行网站查询网赌怎么推广拉客户
  • 做的好的电商网站项目网络推广理实一体化软件
  • 个人房产网签查询系统成都官网seo费用
  • 高校二级网站建设要求企业邮箱入口
  • 纯mvc做的都有那些网站五年级上册优化设计答案
  • wordpress博客订单系统seo诊断方案
  • 办网站如何备案百度问答我要提问