@@ -544,7 +544,6 @@ int NimBLEServer::handleGapEvent(ble_gap_event* event, void* arg) {
544544 break ;
545545 } // BLE_GAP_EVENT_IDENTITY_RESOLVED
546546
547- # if CONFIG_BT_NIMBLE_EXT_ADV
548547 case BLE_GAP_EVENT_PHY_UPDATE_COMPLETE: {
549548 rc = ble_gap_conn_find (event->phy_updated .conn_handle , &peerInfo.m_desc );
550549 if (rc != 0 ) {
@@ -554,7 +553,6 @@ int NimBLEServer::handleGapEvent(ble_gap_event* event, void* arg) {
554553 pServer->m_pServerCallbacks ->onPhyUpdate (peerInfo, event->phy_updated .tx_phy , event->phy_updated .rx_phy );
555554 return 0 ;
556555 } // BLE_GAP_EVENT_PHY_UPDATE_COMPLETE
557- # endif
558556
559557 case BLE_GAP_EVENT_PASSKEY_ACTION: {
560558 struct ble_sm_io pkey = {0 , 0 };
@@ -788,29 +786,6 @@ void NimBLEServer::resetGATT() {
788786 m_gattsStarted = false ;
789787} // resetGATT
790788
791- # if CONFIG_BT_NIMBLE_EXT_ADV
792- /* *
793- * @brief Start advertising.
794- * @param [in] instId The extended advertisement instance ID to start.
795- * @param [in] duration How long to advertise for in milliseconds, 0 = forever (default).
796- * @param [in] maxEvents Maximum number of advertisement events to send, 0 = no limit (default).
797- * @return True if advertising started successfully.
798- * @details Start the server advertising its existence. This is a convenience function and is equivalent to
799- * retrieving the advertising object and invoking start upon it.
800- */
801- bool NimBLEServer::startAdvertising (uint8_t instId, int duration, int maxEvents) const {
802- return getAdvertising ()->start (instId, duration, maxEvents);
803- } // startAdvertising
804-
805- /* *
806- * @brief Convenience function to stop advertising a data set.
807- * @param [in] instId The extended advertisement instance ID to stop advertising.
808- * @return True if advertising stopped successfully.
809- */
810- bool NimBLEServer::stopAdvertising (uint8_t instId) const {
811- return getAdvertising ()->stop (instId);
812- } // stopAdvertising
813-
814789/* *
815790 * @brief Request an update to the PHY used for a peer connection.
816791 * @param [in] connHandle the connection handle to the update the PHY for.
@@ -854,6 +829,30 @@ bool NimBLEServer::getPhy(uint16_t connHandle, uint8_t* txPhy, uint8_t* rxPhy) {
854829
855830 return rc == 0 ;
856831} // getPhy
832+
833+ # if CONFIG_BT_NIMBLE_EXT_ADV
834+ /* *
835+ * @brief Start advertising.
836+ * @param [in] instId The extended advertisement instance ID to start.
837+ * @param [in] duration How long to advertise for in milliseconds, 0 = forever (default).
838+ * @param [in] maxEvents Maximum number of advertisement events to send, 0 = no limit (default).
839+ * @return True if advertising started successfully.
840+ * @details Start the server advertising its existence. This is a convenience function and is equivalent to
841+ * retrieving the advertising object and invoking start upon it.
842+ */
843+ bool NimBLEServer::startAdvertising (uint8_t instId, int duration, int maxEvents) const {
844+ return getAdvertising ()->start (instId, duration, maxEvents);
845+ } // startAdvertising
846+
847+ /* *
848+ * @brief Convenience function to stop advertising a data set.
849+ * @param [in] instId The extended advertisement instance ID to stop advertising.
850+ * @return True if advertising stopped successfully.
851+ */
852+ bool NimBLEServer::stopAdvertising (uint8_t instId) const {
853+ return getAdvertising ()->stop (instId);
854+ } // stopAdvertising
855+
857856# endif
858857
859858# if !CONFIG_BT_NIMBLE_EXT_ADV || defined(_DOXYGEN_)
@@ -1016,10 +1015,8 @@ void NimBLEServerCallbacks::onConnParamsUpdate(NimBLEConnInfo& connInfo) {
10161015 NIMBLE_LOGD (" NimBLEServerCallbacks" , " onConnParamsUpdate: default" );
10171016} // onConnParamsUpdate
10181017
1019- # if CONFIG_BT_NIMBLE_EXT_ADV
10201018void NimBLEServerCallbacks::onPhyUpdate (NimBLEConnInfo& connInfo, uint8_t txPhy, uint8_t rxPhy) {
10211019 NIMBLE_LOGD (" NimBLEServerCallbacks" , " onPhyUpdate: default, txPhy: %d, rxPhy: %d" , txPhy, rxPhy);
10221020} // onPhyUpdate
1023- # endif
10241021
10251022#endif /* CONFIG_BT_ENABLED && CONFIG_BT_NIMBLE_ROLE_PERIPHERAL */
0 commit comments