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

Unified Diff: device/bluetooth/public/interfaces/adapter.mojom

Issue 2448713002: bluetooth: Add Device connection logic and accompanying user interface. (Closed)
Patch Set: Created 4 years, 2 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/public/interfaces/adapter.mojom
diff --git a/device/bluetooth/public/interfaces/adapter.mojom b/device/bluetooth/public/interfaces/adapter.mojom
index 945c36b236b56e70e6a2df49030075057ddfc79b..711508796eee672644dec23f840426d534d5e84f 100644
--- a/device/bluetooth/public/interfaces/adapter.mojom
+++ b/device/bluetooth/public/interfaces/adapter.mojom
@@ -6,6 +6,30 @@ module bluetooth.mojom;
import "device/bluetooth/public/interfaces/device.mojom";
+// TODO(crbug.com/657632): Remove when numerical values can be optional.
+struct ConnectError {
ortuno 2016/10/25 10:42:10 http://crbug.com/657632 discourages this approach.
mbrunson 2016/10/25 20:03:04 Done.
+ enum Code {
ortuno 2016/10/25 10:42:09 Add DEVICE_NO_LONGER_IN_RANGE. Also drop the ERRO
mbrunson 2016/10/25 20:03:04 Done.
+ ERROR_ATTRIBUTE_LENGTH_INVALID,
+ ERROR_AUTH_CANCELED,
+ ERROR_AUTH_FAILED,
+ ERROR_AUTH_REJECTED,
+ ERROR_AUTH_TIMEOUT,
+ ERROR_CONNECTION_CONGESTED,
+ ERROR_FAILED,
+ ERROR_INPROGRESS,
+ ERROR_INSUFFICIENT_ENCRYPTION,
+ ERROR_OFFSET_INVALID,
+ ERROR_READ_NOT_PERMITTED,
+ ERROR_REQUEST_NOT_SUPPORTED,
+ ERROR_UNKNOWN,
+ ERROR_UNSUPPORTED_DEVICE,
+ ERROR_WRITE_NOT_PERMITTED,
+ NUM_CONNECT_ERROR_CODES
+ };
+
+ Code code;
+};
+
struct AdapterInfo {
string address;
string name;
@@ -20,8 +44,10 @@ interface Adapter {
// Gets basic information about the adapter.
GetInfo() => (AdapterInfo info);
- // Gets the Device service for the device at the given address.
- GetDevice(string address) => (Device? device);
+ // Creates a GATT connection to the device with |address| and returns a
ortuno 2016/10/25 10:42:09 Please mention when ConnectError is null and when
mbrunson 2016/10/25 20:03:04 Done.
+ // Device if the connection was succesful. The GATT connection is tied to the
+ // the lifetime of the Device message pipe.
+ ConnectToDevice(string address) => (ConnectError? error, Device? device);
// Retrieves the list of the devices known by the adapter including Connected
// Devices, GATT Connected Devices, Paired Devices and Devices discovered

Powered by Google App Engine
This is Rietveld 408576698