我正在尝试使用 RxAndroidBle 库(https://github.com/Polidea/RxAndroidBle)。我希望应用程序启动并扫描 BLE 设备。我想在 LogCat 中打印找到的设备。我怎样才能做到这一点?
RxBleClient rxBleClient;
RxBleScanResult rxBleScanResult;
private Subscription scanSubscription;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
rxBleClient = RxBleClient.create(this);
Subscription scanSubscription = rxBleClient.scanBleDevices().subscribe(
rxBleScanResult.getBleDevice().getMacAddress());
}