You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mynewt.apache.org by GitBox <gi...@apache.org> on 2018/12/05 12:37:35 UTC

[GitHub] andrzej-kaczmarek commented on a change in pull request #250: Fixed first argument passed to ble_gattc_notify_custom(), helps fixing issue of assert failure when peer enables 'notification'.

andrzej-kaczmarek commented on a change in pull request #250: Fixed first argument passed to ble_gattc_notify_custom(), helps fixing issue of assert failure when peer enables 'notification'.
URL: https://github.com/apache/mynewt-nimble/pull/250#discussion_r239047766
 
 

 ##########
 File path: apps/blehr/src/main.c
 ##########
 @@ -162,11 +165,17 @@ blehr_gap_event(struct ble_gap_event *event, void *arg)
         if (event->connect.status != 0) {
             /* Connection failed; resume advertising */
             blehr_advertise();
+            conn_handle = 0;
+        }
+        else {
+          conn_handle = event->connect.conn_handle;
         }
+
         break;
 
     case BLE_GAP_EVENT_DISCONNECT:
         MODLOG_DFLT(INFO, "disconnect; reason=%d\n", event->disconnect.reason);
+        conn_handle = 0; // reset conn_handle
 
 Review comment:
   0 is a valid connection handle, we have symbol defined iirc in GAP for invalid conn handle
   also do not use C++ style comments

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services