Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10548)

Unified Diff: device/bluetooth/test/bluetooth_test_mac.mm

Issue 2074563002: bluetooth: mac: write characteristic implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@read_characteristicscan_servicescan_cleanup
Patch Set: Merge from top of tree Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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();
« no previous file with comments | « device/bluetooth/test/bluetooth_test_mac.h ('k') | device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698