Git Product home page Git Product logo

tianxiaoyunyou / bluetoothprinter Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qihang666/bluetoothprinter

0.0 0.0 0.0 5.63 MB

vue.js uni-app 跨平台app框架 蓝牙连接打印机 demo , ESC TSPL 协议与打印机交互, 鉴于网上资料太少,深知踩坑之痛苦,以此开源分享,如果对你有帮助 请点个Satrt,谢谢。开源**

Vue 6.07% JavaScript 92.16% CSS 1.77%

bluetoothprinter's Introduction

BluetoothPrinter

vue.js uni-app 跨平台app框架 蓝牙连接打印机 demo , ESC TSPL 协议与打印机交互, 鉴于网上资料太少,深知踩坑之痛苦,以此开源分享,如果对你有帮助 请点个Satrt,谢谢。开源**

------对接蓝牙打印,有很多坑要踩,以下罗列几个大坑,希望大家少走弯路-----

  1. 手机蓝牙向打印机发送成功: uni.writeBLECharacteristicValue:ok , 但是就是不打印, 这时候大部分原因, 应该是发送的数据不符合 esc(账单模式)或 tsc(标签模式)数据格式 ,请检查自己的数据格式 还有编码格式应为 gb18030

  2. 蓝牙模块有许多服务,每个服务下面有许多特征值,不知道哪个可以用,按我的理解以及踩坑经验,特征值里面write=true (properties.write == true) 代表可以给蓝牙设备写数据。 如果有多个write=true蓝牙特征值,可以任取其中一个都能发送打印数据

  3. 苹果手机ios可以打印, 安卓手机Android不能打印,是因为安卓 Android 底层貌似做了限制只能接受20个字节,所以数据包要拆分成20字节一组,多组多次发送 demo里面有拆分操作可以自己查看

bluetoothprinter's People

Contributors

qihang666 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.