看完BluetoothGattCallBack
的源代碼後,似乎沒有必要調用super方法。
對於BluetoothGattCallBack
是一個抽象類,也是onCharacteristicWrite
是一個空方法。
這裏是它的源代碼:
/**
* Callback indicating the result of a characteristic write operation.
*
* <p>If this callback is invoked while a reliable write transaction is
* in progress, the value of the characteristic represents the value
* reported by the remote device. An application should compare this
* value to the desired value to be written. If the values don't match,
* the application must abort the reliable write transaction.
*
* @param gatt GATT client invoked {@link BluetoothGatt#writeCharacteristic}
* @param characteristic Characteristic that was written to the associated
* remote device.
* @param status The result of the write operation
* {@link BluetoothGatt#GATT_SUCCESS} if the operation succeeds.
*/
public void onCharacteristicWrite(BluetoothGatt gatt,
BluetoothGattCharacteristic characteristic, int status) {
}
這可能是因爲執行是按照製造商本土?這是我的恐懼。有一些本地底層實施 – Alix
我不認爲這會是一個問題。肯定有一個下層的本地層,但是這已經在'BluetoothGatt'類中處理了。我用更多的細節更新了答案。 – Tomik
太好了,我接受了這個答案,但是你能否提供一些官方的參考資料? – Alix