mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-16 15:36:12 -04:00
Define FastPairDeviceRepository
Move onwership of Fast Par Devices to a single point, FastPairDeviceRepository, which will live inside a singleton FastPairService. PiperOrigin-RevId: 534547186
This commit is contained in:
committed by
Copybara-Service
parent
27267f57b8
commit
c2fc33038c
@@ -45,8 +45,9 @@ class FastPairDevice {
|
||||
: model_id_(model_id), ble_address_(ble_address), protocol_(protocol) {}
|
||||
|
||||
FastPairDevice(const FastPairDevice&) = delete;
|
||||
FastPairDevice(FastPairDevice&&) = default;
|
||||
FastPairDevice& operator=(const FastPairDevice&) = delete;
|
||||
FastPairDevice& operator=(FastPairDevice&&) = delete;
|
||||
FastPairDevice& operator=(FastPairDevice&&) = default;
|
||||
~FastPairDevice() = default;
|
||||
|
||||
std::optional<std::string> GetPublicAddress() const {
|
||||
@@ -87,6 +88,13 @@ class FastPairDevice {
|
||||
|
||||
Protocol GetProtocol() const { return protocol_; }
|
||||
|
||||
const std::string& GetUniqueId() const {
|
||||
if (public_address_.has_value()) {
|
||||
return *public_address_;
|
||||
}
|
||||
return ble_address_;
|
||||
}
|
||||
|
||||
private:
|
||||
std::string model_id_;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user