Jasonchenlijian / FastBle

Android Bluetooth Low Energy (BLE) Fast Development Framework. It uses simple ways to filter, scan, connect, read ,write, notify, readRssi, setMTU, and multiConnection.
Apache License 2.0
5.33k stars 1.23k forks source link

notify和write用的不是同一个UUID,notify不进onCharacteristicChanged方法 #542

Open guhuixiong opened 2 years ago

guhuixiong commented 2 years ago

`bleManager.notify(bleDevice,BL2K_SERVICE,BL2K_CHARACTERISTIC,object : BleNotifyCallback() { override fun onNotifyFailure(exception: BleException?) { Log.d(TAG,"notifyDeviceState failure $exception") }

        override fun onNotifySuccess() {
            Log.d(TAG,"onNotifySuccess")
            _deviceState.postValue(DeviceState())
        }

        override fun onCharacteristicChanged(data: ByteArray?) {
            Log.d(TAG, "onCharacteristicChanged----")
            data?.let {
                val state = String(it)
                Log.d(TAG, "notifyDeviceState state:$state")

            }
        }
    })`
lichao3140 commented 2 years ago

请问这问题你解决了吗

guhuixiong commented 2 years ago

请问这问题你解决了吗

还没有,怎么弄都不行

wangjinchan commented 1 year ago

解决了:https://github.com/Jasonchenlijian/FastBle/issues/574