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

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

Issue 2767813002: Bluetooth: macOS: Implementing read/write for descriptors (Closed)
Patch Set: . Created 3 years, 8 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
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
diff --git a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
index 637ffee454fcbe6a996799fb5a9edb35bf0d8c49..f0a4a7338cf17210c78f7401ee488fe5b8baf81d 100644
--- a/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
+++ b/device/bluetooth/test/mock_bluetooth_cbperipheral_mac.mm
@@ -8,6 +8,7 @@
#include "base/mac/scoped_nsobject.h"
#include "device/bluetooth/test/bluetooth_test_mac.h"
#include "device/bluetooth/test/mock_bluetooth_cbcharacteristic_mac.h"
+#include "device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.h"
#include "device/bluetooth/test/mock_bluetooth_cbservice_mac.h"
using base::mac::ObjCCast;
@@ -112,6 +113,18 @@ using base::scoped_nsobject;
_bluetoothTestMac->OnFakeBluetoothCharacteristicWriteValue(value);
}
+- (void)readValueForDescriptor:(CBDescriptor*)descriptor {
+ DCHECK(_bluetoothTestMac);
+ _bluetoothTestMac->OnFakeBluetoothDescriptorReadValue();
+}
+
+- (void)writeValue:(NSData*)data forDescriptor:(CBDescriptor*)descriptor {
+ DCHECK(_bluetoothTestMac);
+ const uint8_t* buffer = static_cast<const uint8_t*>(data.bytes);
+ std::vector<uint8_t> value(buffer, buffer + data.length);
+ _bluetoothTestMac->OnFakeBluetoothDescriptorWriteValue(value);
+}
+
- (void)removeAllServices {
[_services.get() removeAllObjects];
}
« no previous file with comments | « device/bluetooth/test/mock_bluetooth_cbdescriptor_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698