微信小程序蓝牙连接小票打印机实例代码详解

微信小程序蓝牙连接小票打印机实例代码详解


2024年5月30日发(作者:)

(e)

ading()

},

complete: function(e) {

(e)

}

})

}

3.连接成功后保存连接状态

getSeviceId: function() {

var that = this

var platform = rm

(Id)

DeviceServices({

deviceId: Id,

success: function(res) {

a({

services: es

})

racteristics()

},

fail: function(e) {

(e)

},

complete: function(e) {

(e)

}

})

}

getCharacteristics: function() {

var that = this

var list = es

var num = eId

var write = haracter

var read = aracter

var notify = Character

DeviceCharacteristics({

deviceId: Id,

serviceId: list[num].uuid,

success: function(res) {

(res)

for (var i = 0; i < ; ++i) {

var properties = teristics[i].properties

var item = teristics[i].uuid

if (!notify) {

if () {

CharaterId = item

ServiceId = list[num].uuid

notify = true

}

}

if (!write) {

if () {

haraterId = item

erviceId = list[num].uuid

write = true

}

}

if (!read) {

if () {

araterId = item

rviceId = list[num].uuid

read = true

}

}

}

if (!write || !notify || !read) {

num++

a({

writeCharacter: write,

readCharacter: read,

notifyCharacter: notify,

serviceId: num

})


发布者:admin,转转请注明出处:http://www.yc00.com/news/1717047474a2733259.html

相关推荐

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信