BLE: merge ble::target_peer_address_type_t and advertising_peer_address_type_t

pull/8738/head
Vincent Coubard 2018-11-15 14:24:10 +00:00
parent d8eb9de459
commit 7aa1e95193
3 changed files with 10 additions and 31 deletions

View File

@ -415,12 +415,15 @@ struct own_address_type_t : SafeEnum<own_address_type_t, uint8_t> {
own_address_type_t(type value) : SafeEnum(value) { } own_address_type_t(type value) : SafeEnum(value) { }
}; };
struct target_peer_address_type_t : ble::SafeEnum<target_peer_address_type_t, uint8_t> { struct target_peer_address_type_t : SafeEnum<target_peer_address_type_t, uint8_t> {
enum type { enum type {
PUBLIC = 0, /**< Public Device Address or Public Identity Address. */ PUBLIC = 0x00, /**< Public Device Address or Public Identity Address. */
RANDOM /**< Random Device Address or Random (static) Identity Address. */ PUBLIC_ADDRESS = 0x00,
RANDOM = 0x01, /**< Random Device Address or Random (static) Identity Address. */
RANDOM_ADDRESS = 0x01
}; };
target_peer_address_type_t(type value) : ble::SafeEnum<target_peer_address_type_t, uint8_t>(value) { } target_peer_address_type_t(type value) : SafeEnum(value) { }
}; };
/** /**

View File

@ -28,31 +28,7 @@ typedef ble::advertising_type_t advertising_type_t;
typedef ble::own_address_type_t own_address_type_t; typedef ble::own_address_type_t own_address_type_t;
typedef ble::target_peer_address_type_t advertising_peer_address_type_t;
/**
* Type modeling the peer address type during direct advertising.
*/
struct advertising_peer_address_type_t :
SafeEnum<advertising_peer_address_type_t, uint8_t> {
enum type {
/**
* Public device address or identity address.
*/
PUBLIC_ADDRESS = 0x00,
/**
* Random device address or random (static) identity address.
*/
RANDOM_ADDRESS = 0x01
};
/**
* Construct a new instance of advertising_peer_address_type_t.
*/
advertising_peer_address_type_t(type value) :
SafeEnum<advertising_peer_address_type_t, uint8_t>(value) { }
};
/** /**
* Peer address type used during connection initiating. * Peer address type used during connection initiating.

View File

@ -1763,7 +1763,7 @@ ble_error_t GenericGap::setAdvertisingParameters(
params.getMaxPrimaryInterval().value(), params.getMaxPrimaryInterval().value(),
params.getType(), params.getType(),
params.getOwnAddressType(), params.getOwnAddressType(),
(pal::advertising_peer_address_type_t::type) params.getPeerAddressType().value(), params.getPeerAddressType(),
params.getPeerAddress(), params.getPeerAddress(),
channel_map, channel_map,
params.getPolicyMode() params.getPolicyMode()
@ -1800,7 +1800,7 @@ ble_error_t GenericGap::setExtendedAdvertisingParameters(
params.getMaxPrimaryInterval().value(), params.getMaxPrimaryInterval().value(),
channel_map, channel_map,
params.getOwnAddressType(), params.getOwnAddressType(),
(pal::advertising_peer_address_type_t::type) params.getPeerAddressType().value(), params.getPeerAddressType(),
params.getPeerAddress(), params.getPeerAddress(),
params.getPolicyMode(), params.getPolicyMode(),
params.getTxPower(), params.getTxPower(),