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

Unified Diff: components/pairing/bluetooth_host_pairing_controller.h

Issue 2890383003: Bootstrapping: Send meaningful error code/message from Slave to Master (Closed)
Patch Set: Address achuith@'s comments. Created 3 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: components/pairing/bluetooth_host_pairing_controller.h
diff --git a/components/pairing/bluetooth_host_pairing_controller.h b/components/pairing/bluetooth_host_pairing_controller.h
index a9a9d4010a2a2475e8ce726f217ef7b50546d0ec..8eabce07d5f4cfcc8d706a3eecf29934983b8aec 100644
--- a/components/pairing/bluetooth_host_pairing_controller.h
+++ b/components/pairing/bluetooth_host_pairing_controller.h
@@ -74,6 +74,7 @@ class BluetoothHostPairingController
void ChangeStage(Stage new_stage);
void SendHostStatus();
+ void SendErrorCodeAndMessage();
void OnGetAdapter(scoped_refptr<device::BluetoothAdapter> adapter);
void SetPowered();
@@ -109,6 +110,8 @@ class BluetoothHostPairingController
void OnUpdateStatusChanged(UpdateStatus update_status) override;
void OnEnrollmentStatusChanged(EnrollmentStatus enrollment_status) override;
void SetPermanentId(const std::string& permanent_id) override;
+ void SetErrorCodeAndMessage(int error_code,
+ const std::string& error_message) override;
void Reset() override;
// ProtoDecoder::Observer:
@@ -148,6 +151,17 @@ class BluetoothHostPairingController
std::string controller_device_address_;
bool was_powered_ = false;
+ // The format of the |error_code_| is:
+ // [0, "no error"]
+ // [1*, "network error"]
+ // [2*, "authentication error"], e.g., [21, "Service unavailable"], ...
+ // [3*, "enrollment error"], e.g., [31, "DMserver registration error"], ...
+ // [4*, "other error"]
+ // The |error_code_| and |error_message_| will pass over to the master device
+ // to assist error diagnosis.
+ int error_code_ = 0;
+ std::string error_message_;
+
scoped_refptr<device::BluetoothAdapter> adapter_;
scoped_refptr<device::BluetoothSocket> service_socket_;
scoped_refptr<device::BluetoothSocket> controller_socket_;
« no previous file with comments | « chrome/browser/chromeos/login/wizard_controller.cc ('k') | components/pairing/bluetooth_host_pairing_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698