Intent enableBtIntent = new Intent(BluetoothAdapter.ACTION_REQUEST_ENABLE);我正在使用上面的源代码请求启动蓝牙。但是,startActivityForResult已被弃用。所以,我一直在寻找新的代码来解决这个问题。这是我找到的。
// You can do the assignment inside onAttach or onCreate, i.e, before the activity is di
我在Ble外设上工作,我使用这个article中的一个队列来发送数据,但它只工作了一次。 在成功连接后,我收到了来自Central的请求,值为"0301“,然后在相同的特征中,我设置了数据(ssid)并通知它,所以现在一切正常,应用程序(peropheral)停止接收请求。 @Override
public void onCharacteristicWriteRequest(final BluetoothDevice device, final int requestId, final BluetoothGattCharacteristic characteristi