@@ -152,35 +152,35 @@ size_t NimBLEClient::deleteService(const NimBLEUUID &uuid) {
152152
153153/* *
154154 * @brief Connect to the BLE Server.
155- * @param [in] deleteAttibutes If true this will delete any attribute objects this client may already\n
155+ * @param [in] deleteAttributes If true this will delete any attribute objects this client may already\n
156156 * have created and clears the vectors after successful connection.
157157 * @return True on success.
158158 */
159- bool NimBLEClient::connect (bool deleteAttibutes ) {
160- return connect (m_peerAddress, deleteAttibutes );
159+ bool NimBLEClient::connect (bool deleteAttributes ) {
160+ return connect (m_peerAddress, deleteAttributes );
161161}
162162
163163/* *
164164 * @brief Connect to an advertising device.
165165 * @param [in] device The device to connect to.
166- * @param [in] deleteAttibutes If true this will delete any attribute objects this client may already\n
166+ * @param [in] deleteAttributes If true this will delete any attribute objects this client may already\n
167167 * have created and clears the vectors after successful connection.
168168 * @return True on success.
169169 */
170- bool NimBLEClient::connect (NimBLEAdvertisedDevice* device, bool deleteAttibutes ) {
170+ bool NimBLEClient::connect (NimBLEAdvertisedDevice* device, bool deleteAttributes ) {
171171 NimBLEAddress address (device->getAddress ());
172- return connect (address, deleteAttibutes );
172+ return connect (address, deleteAttributes );
173173}
174174
175175
176176/* *
177177 * @brief Connect to the BLE Server.
178178 * @param [in] address The address of the server.
179- * @param [in] deleteAttibutes If true this will delete any attribute objects this client may already\n
179+ * @param [in] deleteAttributes If true this will delete any attribute objects this client may already\n
180180 * have created and clears the vectors after successful connection.
181181 * @return True on success.
182182 */
183- bool NimBLEClient::connect (const NimBLEAddress &address, bool deleteAttibutes ) {
183+ bool NimBLEClient::connect (const NimBLEAddress &address, bool deleteAttributes ) {
184184 NIMBLE_LOGD (LOG_TAG, " >> connect(%s)" , address.toString ().c_str ());
185185
186186 if (!NimBLEDevice::m_synced) {
@@ -271,20 +271,11 @@ bool NimBLEClient::connect(const NimBLEAddress &address, bool deleteAttibutes) {
271271 // Wait for the connect timeout time +1 second for the connection to complete
272272 if (ulTaskNotifyTake (pdTRUE, pdMS_TO_TICKS (m_connectTimeout + 1000 )) == pdFALSE) {
273273 m_pTaskData = nullptr ;
274- // If a connection was made but no response from MTU exchange; disconnect
275- if (isConnected ()) {
276- NIMBLE_LOGE (LOG_TAG, " Connect timeout - no response" );
277- disconnect ();
278- } else {
279- // workaround; if the controller doesn't cancel the connection
280- // at the timeout, cancel it here.
281- NIMBLE_LOGE (LOG_TAG, " Connect timeout - cancelling" );
282- ble_gap_conn_cancel ();
283- }
284-
285- return false ;
274+ // If a connection was made but no response from MTU exchange; ignore
275+ NIMBLE_LOGE (LOG_TAG, " Connection was made but no response from MTU exchange" );
276+ }
286277
287- } else if (taskData.rc != 0 ){
278+ if (taskData.rc != 0 ){
288279 m_lastErr = taskData.rc ;
289280 NIMBLE_LOGE (LOG_TAG, " Connection failed; status=%d %s" ,
290281 taskData.rc ,
@@ -299,7 +290,7 @@ bool NimBLEClient::connect(const NimBLEAddress &address, bool deleteAttibutes) {
299290 NIMBLE_LOGI (LOG_TAG, " Connection established" );
300291 }
301292
302- if (deleteAttibutes ) {
293+ if (deleteAttributes ) {
303294 deleteServices ();
304295 }
305296
0 commit comments