rymanluk commented on a change in pull request #777: nimble/host: Clear master and slave states on host reset URL: https://github.com/apache/mynewt-nimble/pull/777#discussion_r397004577
########## File path: nimble/host/src/ble_hs.c ########## @@ -388,6 +388,13 @@ ble_hs_reset(void) /* Clear configured addresses. */ ble_hs_id_reset(); + /* Clear adverising and scanning states. */ + if (conn_handle == BLE_HS_CONN_HANDLE_NONE) { Review comment: we should just call `ble_gap_reset_state` with a `ble_hs_reset_reason`. Imho `conn_handle` at this point is always `BLE_HS_CONN_HANDLE_NONE`. BTW later I think that we can move following block ``` while (1) { conn_handle = ble_hs_atomic_first_conn_handle(); if (conn_handle == BLE_HS_CONN_HANDLE_NONE) { break; } ble_gap_conn_broken(conn_handle, ble_hs_reset_reason); } ``` to the new `ble_gap_reset_state()` ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: us...@infra.apache.org With regards, Apache Git Services