We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
您好,感谢分享这个框架,BleRssiDevice 对象能支持转换为BluetoothDevice吗?我们接入第三方蓝牙SDK,需要传入BluetoothDevice对象类型完成初始化,我看到库中所有的扫描和连接对象都是BleRssDevice
The text was updated successfully, but these errors were encountered:
我也和你查找类似的方法,但也找不到,基于3.3.1版本直接修改了源码
下载框架后,在自己工程引入core,然后按下面修改即可
类BleWrapperCallback的onLeScan方法修改成如下 @Override public void onLeScan(BluetoothDevice originalDevice, T device, int rssi, byte[] scanRecord) { }
@Override public void onLeScan(BluetoothDevice originalDevice, T device, int rssi, byte[] scanRecord) { }
类ScanRequest修改成如下 @Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { if (device == null) return; String address = device.getAddress(); T bleDevice = getDevice(address); if (bleDevice == null) { bleDevice = (T) Ble.options().getFactory().create(address, device.getName()); bleDevice.setDeviceType(device.getType()); if (bleScanCallback != null) { bleScanCallback.onLeScan(device,bleDevice, rssi, scanRecord); } if (bleWrapperCallback != null){ bleWrapperCallback.onLeScan(device,bleDevice, rssi, scanRecord); } scanDevices.put(device.getAddress(), bleDevice); } else { if (!Ble.options().isIgnoreRepeat) {//无需过滤 if (bleScanCallback != null) { bleScanCallback.onLeScan(device,bleDevice, rssi, scanRecord); } if (bleWrapperCallback != null){ bleWrapperCallback.onLeScan(device,bleDevice, rssi, scanRecord); } } } }
@Override public void onLeScan(BluetoothDevice device, int rssi, byte[] scanRecord) { if (device == null) return; String address = device.getAddress(); T bleDevice = getDevice(address); if (bleDevice == null) { bleDevice = (T) Ble.options().getFactory().create(address, device.getName()); bleDevice.setDeviceType(device.getType()); if (bleScanCallback != null) { bleScanCallback.onLeScan(device,bleDevice, rssi, scanRecord); } if (bleWrapperCallback != null){ bleWrapperCallback.onLeScan(device,bleDevice, rssi, scanRecord); } scanDevices.put(device.getAddress(), bleDevice); } else { if (!Ble.options().isIgnoreRepeat) {//无需过滤 if (bleScanCallback != null) { bleScanCallback.onLeScan(device,bleDevice, rssi, scanRecord); } if (bleWrapperCallback != null){ bleWrapperCallback.onLeScan(device,bleDevice, rssi, scanRecord); } } } }
类BleScanCallback public abstract void onLeScan(BluetoothDevice originalDevice, T device, int rssi, byte[] scanRecord);
public abstract void onLeScan(BluetoothDevice originalDevice, T device, int rssi, byte[] scanRecord);
Sorry, something went wrong.
No branches or pull requests
您好,感谢分享这个框架,BleRssiDevice 对象能支持转换为BluetoothDevice吗?我们接入第三方蓝牙SDK,需要传入BluetoothDevice对象类型完成初始化,我看到库中所有的扫描和连接对象都是BleRssDevice
The text was updated successfully, but these errors were encountered: