Skip to content
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

Samples: Bluetooth: Checking return value of functions #16807

Closed

Conversation

martintv
Copy link
Contributor

@martintv martintv commented Aug 8, 2024

Without this, an assert in gatt.c:5350 could happen, when bt_nus_subscribe_receive called bt_gatt_subscribe. It happened when the link got disconnected during
service discovery procedure.

I was debugging something else, and I simulated very bad rf-conditions to trigger this assert.

Callstack when assert triggered
image

@github-actions github-actions bot added the changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. label Aug 8, 2024
@martintv martintv force-pushed the fixing_central_uart_gatt_assert branch from ca4028d to 02f3623 Compare August 8, 2024 15:09
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Aug 8, 2024

Test specification

CI/Jenkins/NRF

  • Integration Platforms

CI/Jenkins/integration

Test Module File based changes Manually selected West overwrite
test-fw-nrfconnect-ble_samples X

Detailed information of selected test modules

Note: This message is automatically posted and updated by the CI

@martintv martintv force-pushed the fixing_central_uart_gatt_assert branch 2 times, most recently from 5e42645 to 1c30d74 Compare August 8, 2024 15:21
Copy link
Contributor

@KAGA164 KAGA164 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

bt_nus_subscribe_receive(nus);
err = bt_nus_handles_assign(dm, nus);
if (err) {
LOG_INF("bt_nus_handles_assign failed with errorcode %i", err);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LOG_INF("bt_nus_handles_assign failed with errorcode %i", err);
LOG_INF("bt_nus_handles_assign failed (err %d)", err);


err = bt_nus_subscribe_receive(nus);
if (err) {
LOG_INF("bt_nus_subscribe_receive failed with errorcode %i", err);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
LOG_INF("bt_nus_subscribe_receive failed with errorcode %i", err);
LOG_INF("bt_nus_subscribe_receive failed (err %d)", err);

Just for cohesion with the rest of sample logs

Without this, an assert in gatt.c:5350 could happen.
It happened when the link got disconnected during
service discovery procedure.

Signed-off-by: Martin Tverdal <[email protected]>
@martintv martintv force-pushed the fixing_central_uart_gatt_assert branch from 1c30d74 to 98b5dd7 Compare August 12, 2024 11:54
@NordicBuilder
Copy link
Contributor

NordicBuilder commented Aug 12, 2024

CI Information

To view the history of this post, clich the 'edited' button above
Build number: 6

Inputs:

Sources:

sdk-nrf: PR head: 98b5dd71f840963d6b979b2b14e8413d82082ee4

more details

sdk-nrf:

PR head: 98b5dd71f840963d6b979b2b14e8413d82082ee4
merge base: 8a01cc36864b39c0f7627088dcb91c29b2d43e37
target head (main): 7064aee2128799895ed5357f886a70ece2ec9f28
Diff

Github labels

Enabled Name Description
ci-disabled Disable the ci execution
ci-all-test Run all of ci, no test spec filtering will be done
ci-force-downstream Force execution of downstream even if twister fails
ci-run-twister Force run twister
ci-run-zephyr-twister Force run zephyr twister
List of changed files detected by CI (1)
samples
│  ├── bluetooth
│  │  ├── central_uart
│  │  │  ├── src
│  │  │  │  │ main.c

Outputs:

Toolchain

Version: 3dd8985b56
Build docker image: docker-dtr.nordicsemi.no/sw-production/ncs-build:3dd8985b56_81ed5a52d6

Test Spec & Results: ✅ Success; ❌ Failure; 🟠 Queued; 🟡 Progress; ◻️ Skipped; ⚠️ Quarantine

  • ◻️ Toolchain - Skipped: existing toolchain is used
  • ❌ Build twister
  • ❌ Integration tests
    • ❌ test-fw-nrfconnect-ble_samples
Disabled integration tests
    • desktop52_verification
    • doc-internal
    • test_ble_nrf_config
    • test-fw-nrfconnect-apps
    • test-fw-nrfconnect-ble_mesh
    • test-fw-nrfconnect-boot
    • test-fw-nrfconnect-chip
    • test-fw-nrfconnect-fem
    • test-fw-nrfconnect-nfc
    • test-fw-nrfconnect-nrf-iot_cloud
    • test-fw-nrfconnect-nrf-iot_libmodem-nrf
    • test-fw-nrfconnect-nrf-iot_lwm2m
    • test-fw-nrfconnect-nrf-iot_mosh
    • test-fw-nrfconnect-nrf-iot_nrf_provisioning
    • test-fw-nrfconnect-nrf-iot_positioning
    • test-fw-nrfconnect-nrf-iot_samples
    • test-fw-nrfconnect-nrf-iot_serial_lte_modem
    • test-fw-nrfconnect-nrf-iot_thingy91
    • test-fw-nrfconnect-nrf-iot_zephyr_lwm2m
    • test-fw-nrfconnect-nrf_crypto
    • test-fw-nrfconnect-proprietary_esb
    • test-fw-nrfconnect-ps
    • test-fw-nrfconnect-rpc
    • test-fw-nrfconnect-rs
    • test-fw-nrfconnect-tfm
    • test-fw-nrfconnect-thread
    • test-fw-nrfconnect-zigbee
    • test-low-level
    • test-sdk-audio
    • test-sdk-dfu
    • test-sdk-find-my
    • test-sdk-mcuboot
    • test-sdk-pmic-samples
    • test-sdk-sidewalk
    • test-sdk-wifi
    • test-secdom-samples-public

Note: This message is automatically posted and updated by the CI

Copy link

This pull request has been marked as stale because it has been open (more than) 30 days with no activity. Remove the stale label or add a comment saying that you would like to have the label removed otherwise this pull request will automatically be closed in 7 days. Note, that you can always re-open a closed pull request at any time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog-entry-required Update changelog before merge. Remove label if entry is not needed or already added. Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants