New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Connection complete fix #41

merged 3 commits into from Apr 12, 2018


None yet
2 participants

sjanc commented Apr 12, 2018

No description provided.


Looks good to me. One comment to handle.

@@ -449,7 +449,7 @@ ble_gap_extract_conn_cb(uint16_t conn_handle,
const struct ble_hs_conn *conn;
BLE_HS_DBG_ASSERT(conn_handle != 0);
BLE_HS_DBG_ASSERT(conn_handle <= 0x0eff);

This comment has been minimized.


rymanluk Apr 12, 2018


Can we make 0x0eff as a define? Maybe BLE_CONN_HANDLE_MAX or similar? Or at least comment in the code

sjanc added some commits Apr 12, 2018

nimble/gap: Fix assert checking valid connection handle
Valid connection handle value is 0x000-0x0eff.
nimble/gap: Fix accessing invalid field in LE Connection Complete event
If status is error all other fields are invalid and connection role
should be determined based on error code. This also adds sanity
check if BLE_HS_DEBUG is enabled to verify if upper layers are
correctly ignoring handle value in case of error.
nimble/test: Fix LE Connection Complete tests
In case of error status code all fields of that event are invalid and
should be ignored by host.

Also update connection failure unit test to simulate valid behaviour:
LE Connection Complete event doesn't indicate connection failure but
only attempt to create connection. Failure is reported afterwards
with Disconnected Event with proper reson code.

@sjanc sjanc merged commit 22c5d3d into apache:master Apr 12, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment