小编Jia*_*Zhu的帖子

android 4.3蓝牙ble不叫onCharacteristicRead()

我已将通知设置为android,它不是调用方法onCharacteristicRead()???? 它不会进入该功能.为什么会这样?

任何帮助表示赞赏

请求解决方案.

这是我的代码:

private final BluetoothGattCallback mGattCallback = new BluetoothGattCallback() {
    @Override
    public void onConnectionStateChange(BluetoothGatt gatt, int status,
            int newState) {
        if (newState == BluetoothProfile.STATE_CONNECTED) {
            Log.i(TAG, "Connected to GATT server.");
            // Attempts to discover services after successful connection.
            Log.i(TAG, "Attempting to start service discovery:"
                    + mBluetoothGatt.discoverServices());
        } else if (newState == BluetoothProfile.STATE_DISCONNECTED) {
            Log.i(TAG, "Disconnected from GATT server.");
        }
    }

    @Override
    public void onServicesDiscovered(BluetoothGatt gatt, int status) {
        if (status == BluetoothGatt.GATT_SUCCESS) {
            gattServices = …
Run Code Online (Sandbox Code Playgroud)

java android bluetooth android-notifications bluetooth-lowenergy

4
推荐指数
1
解决办法
8405
查看次数