Skip to content

Commit 7f05fc0

Browse files
committed
BLE: Define peer_address_type_t
This type model a peer address, unlike BLEProtocol::AddressType, it is compatible with privacy concepts.
1 parent e5d9193 commit 7f05fc0

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

features/FEATURE_BLE/ble/BLETypes.h

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,43 @@ struct att_security_requirement_t : SafeEnum<att_security_requirement_t, uint8_t
529529
SafeEnum<att_security_requirement_t, uint8_t>(value) { }
530530
};
531531

532+
/**
533+
* Type that describes a peer device address type.
534+
*/
535+
struct peer_address_type_t :SafeEnum<peer_address_type_t, uint8_t> {
536+
/** struct scoped enum wrapped by the class */
537+
enum type {
538+
/**
539+
* Public device address.
540+
*/
541+
PUBLIC = 0,
542+
543+
/**
544+
* Random address.
545+
*
546+
* Use Gap::getRandomAddressType to retrieve the type of the random
547+
* address.
548+
*/
549+
RANDOM,
550+
551+
/**
552+
* A Public address used as a device identity address.
553+
*/
554+
PUBLIC_IDENTITY,
555+
556+
/**
557+
* A Random static address used as a device identity address.
558+
*/
559+
RANDOM_STATIC_IDENTITY
560+
};
561+
562+
/**
563+
* Construct a new instance of peer_address_type_t.
564+
*/
565+
peer_address_type_t(type value) :
566+
SafeEnum<peer_address_type_t, uint8_t>(value) { }
567+
};
568+
532569
} // namespace ble
533570

534571
/**

0 commit comments

Comments
 (0)