mirror of https://github.com/ARMmbed/mbed-os.git
BLE: Merve ble::advertising_policy_mode and pal::advertising_filter_policy .
parent
db55540952
commit
c6cdfd0b7e
|
@ -82,7 +82,7 @@ public:
|
|||
_maxInterval(maxInterval),
|
||||
_peerAddressType(ble::target_peer_address_type_t::PUBLIC),
|
||||
_ownAddressType(ble::own_address_type_t::PUBLIC),
|
||||
_policy(ble::ADV_POLICY_IGNORE_WHITELIST),
|
||||
_policy(advertising_filter_policy_t::NO_FILTER),
|
||||
_primaryPhy(ble::phy_t::LE_1M),
|
||||
_secondaryPhy(ble::phy_t::LE_1M),
|
||||
_peerAddress(),
|
||||
|
@ -273,7 +273,7 @@ public:
|
|||
*
|
||||
* @return A reference to this object.
|
||||
*/
|
||||
AdvertisingParameters &setPolicyMode(advertising_policy_mode_t mode)
|
||||
AdvertisingParameters &setPolicyMode(advertising_filter_policy_t mode)
|
||||
{
|
||||
_policy = mode;
|
||||
return *this;
|
||||
|
@ -283,7 +283,7 @@ public:
|
|||
*
|
||||
* @return Policy used.
|
||||
*/
|
||||
ble::advertising_policy_mode_t getPolicyMode() const
|
||||
ble::advertising_filter_policy_t getPolicyMode() const
|
||||
{
|
||||
return _policy;
|
||||
}
|
||||
|
@ -458,7 +458,7 @@ private:
|
|||
|
||||
target_peer_address_type_t _peerAddressType;
|
||||
own_address_type_t _ownAddressType;
|
||||
advertising_policy_mode_t _policy;
|
||||
advertising_filter_policy_t _policy;
|
||||
phy_t _primaryPhy;
|
||||
phy_t _secondaryPhy;
|
||||
address_t _peerAddress;
|
||||
|
|
|
@ -250,26 +250,34 @@ typedef int8_t advertising_power_t;
|
|||
*
|
||||
* @see Bluetooth Core Specification 4.2 (Vol. 6), Part B, Section 4.3.2.
|
||||
*/
|
||||
enum advertising_policy_mode_t {
|
||||
/**
|
||||
* The whitelist is not used to filter peer request during advertising.
|
||||
*/
|
||||
ADV_POLICY_IGNORE_WHITELIST = 0,
|
||||
struct advertising_filter_policy_t : SafeEnum<advertising_filter_policy_t, uint8_t> {
|
||||
enum type {
|
||||
/**
|
||||
* Process connection and scan requests from all devices. The whitelist is
|
||||
* not used.
|
||||
*/
|
||||
NO_FILTER = 0x00,
|
||||
|
||||
/**
|
||||
* The whitelist is used to filter peer scan requests.
|
||||
*/
|
||||
ADV_POLICY_FILTER_SCAN_REQS = 1,
|
||||
/**
|
||||
* Process connection requests from all devices but filter out scan requests
|
||||
* of devices which are not in the whitelist.
|
||||
*/
|
||||
FILTER_SCAN_REQUESTS = 0x01,
|
||||
|
||||
/**
|
||||
* The whitelist is used to filter peer connection requests.
|
||||
*/
|
||||
ADV_POLICY_FILTER_CONN_REQS = 2,
|
||||
/**
|
||||
* Process scan requests from all devices but filter out connection requests
|
||||
* of devices which are not in the whitelist.
|
||||
*/
|
||||
FILTER_CONNECTION_REQUEST = 0x02,
|
||||
|
||||
/**
|
||||
* The whitelist is used to filter peer scan and connection requests.
|
||||
*/
|
||||
ADV_POLICY_FILTER_ALL_REQS = 3,
|
||||
/**
|
||||
* Filter out scan or connection requests of devices which are not in the
|
||||
* whitelist.
|
||||
*/
|
||||
FILTER_SCAN_AND_CONNECTION_REQUESTS = 0x03
|
||||
};
|
||||
|
||||
advertising_filter_policy_t(type value) : SafeEnum(value) { }
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -297,45 +297,7 @@ struct disconnection_reason_t : SafeEnum<disconnection_reason_t, uint8_t> {
|
|||
SafeEnum<disconnection_reason_t, uint8_t>(value) { }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Filter policy which can be used during advertising.
|
||||
*/
|
||||
struct advertising_filter_policy_t :
|
||||
SafeEnum<advertising_filter_policy_t, uint8_t> {
|
||||
enum type {
|
||||
/**
|
||||
* Process connection and scan requests from all devices. The whitelist is
|
||||
* not used.
|
||||
*/
|
||||
NO_FILTER = 0x00,
|
||||
|
||||
/**
|
||||
* Process connection requests from all devices but filter out scan requests
|
||||
* of devices which are not in the whitelist.
|
||||
*/
|
||||
FILTER_SCAN_REQUESTS = 0x01,
|
||||
|
||||
/**
|
||||
* Process scan requests from all devices but filter out connection requests
|
||||
* of devices which are not in the whitelist.
|
||||
*/
|
||||
FILTER_CONNECTION_REQUEST = 0x02,
|
||||
|
||||
/**
|
||||
* Filter out scan or connection requests of devices which are not in the
|
||||
* whitelist.
|
||||
*/
|
||||
FILTER_SCAN_AND_CONNECTION_REQUESTS = 0x03
|
||||
};
|
||||
|
||||
/**
|
||||
* Construct a new instance of advertising_filter_policy_t.
|
||||
*/
|
||||
advertising_filter_policy_t(type value) :
|
||||
SafeEnum<advertising_filter_policy_t, uint8_t>(value) { }
|
||||
};
|
||||
|
||||
typedef ble::advertising_filter_policy_t advertising_filter_policy_t;
|
||||
|
||||
/**
|
||||
* Filter policy which can be used during a scan.
|
||||
|
|
|
@ -1766,7 +1766,7 @@ ble_error_t GenericGap::setAdvertisingParams(
|
|||
(pal::advertising_peer_address_type_t::type) params.getPeerAddressType().value(),
|
||||
params.getPeerAddress(),
|
||||
channel_map,
|
||||
(pal::advertising_filter_policy_t::type) params.getPolicyMode()
|
||||
params.getPolicyMode()
|
||||
);
|
||||
} else {
|
||||
return setExtendedAdvertisingParameters(handle, params);
|
||||
|
@ -1802,7 +1802,7 @@ ble_error_t GenericGap::setExtendedAdvertisingParameters(
|
|||
(pal::own_address_type_t::type) params.getOwnAddressType().value(),
|
||||
(pal::advertising_peer_address_type_t::type) params.getPeerAddressType().value(),
|
||||
params.getPeerAddress(),
|
||||
(pal::advertising_filter_policy_t::type) params.getPolicyMode(),
|
||||
params.getPolicyMode(),
|
||||
params.getTxPower(),
|
||||
params.getPrimaryPhy(),
|
||||
params.getSecondaryMaxSkip(),
|
||||
|
|
Loading…
Reference in New Issue