diff --git a/features/FEATURE_BLE/ble/GapAdvertisingData.h b/features/FEATURE_BLE/ble/GapAdvertisingData.h index 773520309f..5235ef1bca 100644 --- a/features/FEATURE_BLE/ble/GapAdvertisingData.h +++ b/features/FEATURE_BLE/ble/GapAdvertisingData.h @@ -720,7 +720,7 @@ public: uint16_t getAppearance(void) const { uint16_t appearance = GENERIC_TAG; - uint8_t *field = findField(AdvertisingData::APPEARANCE); + const uint8_t *field = findField(AdvertisingData::APPEARANCE); if (field) { memcpy((uint8_t*)appearance, field, 2); } diff --git a/features/FEATURE_BLE/ble/generic/GenericGap.h b/features/FEATURE_BLE/ble/generic/GenericGap.h index 25ed71a612..fe14e6b00c 100644 --- a/features/FEATURE_BLE/ble/generic/GenericGap.h +++ b/features/FEATURE_BLE/ble/generic/GenericGap.h @@ -488,7 +488,7 @@ private: uint8_t byte = bit_number / 8; uint8_t bit = bit_number - byte; bytes += byte; - *bytes |= (0x01 >> bit); + *bytes = *bytes | (0x01 >> bit); return true; } @@ -498,8 +498,8 @@ private: } uint8_t byte = bit_number / 8; uint8_t bit = bit_number - byte; - bytes += byte - *bytes &= (0x00 >> bit); + bytes += byte; + *bytes = *bytes & (0x00 >> bit); return true; } }; diff --git a/features/FEATURE_BLE/source/generic/GenericGap.cpp b/features/FEATURE_BLE/source/generic/GenericGap.cpp index 4ff0e65c14..42b4c3001e 100644 --- a/features/FEATURE_BLE/source/generic/GenericGap.cpp +++ b/features/FEATURE_BLE/source/generic/GenericGap.cpp @@ -1628,10 +1628,10 @@ ble_error_t GenericGap::setAdvertisingParams(AdvHandle_t handle, const GapAdvert case ADV_NON_CONNECTABLE_UNDIRECTED: case EXT_ADV_NON_CONNECTABLE_DIRECTED: case EXT_ADV_SCANNABLE_DIRECTED: - use_type = AddressUseType_t::PERIPHERAL_NON_CONNECTABLE + use_type = PERIPHERAL_NON_CONNECTABLE; break; default: - use_type = AddressUseType_t::PERIPHERAL_CONNECTABLE; + use_type = PERIPHERAL_CONNECTABLE; } return _pal_gap.set_extended_advertising_parameters( @@ -1642,14 +1642,14 @@ ble_error_t GenericGap::setAdvertisingParams(AdvHandle_t handle, const GapAdvert pal::advertising_channel_map_t::ALL_ADVERTISING_CHANNELS, (pal::own_address_type_t)get_own_address_type(use_type), pal::advertising_peer_address_type_t::PUBLIC_ADDRESS, - params->getPeerAddress(), + ble::address_t(), (pal::advertising_filter_policy_t)_advertising_filter_policy, - (pal::advertising_power_t)params->getTxPower(), - params->getPrimaryPhy(), - params->getSecondaryMaxSkip(), - params->getSecondaryPhy(), + 0, + ble::phy_set_t::PHY_SET_1M, + 0, + ble::phy_set_t::PHY_SET_1M, 0xFF, - params->getScanRequestNotification() + true ); }