move values out of GAP

pull/8738/head
paul-szczepanek-arm 2018-11-15 14:32:32 +00:00 committed by Vincent Coubard
parent 7aa1e95193
commit 3e72570c52
3 changed files with 15 additions and 15 deletions

View File

@ -43,6 +43,15 @@ void clamp(T& value, const R& min, const R& max) {
}
}
/** Special advertising set handle used for the legacy advertising set. */
static const advertising_handle_t LEGACY_ADVERTISING_HANDLE = 0x00;
/** Special advertising set handle used as return or parameter to signify an invalid handle. */
static const advertising_handle_t INVALID_ADVERTISING_HANDLE = 0xFF;
/** Maximum advertising data length that can fit in a legacy PDU. */
static const uint8_t LEGACY_ADVERTISING_MAX_SIZE = 0x1F;
/** Features supported by the controller.
* @see BLUETOOTH SPECIFICATION Version 5.0 | Vol 6, Part B - 4.6 */
struct controller_supported_features_t : SafeEnum<controller_supported_features_t, uint8_t> {

View File

@ -1091,15 +1091,6 @@ public:
/** Type of advertisement scanned. */
typedef ble::advertising_event_t AdvertisingEventType_t;
/** Special advertising set handle used for the legacy advertising set. */
static const AdvHandle_t LEGACY_ADVERTISING_HANDLE = 0x00;
/** Maximum advertising data length that can fit in a legacy PDU. */
static const uint8_t LEGACY_ADVERTISING_MAX_SIZE = 0x1F;
/** Special advertising set handle used as return or parameter to signify an invalid handle. */
static const AdvHandle_t INVALID_ADVERTISING_HANDLE = 0xFF;
/**
* Definition of the general handler of Gap related events.
*/
@ -1695,7 +1686,7 @@ public:
* by this function must be used for all other calls that accept an advertising handle.
* When done with advertising, remove from the system using destroyAdvertisingSet().
*
* @note The exception is the LEGACY_ADVERTISING_HANDLE which may be used at any time.
* @note The exception is the ble::LEGACY_ADVERTISING_HANDLE which may be used at any time.
*
* @param[out] handle Advertising handle returned, valid only if function returned success.
* @param parameters Advertising parameters for the newly created set.
@ -1714,7 +1705,7 @@ public:
/** Remove the advertising set (resets its set parameters). The advertising set must not
* be active.
*
* @note LEGACY_ADVERTISING_HANDLE may not be destroyed.
* @note ble::LEGACY_ADVERTISING_HANDLE may not be destroyed.
*
* @param handle Advertising set handle.
* @return BLE_ERROR_NONE on success.

View File

@ -1858,11 +1858,11 @@ ble_error_t GenericGap::setAdvertisingData(
// handle special case of legacy advertising
if (!is_extended_advertising_available()) {
if (handle != Gap::LEGACY_ADVERTISING_HANDLE) {
if (handle != LEGACY_ADVERTISING_HANDLE) {
return BLE_ERROR_INVALID_PARAM;
}
if (payload.size() > GAP_ADVERTISING_DATA_MAX_PAYLOAD) {
if (payload.size() > LEGACY_ADVERTISING_MAX_SIZE) {
return BLE_ERROR_INVALID_PARAM;
}
@ -1939,7 +1939,7 @@ ble_error_t GenericGap::startAdvertising(
}
if (!is_extended_advertising_available()) {
if (handle != Gap::LEGACY_ADVERTISING_HANDLE) {
if (handle != LEGACY_ADVERTISING_HANDLE) {
return BLE_ERROR_INVALID_PARAM;
}
@ -1999,7 +1999,7 @@ ble_error_t GenericGap::stopAdvertising(AdvHandle_t handle) {
}
if (!is_extended_advertising_available()) {
if (handle != Gap::LEGACY_ADVERTISING_HANDLE) {
if (handle != LEGACY_ADVERTISING_HANDLE) {
return BLE_ERROR_INVALID_PARAM;
}