BLE: Define peer_address_type_t

This type model a peer address, unlike BLEProtocol::AddressType, it is compatible with privacy concepts.
pull/6932/head
Vincent Coubard 2018-05-17 10:30:24 +01:00
parent e5d91932fd
commit 7f05fc0e00
1 changed files with 37 additions and 0 deletions

View File

@ -529,6 +529,43 @@ struct att_security_requirement_t : SafeEnum<att_security_requirement_t, uint8_t
SafeEnum<att_security_requirement_t, uint8_t>(value) { } SafeEnum<att_security_requirement_t, uint8_t>(value) { }
}; };
/**
* Type that describes a peer device address type.
*/
struct peer_address_type_t :SafeEnum<peer_address_type_t, uint8_t> {
/** struct scoped enum wrapped by the class */
enum type {
/**
* Public device address.
*/
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
};
/**
* Construct a new instance of peer_address_type_t.
*/
peer_address_type_t(type value) :
SafeEnum<peer_address_type_t, uint8_t>(value) { }
};
} // namespace ble } // namespace ble
/** /**