FastBle
FastBle copied to clipboard
Android Bluetooth Low Energy (BLE) Fast Development Framework. It uses simple ways to filter, scan, connect, read ,write, notify, readRssi, setMTU, and multiConnection.
如果我需要发送很大的数据,数据分包发送,这时候,我主动断开设备的连接,按我的理解,应该是不在发送数据的,但是由于在 **BleManager.getInstance().write(mBleDevice, UUID_SERVICE, UUID_WRITE, buffer, true, true, 30, callback);** 设置了**sendNextWhenLastSuccess=true**,导致在**SplitWriter** 走到发送失败 **onWriteFailure**回调方法中,mHandler一直在继续发送数据 ``` @Override public void onWriteFailure(BleException exception) { if (mCallback != null) { mCallback.onWriteFailure(new OtherException("exception occur while writing: "...
我正在做一个需要连接多个蓝牙设备的app,第一次连接之后将其保存,以供下次连接。 下次启动时主动连接这些设备,比如我读取存储获取了4个设备的信息,然后for循环去连接这四个,也就是分别调用了四次connect。 因为connect是异步的所以不会等待,所以这几个设备都将是“连接中”的状态。如果连接上了,则没有问题,但如果一个没连接上,之后的几个设备会同时一起报“连接失败”。 比如我的第一个设备不在线,导致连接失败,那1234四个设备都会报失败,如果第一个设备连接上了,第二个设备不在线,那么234三个设备都会回调失败。会直接回调连接失败,很奇怪。 请问有什么解决办法么
如何根据多个mac地址扫描蓝牙设备,貌似只能配置一个mac
onWriteFailure: BleException { code=102, description='gatt writeCharacteristic fail'}
This does not work for Vivo S1 phones.Can you dig a little deeper in this?
hexa
该项目很棒,但问题是您正在发送和接收十六进制值,但我们如何发送简单的文本。 esp32 没有足够的空间来实现十六进制到其中的文本,如果我们实现它,将没有足够的空间来实现其他东西 The project is awesome but the issue is you are sending and receiving hex values but how can we send simple text. the esp32 doesn't have enough...
I can find bleDevice.getScanRecord(),but did not found : SparseArray mandufacturerData = scanRecord.getManufacturerSpecificData(); for eg: ble外围设备可以在广播的时候设定AdvertiseData的magic number【manufacturerId 和 manufacturerSpecificData】。这样即使定义service uuid跟别人的有冲突,也可以在中心过滤该magic number来找到符合自己需求的外围设备 外围构建AdvertiseData AdvertiseData.Builder() .setIncludeDeviceName(true) .addServiceUuid(ParcelUuid.fromString("00007777-0000-1000-8000-00805f9b34fb")) .addManufacturerData(0x7777, new byte[]{0x07, 0x07}) .build(); 中心处理AdvertiseData中的...
写入以下内容有的设备报错 byte[] data = new byte[10]; Calendar cal = Calendar.getInstance(); int year = cal.get(Calendar.YEAR); data[0] = (byte)year; data[1] = (byte)((year >> 8) & 0xFF); data[2] = (byte)(cal.get(Calendar.MONTH) + 1); data[3]...
如果外部扫描通过匿名类设置监听后,停止扫描后对象无法自动释放, 因为匿名类默认持有外部activity对象,然后单例持有匿名类形成循环引用,导致activity退出后无法gc