luopeiqin / bluetooth Goto Github PK
View Code? Open in Web Editor NEW功能完善的蓝牙开源库
功能完善的蓝牙开源库
连接蓝牙设备会报:E/bt_btif: bta_gattc_cache_load: can't open GATT cache file /data/misc/bluetooth/gatt_cache_ f0:c7:7f:fd:14:52 for reading, error: No such file or directory,连接不上。
搜索到蓝牙设备,点击连接,返回状态false,失败,使用MAC连接,也是连接失败。
我用你的demo就没连接成功过设备
有些设备直接就连接不上
有些设备报错了
2021-07-14 14:16:58.085 8128-8745/com.luo.bluetooth W/System.err: java.lang.InterruptedException
2021-07-14 14:16:58.085 8128-8745/com.luo.bluetooth W/System.err: at java.lang.Thread.sleep(Native Method)
2021-07-14 14:16:58.085 8128-8745/com.luo.bluetooth W/System.err: at java.lang.Thread.sleep(Thread.java:386)
2021-07-14 14:16:58.085 8128-8745/com.luo.bluetooth W/System.err: at java.lang.Thread.sleep(Thread.java:327)
2021-07-14 14:16:58.086 8128-8745/com.luo.bluetooth W/System.err: at com.stag.bluetooth.helper.BleHelper$3.run(BleHelper.java:174)
2021-07-14 14:16:58.086 8128-8745/com.luo.bluetooth D/LPQ: timeout:true isResumeTimeoutCount:false
2021-07-14 14:16:58.089 8128-8178/com.luo.bluetooth D/BluetoothGatt: close()
2021-07-14 14:16:58.089 8128-8178/com.luo.bluetooth D/BluetoothGatt: unregisterApp() - mClientIf=7
2021-07-14 14:16:58.093 8128-8128/com.luo.bluetooth D/MainActivitylpq: onBluetoothConnect: 蓝牙连接结果:false
2021-07-14 14:16:59.137 8128-8128/com.luo.bluetooth D/LPQ: discontect from broadca
Android10中无法扫描到蓝牙设备
Android10好像还没有做适配
你好,能不能同时搜索经典和BLE的蓝牙
E/AndroidRuntime: FATAL EXCEPTION: Thread-14
Process: com.zdyb.app, PID: 3465
java.nio.BufferOverflowException
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:164)
at java.nio.ByteBuffer.put(ByteBuffer.java:732)
at com.stag.bluetooth.BluetoothTransfer.addRecvData(BluetoothTransfer.java:274)
at com.stag.bluetooth.helper.BluetoothHelper.recv(BluetoothHelper.java:62)
at com.stag.bluetooth.helper.TraditionHelper$2.run(TraditionHelper.java:126)
at java.lang.Thread.run(Thread.java:930)
E/AndroidRuntime: --->onUncaughtExceptionHappened:Thread[Thread-14,5,main]<---
java.nio.BufferOverflowException
at java.nio.HeapByteBuffer.put(HeapByteBuffer.java:164)
at java.nio.ByteBuffer.put(ByteBuffer.java:732)
at com.stag.bluetooth.BluetoothTransfer.addRecvData(BluetoothTransfer.java:274)
at com.stag.bluetooth.helper.BluetoothHelper.recv(BluetoothHelper.java:62)
at com.stag.bluetooth.helper.TraditionHelper$2.run(TraditionHelper.java:126)
at java.lang.Thread.run(Thread.java:930)
作者你好,请问一下我如果只使用readme中提到的"方式二:原始数据收发"的话还需要实现Protocol相关的东西吗?我现在只OnBluetoothTransmitListener的话在收到数据的时候会报错如下:
java.lang.NullPointerException: Attempt to invoke virtual method 'com.stag.bluetooth.protocol.ParseResult com.stag.bluetooth.protocol.Protocol.parse(byte[])' on a null object reference
at com.stag.bluetooth.BluetoothTransfer$2.run(BluetoothTransfer.java:158)
我只想接收原始数据的情况下应该如何处理呢,请作者帮忙谢谢。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.