Index: device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm |
diff --git a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm |
index ae72118130f9cf810262344aa18969c4421c809d..2e2da4e618c0214d4907811847147a72b587390d 100644 |
--- a/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm |
+++ b/device/bluetooth/bluetooth_remote_gatt_characteristic_mac.mm |
@@ -257,10 +257,12 @@ void BluetoothRemoteGattCharacteristicMac::DidUpdateValue(NSError* error) { |
callbacks.second.Run(error_code); |
return; |
} |
- UpdateValueAndNotify(); |
+ UpdateValue(); |
callbacks.first.Run(value_); |
} else if (IsNotifying()) { |
- UpdateValueAndNotify(); |
+ UpdateValue(); |
+ gatt_service_->GetMacAdapter()->NotifyGattCharacteristicValueChanged( |
+ this, value_); |
} else { |
// In case of buggy device, nothing should be done if receiving extra |
// read confirmation. |
@@ -269,12 +271,10 @@ void BluetoothRemoteGattCharacteristicMac::DidUpdateValue(NSError* error) { |
} |
} |
-void BluetoothRemoteGattCharacteristicMac::UpdateValueAndNotify() { |
+void BluetoothRemoteGattCharacteristicMac::UpdateValue() { |
NSData* nsdata_value = cb_characteristic_.get().value; |
const uint8_t* buffer = static_cast<const uint8_t*>(nsdata_value.bytes); |
value_.assign(buffer, buffer + nsdata_value.length); |
- gatt_service_->GetMacAdapter()->NotifyGattCharacteristicValueChanged(this, |
- value_); |
} |
void BluetoothRemoteGattCharacteristicMac::DidWriteValue(NSError* error) { |