-
蓝牙打印机
2018-03-16 11:32:41这是基于手机的,使用android设备连接打印机 并且进行打印。 -
安卓蓝牙打印机
2013-10-18 13:36:55安卓手机通过蓝牙设备连接蓝牙打印机,实现打印功能。 -
mu蓝牙打印机demo
2019-01-17 14:44:11mui蓝牙打印机 -
android 蓝牙打印机
2018-04-14 11:33:49android 蓝牙打印机,打印菜单小票和图片,对蓝牙配对和连接打印功能进行了封装,让你超快实现蓝牙打印功能。 -
安卓蓝牙打印机源码
2018-09-21 09:34:35安卓蓝牙打印机源码. -
安卓手机通过蓝牙设备连接蓝牙打印机.zip
2020-12-11 13:22:31手机通过蓝牙设备连接蓝牙打印机.zip -
蓝牙打印机解决的方案
2020-08-09 09:32:58本文介绍了蓝牙打印机解决方案、蓝牙数据传输解决方案; -
蓝牙打印机 _漠北
2018-11-15 11:31:49delphi控制蓝牙打印机打印热敏纸,标签,二维码等内容 -
h5+连接蓝牙打印机打印小票
2019-12-09 16:58:11h5+连接蓝牙打印机打印小票,h5+调用蓝牙打印机打印小票。运用框架:mui.js;jquery。h5+连接蓝牙打印机,并打印小票,打印机指令集esc/pos。 -
爱客仕蓝牙打印机用户手册
2018-05-31 17:17:40爱客仕蓝牙打印机用户手册。爱客仕蓝牙打印机用户手册 -
android连接蓝牙打印机
2018-06-22 11:54:58该demo实现了android手机连接蓝牙打印机的基本功能,可以打印二维码,图片和文字 -
小程序调用蓝牙打印机完整代码
2019-02-12 16:34:35此代码为小程序调用蓝牙打印机完整代码,有蓝牙打印机的情况下可直接扫码进行真机调试 -
佳博ZH380蓝牙打印机demo
2019-02-18 13:35:34佳博ZH380蓝牙打印机demo -
Android对接蓝牙打印机
2019-06-12 08:31:521、搞清自己蓝牙打印机型号 我对接的是佳博PT260蓝牙打印机,参数如下: 2、下载SDK 对接不同品牌的蓝牙打印机要下载相应品牌的SDK,因此我去佳博官网,点了漂浮在右侧的技术咨询 输入关键词“SDK”,点击第一个...1、搞清自己蓝牙打印机型号
我对接的是佳博PT260蓝牙打印机,参数如下:
2、下载SDK
对接不同品牌的蓝牙打印机要下载相应品牌的SDK,因此我去佳博官网,点了漂浮在右侧的技术咨询
转人工客服,说明要对接蓝牙打印机,跟技术要最新sdk即可我已经下载好了,所以你可以直接去我的网盘下载
链接:https://pan.baidu.com/s/1osbShTnZxseUZTjH9jTMqw
提取码:84fg3、查看demo
打开技术发给我们的sdk,要对接蓝牙打印机需要用到以下三个文件
用AS打开GpsdkDemo,可能需要修改以下两个地方才能运行此Demo1、local.properties中的sdk和ndk地址
2、build.gradle中的compile
改为implementation
点击蓝牙连接,找到开头为“Printer_”的设备连接上就可以开始测试了
4、查看demo源码,放到自己项目
5、注意
现在对接的是佳博的蓝牙打印机,所以用的佳博的sdk,如果想做一个通用的项目,对接所有的蓝牙打印机,可以不使用佳博的sdk
蓝牙的扫描、配对、连接等都是通用的,具体可以通过Android蓝牙开发—经典蓝牙详细开发流程这篇文章写,通过这篇文章,可以正确的连接蓝牙打印机了
至于打印,可以参考Android 蓝牙连接 ESC/POS 热敏打印机打印(ESC/POS指令篇)这篇文章,同时
VitaminChen
这位作者的文章中也提供了一个蓝牙打印机的demo,通过这篇文章,可以正确打印出小票了 -
Android蓝牙打印机开发源代码.rar
2019-09-11 09:28:54Android蓝牙开发源代码,连接蓝牙打印机,打印标签、条码等。 Android 蓝牙打印机(ESC/POS 热敏打印机),打印小票和图片,对蓝牙配对和连接打印功能进行了封装,让你超快实现蓝牙打印功能。 -
WINCE蓝牙打印机软件
2014-07-07 10:24:48基于WINDOWS CE 6.0下的微型蓝牙打印机控制、测试软件,C# 2008开发 -
蓝牙案例(设备连接蓝牙打印机实现打印).7z
2020-12-10 13:38:58android设备连接蓝牙打印机,并实现打印功能 -
Android蓝牙打印机apk
2014-12-01 16:21:24基于android 系统的蓝牙打印机demo,可与android 手机连接,并控制打印 -
小程序连接蓝牙打印机
2019-01-14 11:40:55小程序连接蓝牙打印机小程序连接蓝牙打印机
1.openBluetoothAdapter初始化蓝牙适配器
wx.openBluetoothAdapter({ success: function (res) { console.log('---初始化蓝牙适配器状态---'); console.log(res); } })
res结果,errcode = 10001,当前蓝牙适配器不可用,本机蓝牙没打开。2.getBluetoothAdapterState获取蓝牙适配器状态,如果蓝牙未开或不可用,这里可用检测到
wx.getBluetoothAdapterState({ success: function (res) { console.log('---获取本机蓝牙适配器状态---'); console.log(res); // res.discovering ? "在搜索。" : "未搜索。", // res.available ? "可用。" : "不可用。", } })
3.开始搜索蓝牙设备startBluetoothDevicesDiscovery() , 提示蓝牙搜索wx.startBluetoothDevicesDiscovery({ success: function (res) { that.setData({ msg: "搜索设备" + JSON.stringify(res), }) //监听蓝牙适配器状态 wx.onBluetoothAdapterStateChange(function (res) { that.setData({ sousuo: res.discovering ? "在搜索。" : "未搜索。", status: res.available ? "可用。" : "不可用。", }) }) } }) 4.获取已配对的蓝牙设备。 **此方法特别说明参数services(Array)是必填的,**但是官方示例中以及各种坑爹demo里从没见过有谁填写,但是不填写这个属性此方法无法获取到任何已配对设备。如果要调用此方法则是需要连接特定设备,并且知道该设备的一个主服务serviceId。如果未知可以先手动连接一次想要连接的设备,然后获取service列表,记录属性primary为true的值至少一个。
1) 无services
wx.getBluetoothDevices({ success: function (res) { //是否有已连接设备 wx.getConnectedBluetoothDevices({ success: function (res) { console.log(JSON.stringify(res.devices)); that.setData({ connectedDeviceId: res.deviceId }) } }) that.setData({ msg: "搜索设备" + JSON.stringify(res.devices), devices: res.devices, }) //监听蓝牙适配器状态 wx.onBluetoothAdapterStateChange(function (res) { that.setData({ sousuo: res.discovering ? "在搜索。" : "未搜索。", status: res.available ? "可用。" : "不可用。", }) }) } })
2) 有services的demo
getConnectedBluetoothDevices: function () { var that = this; wx.getConnectedBluetoothDevices({ services: [that.serviceId], success: function (res) { console.log("获取处于连接状态的设备", res); var devices = res['devices'], flag = false, index = 0, conDevList = []; devices.forEach(function (value, index, array) { if (value['name'].indexOf('FeiZhi') != -1) { // 如果存在包含FeiZhi字段的设备 flag = true; index += 1; conDevList.push(value['deviceId']); that.deviceId = value['deviceId']; return; } }); if (flag) { this.connectDeviceIndex = 0; that.loopConnect(conDevList); } else { if (!this.getConnectedTimer) { that.getConnectedTimer = setTimeout(function () { that.getConnectedBluetoothDevices(); }, 5000); } }, fail: function (err) { if (!this.getConnectedTimer) { that.getConnectedTimer = setTimeout(function () { that.getConnectedBluetoothDevices(); }, 5000); } } }); }
5.停止搜索周边设备。
wx.stopBluetoothDevicesDiscovery({ success: function (res) { that.setData({ msg: "停止搜索周边设备" + "/" + JSON.stringify(res.errMsg), sousuo: res.discovering ? "在搜索。" : "未搜索。", status: res.available ? "可用。" : "不可用。", }) } })
6.获取连接设备的service服务
wx.getBLEDeviceServices({ // 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取 deviceId: that.data.connectedDeviceId, success: function (res) { console.log('device services:', JSON.stringify(res.services)); that.setData({ services: res.services, msg: JSON.stringify(res.services), }) } })
7.获取连接设备的所有特征值 for循环获取不到值
lanya7: function () { var that = this; wx.getBLEDeviceCharacteristics({ // 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取 deviceId: that.data.connectedDeviceId, // 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取 serviceId: that.data.services[0].uuid, success: function (res) { for (var i = 0; i < res.characteristics.length; i++) { if (res.characteristics[i].properties.notify) { console.log("11111111", that.data.services[0].uuid); console.log("22222222222222222", res.characteristics[i].uuid); that.setData({ notifyServicweId: that.data.services[0].uuid, notifyCharacteristicsId: res.characteristics[i].uuid, }) } if (res.characteristics[i].properties.write) { that.setData({ writeServicweId: that.data.services[0].uuid, writeCharacteristicsId: res.characteristics[i].uuid, }) } else if (res.characteristics[i].properties.read) { that.setData({ readServicweId: that.data.services[0].uuid, readCharacteristicsId: res.characteristics[i].uuid, }) } } console.log('device getBLEDeviceCharacteristics:', res.characteristics); that.setData({ msg: JSON.stringify(res.characteristics), }) }, fail: function () { console.log("fail"); }, complete: function () { console.log("complete"); } }) wx.getBLEDeviceCharacteristics({ // 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取 deviceId: that.data.connectedDeviceId, // 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取 serviceId: that.data.services[1].uuid, success: function (res) { for (var i = 0; i < res.characteristics.length; i++) { if (res.characteristics[i].properties.notify) { that.setData({ notifyServicweId: that.data.services[1].uuid, notifyCharacteristicsId: res.characteristics[i].uuid, }) } if (res.characteristics[i].properties.write) { that.setData({ writeServicweId: that.data.services[1].uuid, writeCharacteristicsId: res.characteristics[i].uuid, }) } else if (res.characteristics[i].properties.read) { that.setData({ readServicweId: that.data.services[1].uuid, readCharacteristicsId: res.characteristics[i].uuid, }) } } console.log('device getBLEDeviceCharacteristics1:', res.characteristics); that.setData({ msg1: JSON.stringify(res.characteristics), }) }, fail: function () { console.log("fail1"); }, complete: function () { console.log("complete1"); } }) },
-
发送
// 这里的回调可以获取到 write 导致的特征值改变 wx.onBLECharacteristicValueChange(function (characteristic) { console.log('characteristic value changed:1', characteristic) }) var buf = new ArrayBuffer(16) var dataView = new DataView(buf) wx.request({ url: getEncrypt, success: function (data) { var arr = data.data.data.split(","); console.log(arr); for (var i = 0; i < arr.length; i++) { dataView.setInt8(i, arr[i]); } console.log('str', buf); console.log("writeServicweId", that.data.writeServicweId); console.log("writeCharacteristicsId", that.data.writeCharacteristicsId); wx.writeBLECharacteristicValue({ // 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取 deviceId: that.data.connectedDeviceId, // 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取 serviceId: that.data.writeServicweId, // 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取 characteristicId: that.data.writeCharacteristicsId, // 这里的value是ArrayBuffer类型 value: buf, success: function (res) { console.log('writeBLECharacteristicValue success', res.errMsg) } }) } })
9.启用低功耗蓝牙设备特征值变化时的 notify 功能
wx.notifyBLECharacteristicValueChange({ state: true, // 启用 notify 功能 // 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取 deviceId: that.data.connectedDeviceId, // 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取 serviceId: that.data.notifyServicweId, // 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取 characteristicId: that.data.notifyCharacteristicsId, success: function (res) { console.log('notifyBLECharacteristicValueChange success', res.errMsg) }, fail: function () { console.log('shibai'); console.log(that.data.notifyServicweId); console.log(that.data.notifyCharacteristicsId); }, })
10.接收消息
// 必须在这里的回调才能获取 wx.onBLECharacteristicValueChange(function (characteristic) { let hex = Array.prototype.map.call(new Uint8Array(characteristic.value), x => ('00' + x.toString(16)).slice(-2)).join(''); console.log(hex) wx.request({ url: getDecrypt, data: { hexString: hex }, method: "POST", header: { 'content-type': 'application/x-www-form-urlencoded' }, success: function (data) { //console.log(data) var res = data.data.data; that.setData({ jieshou: res, }) } }) }) console.log(that.data.readServicweId); console.log(that.data.readCharacteristicsId); wx.readBLECharacteristicValue({ // 这里的 deviceId 需要在上面的 getBluetoothDevices 或 onBluetoothDeviceFound 接口中获取 deviceId: that.data.connectedDeviceId, // 这里的 serviceId 需要在上面的 getBLEDeviceServices 接口中获取 serviceId: that.data.readServicweId, // 这里的 characteristicId 需要在上面的 getBLEDeviceCharacteristics 接口中获取 characteristicId: that.data.readCharacteristicsId, success: function (res) { console.log('readBLECharacteristicValue:', res.errMsg); } })
-
-
android app连接蓝牙打印机打印
2018-07-10 14:22:00最近公司项目需要android手机连接蓝牙打印机打印app页面中的数据,大家有需要的话可以看一下这个demo -
AndroidStudio芯烨蓝牙打印机打印源码
2018-05-21 15:03:23AndroidStudio芯烨蓝牙打印机打印源码 开发IDE:Android Studio -
小程序调用蓝牙打印机完整代码.zip
2019-12-10 14:12:14此代码为小程序调用蓝牙打印机完整代码,有蓝牙打印机的情况下可直接扫码进行真机调试亲测好用,挺不错的资源,大家快来下载吧!挺有用的!需要的话可以来下载哦! -
Android手机连接蓝牙打印机实现打印功能
2016-03-20 18:32:38Android手机连接蓝牙打印机实现打印功能。适用于所有蓝牙打印机。代码可以直接使用。 -
蓝牙打印机连接手机不稳定_新石器手机终端无法连接便携蓝牙打印机的解决措施...
2021-01-28 07:47:35为配合集团推广电子面单应用,需有效解决部新石器 Neolix 1S Android4.4 PDA因内置“EMS智能外勤”软件导致无法连接便携式蓝牙打印机的问题,方法是删除“EMS智能外勤”软件。相关方法如下:1.操作工具:一是Win7-...为配合集团推广电子面单应用,需有效解决部新石器 Neolix 1S Android4.4 PDA因内置“EMS智能外勤”软件导致无法连接便携式蓝牙打印机的问题,方法是删除“EMS智能外勤”软件。相关方法如下:
1.操作工具:一是Win7-Win10电脑;二是新石器PDA原装USB线;三是操作工具包(删除智能外勤.zip文件压缩包)。
2.操作指引:
(1) 将新石器PDA通过USB线连接电脑;
(2) PDA打开USB调试。一是PDA依次进入菜单“设置”—“关于手机”;二是在“关于手机”内快速连续点击“版本号”五次,打开“开发者选项”;三是返回上一级菜单,打开“开发者选项”;四是找到“USB调试”,勾选并退出设置。
(3)双击脚本工具,执行删除命令。一是将“删除智能外勤.zip”文件在电脑内解压缩;二是打开解压收的文件夹“删除智能外勤”;三是找到文件“删除.bat”并双击鼠标左键。四是更新成功并按电脑任意键,重启PDA。
(4)其它:一是测试机重启完成后,查看PDA主菜单,如应用已删除,则操作完成!二是因电脑操作系统差异,有时第一次操作时,adb并未连接成功,造成删除失败,请多执行几次删除工具。三是本工具仅能删除PDA自带的“EMS智能外勤”,如用户后期自行手动安装过,请执行完工具后,长按app然后自行删除一次。
-
微信小程序连接蓝牙打印机打印快递面单
2020-09-08 13:59:04微信小程序连接蓝牙打印机使用cpcl指令打印快递面单,demo测试使用的打印机是HM-A300,支持的编码格式为GB2312 -
小程序连接蓝牙打印机SDK demo
2020-10-25 09:11:14小程序连接蓝牙打印机打印,SDK,demo,2019.03.27 ·修正tsc.setBar重载错误,打印条码为tsc.setBarcode,打印线条为tsc.setBar 2019.04.19 ·修正tsc.setGap ·新增tsc.setBline用于设置黑标功能 2019.06.12 ·修正... -
android 版 印麦蓝牙打印机demo
2018-12-13 14:45:23android版印麦蓝牙打印机demo ,可以打印一维码,二维码,图片。常见的文本等,里面包含说明文档,开发文档, -
爱宝A-5806小票据蓝牙打印机驱动 官方版
2020-07-07 12:58:35爱宝A-5806小票据蓝牙打印机驱动是一款的蓝牙打印机驱动安装程序。爱宝A-5806打印机产品支持美团、饿了么、淘宝外卖等外卖订餐平台打票使用!操作简单,使用寿命长久!需要这款驱动的用户欢迎下载使用。爱宝A-5806...
-
智能停车场云平台(附vue+SpringBoot前后端项目源码)
-
python连接有账号和密码的mongoose数据库
-
北工大活动报名小程序.zip
-
MySQL简介(存储引擎,索引类型,索引方法)
-
自动化测试Python3+Selenium3+Unittest
-
程序员必修基础套餐课
-
SolarSystem.zip
-
爬虫脚本项目源码-爬取小说
-
algorithms
-
GB 14249.1-1993 电子衡器安全要求.pdf
-
PowerBI重要外部工具详解
-
爬虫脚本项目源码-微信红包提示
-
原生AJAX下载文件(下载模板)
-
项目管理工具与方法
-
【函数分享】每日PHP函数分享(2021-2-27)
-
MySQL 高可用(DRBD + heartbeat)
-
Liunx 优化思路与实操步骤
-
华为1+X——网络系统建设与运维(高级)
-
爬虫脚本项目源码-搜索引擎
-
**idea报错:Error:java不支持发行版本5的解决方法**