Index: device/bluetooth/test/bluetooth_test_mac.mm |
diff --git a/device/bluetooth/test/bluetooth_test_mac.mm b/device/bluetooth/test/bluetooth_test_mac.mm |
index 2d67661df490adae216d64759fd9681a3ef2db83..048810664eb089ec0a48671f8a9bd36691a6a904 100644 |
--- a/device/bluetooth/test/bluetooth_test_mac.mm |
+++ b/device/bluetooth/test/bluetooth_test_mac.mm |
@@ -309,6 +309,22 @@ void BluetoothTestMac::SimulateGattCharacteristicReadError( |
[characteristic_mock simulateReadWithValue:nil error:error]; |
} |
+void BluetoothTestMac::SimulateGattCharacteristicWrite( |
+ BluetoothRemoteGattCharacteristic* characteristic) { |
+ MockCBCharacteristic* characteristic_mock = |
+ GetCBMockCharacteristic(characteristic); |
+ [characteristic_mock simulateWriteWithError:nil]; |
+} |
+ |
+void BluetoothTestMac::SimulateGattCharacteristicWriteError( |
+ BluetoothRemoteGattCharacteristic* characteristic, |
+ BluetoothRemoteGattService::GattErrorCode error_code) { |
+ MockCBCharacteristic* characteristic_mock = |
+ GetCBMockCharacteristic(characteristic); |
+ NSError* error = BluetoothDeviceMac::GetNSErrorFromGattErrorCode(error_code); |
+ [characteristic_mock simulateWriteWithError:error]; |
+} |
+ |
void BluetoothTestMac::SimulateGattCharacteristicRemoved( |
BluetoothRemoteGattService* service, |
BluetoothRemoteGattCharacteristic* characteristic) { |
@@ -343,6 +359,12 @@ void BluetoothTest::OnFakeBluetoothCharacteristicReadValue() { |
gatt_read_characteristic_attempts_++; |
} |
+void BluetoothTest::OnFakeBluetoothCharacteristicWriteValue( |
+ std::vector<uint8_t> value) { |
+ last_write_value_ = value; |
+ gatt_write_characteristic_attempts_++; |
+} |
+ |
MockCBPeripheral* BluetoothTestMac::GetMockCBPeripheral( |
BluetoothRemoteGattService* service) const { |
BluetoothDevice* device = service->GetDevice(); |