Skip to content

Commit

Permalink
Merge pull request ARMmbed#30 from pan-/sm-privacy
Browse files Browse the repository at this point in the history
BLE: Add Gap privacy interfaces.
  • Loading branch information
paul-szczepanek-arm authored Apr 12, 2018
2 parents 9be8837 + 90c8595 commit d8f5100
Show file tree
Hide file tree
Showing 4 changed files with 378 additions and 6 deletions.
33 changes: 33 additions & 0 deletions features/FEATURE_BLE/ble/BLEProtocol.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,51 @@ namespace BLEProtocol {
*/
PUBLIC = 0,

/**
* Random address.
*
* Use Gap::getRandomAddressType to retrieve the type of the random
* address.
*/
RANDOM,

/**
* A Public address used as a device identity address.
*/
PUBLIC_IDENTITY,

/**
* A Random static address used as a device identity address.
*/
RANDOM_STATIC_IDENTITY,

/**
* Random static device address.
*
* @deprecated This enumeration value is not relevant anymore.
* Advertising reporting and the connection procedure should rely
* on RANDOM instead. Use Gap::getRandomAddressType to retrieve the
* type of the random address.
*/
RANDOM_STATIC,

/**
* Private resolvable device address.
*
* @deprecated This enumeration value is not relevant anymore.
* Advertising reporting and the connection procedure should rely
* on RANDOM instead. Use Gap::getRandomAddressType to retrieve the
* type of the random address.
*/
RANDOM_PRIVATE_RESOLVABLE,

/**
* Private non-resolvable device address.
*
* @deprecated This enumeration value is not relevant anymore.
* Advertising reporting and the connection procedure should rely
* on RANDOM instead. Use Gap::getRandomAddressType to retrieve the
* type of the random address.
*/
RANDOM_PRIVATE_NON_RESOLVABLE
};
Expand Down
18 changes: 18 additions & 0 deletions features/FEATURE_BLE/ble/BLETypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,24 @@ struct address_t : public byte_array_t<6> {
}
};

/**
* Type that describes a random device address type.
*/
struct random_address_type_t : SafeEnum<random_address_type_t, uint8_t> {
/** struct scoped enum wrapped by the class */
enum type {
STATIC, /**< Random static device address. */
NON_RESOLVABLE_PRIVATE, /**< Random non resolvable private address. */
RESOLVABLE_PRIVATE /**< Random resolvable private address. */
};

/**
* Construct a new instance of random_address_type_t.
*/
random_address_type_t(type value) :
SafeEnum<random_address_type_t, uint8_t>(value) { }
};

} // namespace ble

/**
Expand Down
Loading

0 comments on commit d8f5100

Please sign in to comment.