1616 */
1717
1818#include " NimBLEAdvertisedDevice.h"
19- #if CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_OBSERVER
19+ #if CONFIG_BT_ENABLED && MYNEWT_VAL(BLE_ROLE_OBSERVER)
2020
2121# include " NimBLEDevice.h"
2222# include " NimBLEUtils.h"
@@ -31,7 +31,7 @@ static const char* LOG_TAG = "NimBLEAdvertisedDevice";
3131 * @param [in] event The advertisement event data.
3232 */
3333NimBLEAdvertisedDevice::NimBLEAdvertisedDevice (const ble_gap_event* event, uint8_t eventType)
34- # if CONFIG_BT_NIMBLE_EXT_ADV
34+ # if MYNEWT_VAL(BLE_EXT_ADV)
3535 : m_address{event->ext_disc .addr },
3636 m_advType{eventType},
3737 m_rssi{event->ext_disc .rssi },
@@ -58,7 +58,7 @@ NimBLEAdvertisedDevice::NimBLEAdvertisedDevice(const ble_gap_event* event, uint8
5858 * @param [in] event The advertisement event data.
5959 */
6060void NimBLEAdvertisedDevice::update (const ble_gap_event* event, uint8_t eventType) {
61- # if CONFIG_BT_NIMBLE_EXT_ADV
61+ # if MYNEWT_VAL(BLE_EXT_ADV)
6262 const auto & disc = event->ext_disc ;
6363 m_isLegacyAdv = disc.props & BLE_HCI_ADV_LEGACY_MASK;
6464# else
@@ -580,7 +580,7 @@ bool NimBLEAdvertisedDevice::haveTXPower() const {
580580 return findAdvField (BLE_HS_ADV_TYPE_TX_PWR_LVL) > 0 ;
581581} // haveTXPower
582582
583- # if CONFIG_BT_NIMBLE_EXT_ADV
583+ # if MYNEWT_VAL(BLE_EXT_ADV)
584584/* *
585585 * @brief Get the set ID of the extended advertisement.
586586 * @return The set ID.
@@ -751,7 +751,7 @@ uint8_t NimBLEAdvertisedDevice::getAddressType() const {
751751 * @return True if the device is connectable.
752752 */
753753bool NimBLEAdvertisedDevice::isConnectable () const {
754- # if CONFIG_BT_NIMBLE_EXT_ADV
754+ # if MYNEWT_VAL(BLE_EXT_ADV)
755755 if (m_isLegacyAdv) {
756756 return m_advType == BLE_HCI_ADV_RPT_EVTYPE_ADV_IND || m_advType == BLE_HCI_ADV_RPT_EVTYPE_DIR_IND;
757757 }
@@ -772,7 +772,7 @@ bool NimBLEAdvertisedDevice::isScannable() const {
772772 * @return True if legacy (Bluetooth 4.x), false if extended (bluetooth 5.x).
773773 */
774774bool NimBLEAdvertisedDevice::isLegacyAdvertisement () const {
775- # if CONFIG_BT_NIMBLE_EXT_ADV
775+ # if MYNEWT_VAL(BLE_EXT_ADV)
776776 return m_isLegacyAdv;
777777# else
778778 return true ;
@@ -813,4 +813,4 @@ const std::vector<uint8_t>::const_iterator NimBLEAdvertisedDevice::end() const {
813813 return m_payload.cend ();
814814}
815815
816- #endif // CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_OBSERVER
816+ #endif // CONFIG_BT_ENABLED && MYNEWT_VAL(BLE_ROLE_OBSERVER)
0 commit comments