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

Unified Diff: device/bluetooth/public/interfaces/test/fake_bluetooth.mojom

Issue 2874873003: bluetooth: Implement simulateGATTConnectionResponse() (Closed)
Patch Set: Merge branch 'bluetooth-generate-with-headers' into bluetooth-simulate-gatt-discovery-complete Created 3 years, 7 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 | « no previous file | device/bluetooth/test/fake_central.h » ('j') | device/bluetooth/test/fake_peripheral.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/bluetooth/public/interfaces/test/fake_bluetooth.mojom
diff --git a/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom b/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom
index a9d71faed3b86028292d428c6ecfc4b466a837ec..44017acd1b73d275962a58039775d2afc539329f 100644
--- a/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom
+++ b/device/bluetooth/public/interfaces/test/fake_bluetooth.mojom
@@ -30,6 +30,10 @@ interface FakeBluetooth {
SimulateCentral(CentralState state) => (FakeCentral fake_central);
};
+// HCI Error Codes from BT 4.2 Vol 2 Part D 1.3 List Of Error Codes.
+const uint16 kHCISuccess = 0x0000;
+const uint16 kHCIConnectionTimeout = 0x0008;
+
// FakeCentral allows clients to simulate events that a device in the
// Central/Observer role would receive as well as monitor the operations
// performed by the device in the Central/Observer role.
@@ -51,4 +55,12 @@ interface FakeCentral {
SimulatePreconnectedPeripheral(string address,
string name,
array<UUID> known_service_uuids) => ();
+
+ // Simulates a GATT Connection request response with |code| for peripheral
+ // with |address|. |code| could be an HCI Error Code from
+ // BT 4.2 Vol 2 Part D 1.3 List Of Error Codes or a number outside that range
+ // returned by specific platforms e.g. Android returns 0x101 to signal a GATT
+ // failure
+ // https://developer.android.com/reference/android/bluetooth/BluetoothGatt.html#GATT_FAILURE
+ SimulateGATTConnectionResponse(string address, uint16 code) => ();
};
« no previous file with comments | « no previous file | device/bluetooth/test/fake_central.h » ('j') | device/bluetooth/test/fake_peripheral.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698