blob: c42490e5fbeeff8ecb2d9e6a42228bb030f52e36 [file] [log] [blame]
// Copyright 2017 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef GARNET_DRIVERS_BLUETOOTH_LIB_GAP_RANDOM_ADDRESS_GENERATOR_H_
#define GARNET_DRIVERS_BLUETOOTH_LIB_GAP_RANDOM_ADDRESS_GENERATOR_H_
#include "garnet/drivers/bluetooth/lib/common/device_address.h"
namespace btlib {
namespace gap {
// Generates Bluetooth addresses as defined in the specification in
// Vol 6, Part B, Sec 1.3.2.
class RandomAddressGenerator {
public:
RandomAddressGenerator();
// Generates a static device address. See Section 1.3.2.1.
// Returns the same address for the whole lifetime of this object.
// We expect the generator to be re-created when the adapter
// power cycles.
common::DeviceAddress StaticAddress() const;
// Generates a non-resolalble private address as specified by Section 1.3.2.2.
static common::DeviceAddress PrivateAddress();
// TODO(jamuraa): implement
// common::DeviceAddress ResolvablePrivateAddress(const UInt128& irk) const;
private:
common::DeviceAddress static_;
};
} // namespace gap
} // namespace btlib
#endif // GARNET_DRIVERS_BLUETOOTH_LIB_GAP_RANDOM_ADDRESS_GENERATOR_H_