| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef COMPONENTS_PROXIMITY_AUTH_REMOTE_DEVICE_H | 5 #ifndef COMPONENTS_CRYPTAUTH_REMOTE_DEVICE_H |
| 6 #define COMPONENTS_PROXIMITY_AUTH_REMOTE_DEVICE_H | 6 #define COMPONENTS_CRYPTAUTH_REMOTE_DEVICE_H |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| 11 namespace cryptauth { | 11 namespace cryptauth { |
| 12 | 12 |
| 13 struct RemoteDevice { | 13 struct RemoteDevice { |
| 14 public: | 14 public: |
| 15 enum BluetoothType { BLUETOOTH_CLASSIC, BLUETOOTH_LE }; | 15 enum BluetoothType { BLUETOOTH_CLASSIC, BLUETOOTH_LE }; |
| 16 | 16 |
| (...skipping 10 matching lines...) Expand all Loading... |
| 27 const std::string& name, | 27 const std::string& name, |
| 28 const std::string& public_key, | 28 const std::string& public_key, |
| 29 BluetoothType bluetooth_type, | 29 BluetoothType bluetooth_type, |
| 30 const std::string& bluetooth_address, | 30 const std::string& bluetooth_address, |
| 31 const std::string& persistent_symmetric_key, | 31 const std::string& persistent_symmetric_key, |
| 32 std::string sign_in_challenge); | 32 std::string sign_in_challenge); |
| 33 RemoteDevice(const RemoteDevice& other); | 33 RemoteDevice(const RemoteDevice& other); |
| 34 ~RemoteDevice(); | 34 ~RemoteDevice(); |
| 35 | 35 |
| 36 // Returns a unique ID for the device. | 36 // Returns a unique ID for the device. |
| 37 std::string GetDeviceId(); | 37 std::string GetDeviceId() const; |
| 38 | 38 |
| 39 // Returns a shortened device ID for the purpose of concise logging (device | 39 // Returns a shortened device ID for the purpose of concise logging (device |
| 40 // IDs are often so long that logs are difficult to read). Note that this | 40 // IDs are often so long that logs are difficult to read). Note that this |
| 41 // ID is not guaranteed to be unique, so it should only be used for log. | 41 // ID is not guaranteed to be unique, so it should only be used for log. |
| 42 std::string GetTruncatedDeviceIdForLogs(); | 42 std::string GetTruncatedDeviceIdForLogs() const; |
| 43 |
| 44 bool operator==(const RemoteDevice& other) const; |
| 43 }; | 45 }; |
| 44 | 46 |
| 45 typedef std::vector<RemoteDevice> RemoteDeviceList; | 47 typedef std::vector<RemoteDevice> RemoteDeviceList; |
| 46 | 48 |
| 47 } // namespace cryptauth | 49 } // namespace cryptauth |
| 48 | 50 |
| 49 #endif // COMPONENTS_PROXIMITY_AUTH_REMOTE_DEVICE_H | 51 #endif // COMPONENTS_CRYPTAUTH_REMOTE_DEVICE_H |
| OLD | NEW |