diff --git a/libraries/BLE/examples/BLE_iBeacon/BLE_iBeacon.ino b/libraries/BLE/examples/BLE_iBeacon/BLE_iBeacon.ino index e43174d4..324e821e 100644 --- a/libraries/BLE/examples/BLE_iBeacon/BLE_iBeacon.ino +++ b/libraries/BLE/examples/BLE_iBeacon/BLE_iBeacon.ino @@ -65,6 +65,7 @@ void setBeacon() { pAdvertising->setAdvertisementData(oAdvertisementData); pAdvertising->setScanResponseData(oScanResponseData); + pAdvertising->setAdvertisementType(ADV_TYPE_NONCONN_IND); } diff --git a/libraries/BLE/src/BLEAdvertising.cpp b/libraries/BLE/src/BLEAdvertising.cpp index ec73400c..3d86a507 100644 --- a/libraries/BLE/src/BLEAdvertising.cpp +++ b/libraries/BLE/src/BLEAdvertising.cpp @@ -85,6 +85,10 @@ void BLEAdvertising::setAppearance(uint16_t appearance) { m_advData.appearance = appearance; } // setAppearance +void BLEAdvertising::setAdvertisementType(esp_ble_adv_type_t adv_type){ + m_advParams.adv_type = adv_type; +} // setAdvertisementType + void BLEAdvertising::setMinInterval(uint16_t mininterval) { m_advParams.adv_int_min = mininterval; } // setMinInterval diff --git a/libraries/BLE/src/BLEAdvertising.h b/libraries/BLE/src/BLEAdvertising.h index be85371e..94bed945 100644 --- a/libraries/BLE/src/BLEAdvertising.h +++ b/libraries/BLE/src/BLEAdvertising.h @@ -52,6 +52,7 @@ public: void start(); void stop(); void setAppearance(uint16_t appearance); + void setAdvertisementType(esp_ble_adv_type_t adv_type); void setMaxInterval(uint16_t maxinterval); void setMinInterval(uint16_t mininterval); void setAdvertisementData(BLEAdvertisementData& advertisementData); @@ -76,4 +77,4 @@ private: }; #endif /* CONFIG_BT_ENABLED */ -#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */ \ No newline at end of file +#endif /* COMPONENTS_CPP_UTILS_BLEADVERTISING_H_ */