Skip to content

Commit 11c3e13

Browse files
committed
Add whitelist_t::entry_t which will replace Address_t to store addr type and value
1 parent 30bfdfc commit 11c3e13

File tree

1 file changed

+44
-2
lines changed

1 file changed

+44
-2
lines changed

features/FEATURE_BLE/ble/BLETypes.h

Lines changed: 44 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
#include <stdint.h>
2222
#include <string.h>
2323
#include "ble/SafeEnum.h"
24-
#include "ble/BLEProtocol.h"
2524
#include "platform/Span.h"
2625
#include "ble/gap/Types.h"
2726

@@ -837,10 +836,53 @@ struct coded_symbol_per_bit_t :SafeEnum<coded_symbol_per_bit_t, uint8_t> {
837836
* Representation of a whitelist of addresses.
838837
*/
839838
struct whitelist_t {
839+
/**
840+
* BLE address representation.
841+
*
842+
* It contains an address-type (peer_address_type_t) and the address value
843+
* (address_t).
844+
*/
845+
struct entry_t {
846+
/**
847+
* Construct an entry_t object with the supplied type and address.
848+
*
849+
* @param[in] typeIn The peer address type.
850+
* @param[in] addressIn The peer address.
851+
*
852+
* @post type is equal to typeIn and address is equal to the content
853+
* present in addressIn.
854+
*/
855+
entry_t(peer_address_type_t typeIn, const address_t &addressIn) :
856+
type(typeIn),
857+
address(addressIn)
858+
{ }
859+
860+
/**
861+
* Empty constructor.
862+
*
863+
* @note The address constructed with the empty constructor is not
864+
* valid.
865+
*
866+
* @post type is equal to PUBLIC and the address value is equal to
867+
* 00:00:00:00:00:00
868+
*/
869+
entry_t(void) : type(), address() { }
870+
871+
/**
872+
* Type of the peer address.
873+
*/
874+
peer_address_type_t type;
875+
876+
/**
877+
* Value of the peer address.
878+
*/
879+
address_t address;
880+
};
881+
840882
/**
841883
* Pointer to the array of the addresses composing the whitelist.
842884
*/
843-
BLEProtocol::Address_t *addresses;
885+
entry_t *addresses;
844886

845887
/**
846888
* Number addresses in this whitelist.

0 commit comments

Comments
 (0)