1515 * limitations under the License.
1616 */
1717
18- #include " nimconfig.h"
19- #if (defined(CONFIG_BT_ENABLED) && defined(CONFIG_BT_NIMBLE_ROLE_BROADCASTER) && !CONFIG_BT_NIMBLE_EXT_ADV) || \
20- defined (_DOXYGEN_)
18+ #include " NimBLEAdvertising.h"
19+ #if (CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_BROADCASTER && !CONFIG_BT_NIMBLE_EXT_ADV) || defined(_DOXYGEN_)
2120
2221# if defined(CONFIG_NIMBLE_CPP_IDF)
2322# include " services/gap/ble_svc_gap.h"
2423# else
2524# include " nimble/nimble/host/services/gap/include/services/gap/ble_svc_gap.h"
2625# endif
27- # include " NimBLEAdvertising.h"
2826# include " NimBLEDevice.h"
2927# include " NimBLEServer.h"
3028# include " NimBLEUtils.h"
@@ -44,7 +42,7 @@ NimBLEAdvertising::NimBLEAdvertising()
4442 m_duration{BLE_HS_FOREVER},
4543 m_scanResp{false },
4644 m_advDataSet{false } {
47- # if !defined( CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
45+ # if !CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
4846 m_advParams.conn_mode = BLE_GAP_CONN_MODE_NON;
4947# else
5048 m_advParams.conn_mode = BLE_GAP_CONN_MODE_UND;
@@ -197,7 +195,7 @@ bool NimBLEAdvertising::start(uint32_t duration, const NimBLEAddress* dirAddr) {
197195 return true ;
198196 }
199197
200- # if defined( CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
198+ # if CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
201199 NimBLEServer* pServer = NimBLEDevice::getServer ();
202200 if (pServer != nullptr ) {
203201 pServer->start (); // make sure the GATT server is ready before advertising
@@ -222,7 +220,7 @@ bool NimBLEAdvertising::start(uint32_t duration, const NimBLEAddress* dirAddr) {
222220 duration = BLE_HS_FOREVER;
223221 }
224222
225- # if defined( CONFIG_BT_NIMBLE_ROLE_PERIPHERAL)
223+ # if CONFIG_BT_NIMBLE_ROLE_PERIPHERAL
226224 int rc = ble_gap_adv_start (NimBLEDevice::m_ownAddrType,
227225 (dirAddr != nullptr ) ? dirAddr->getBase () : NULL ,
228226 duration,
@@ -622,4 +620,4 @@ bool NimBLEAdvertising::setServiceData(const NimBLEUUID& uuid, const std::string
622620 return setServiceData (uuid, reinterpret_cast <const uint8_t *>(data.data ()), data.length ());
623621} // setServiceData
624622
625- #endif /* CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_BROADCASTER && !CONFIG_BT_NIMBLE_EXT_ADV */
623+ #endif // ( CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_BROADCASTER && !CONFIG_BT_NIMBLE_EXT_ADV) || defined(_DOXYGEN_)
0 commit comments