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

nrf52-ble: fix total links count #7966

Merged
merged 2 commits into from Oct 23, 2018

Conversation

Projects
None yet
5 participants
@pingdan32
Contributor

pingdan32 commented Sep 3, 2018

Description

I think I found a bug about the NRF52 series. The NRF_SDH_BLE_TOTAL_LINK_COUNT is NOT defined in any configuration file except sdk_config.h. This causes the actual number of total links to be inconsistent with the definition when central_link_count or peripheral_link_count is configured via features/FEATURE_BLE/targets/TARGET_NORDIC/mbed_lib.json.

This PR fixes this bug and I think this is a good way. Please review.

Pull request type

[x] Fix
[ ] Refactor
[ ] Target update
[ ] Functionality change
[ ] Breaking change

@pingdan32 pingdan32 changed the title from nrf52-ble: fix total link count to nrf52-ble: fix total links count Sep 3, 2018

@0xc0170 0xc0170 requested a review from ARMmbed/mbed-os-pan Sep 3, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Sep 20, 2018

@ARMmbed/mbed-os-pan Please review

@pan-

TOTAL_LINK_COUNT is the number of concurrent connections which, at most, will be equal to the number of central and peripheral links count if peripheral and central roles operates in parallel.

If peripheral and central roles do not operate in parallel in the application then TOTAL_LINK_COUNT should be equal to max(CENTRAL_LINK_COUNT, PERIPHERAL_LINK_COUNT).

In the end, TOTAL_LINK_COUNT depends on the application. Unfortunately the fix proposed doesn't fit everyone needs.

@donatieng What should be the default value ?

@0xc0170 0xc0170 added needs: work and removed needs: review labels Sep 20, 2018

@pingdan32

This comment has been minimized.

Contributor

pingdan32 commented Sep 25, 2018

@pan-

In the end, TOTAL_LINK_COUNT depends on the application. Unfortunately the fix proposed doesn't fit everyone needs.

The key to the problem is how to distinguish the role of the application. I think that it is not as good as user configuration by tools detection. CENTRAL_LINK_COUNT and PERIPHERAL_LINK_COUNT have been configured by the user, so we should trust that it is what the user needs. In other words, if the application is only in CENTRAL mode, then CENTRAL_LINK_COUNT=x PERIPHREAL_LINK_COUNT=0 should be configured. All we have to do is trust the user, not overdetect.

@pan-

This comment has been minimized.

Member

pan- commented Sep 25, 2018

@pingdan32 I believe an entry config file would solves everyone problems:

        "total_link_count": {
            "help": "How many concurrent connections the system support.",
            "value": "(NRF_SDH_BLE_CENTRAL_LINK_COUNT + NRF_SDH_BLE_PERIPHERAL_LINK_COUNT)",
            "macro_name": "NRF_SDH_BLE_TOTAL_LINK_COUNT"
        },

What do you think ?

@pingdan32

This comment has been minimized.

Contributor

pingdan32 commented Sep 26, 2018

@pingdan32 I believe an entry config file would solves everyone problems:

        "total_link_count": {
            "help": "How many concurrent connections the system support.",
            "value": "(NRF_SDH_BLE_CENTRAL_LINK_COUNT + NRF_SDH_BLE_PERIPHERAL_LINK_COUNT)",
            "macro_name": "NRF_SDH_BLE_TOTAL_LINK_COUNT"
        },

What do you think ?

😁Good idea! I can't agree more.

Changes addressed. Review?

@cmonr cmonr added needs: review and removed needs: work labels Oct 18, 2018

@cmonr

This comment has been minimized.

Contributor

cmonr commented Oct 18, 2018

@pan- Mind re-reviewing?

@pan-

pan- approved these changes Oct 23, 2018

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Oct 23, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 23, 2018

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 23, 2018

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Oct 23, 2018

Failures look unrelated, seems like CI did not cleanup properly, restarting

/morph build

@mbed-ci

This comment has been minimized.

mbed-ci commented Oct 23, 2018

Build : SUCCESS

Build number : 3441
Build artifacts/logs : http://mbed-os.s3-website-eu-west-1.amazonaws.com/?prefix=builds/7966/

Triggering tests

/morph test
/morph export-build
/morph mbed2-build

@mbed-ci

This comment has been minimized.

@cmonr

This comment has been minimized.

Contributor

cmonr commented Oct 23, 2018

/morph mbed2-build

@mbed-ci

This comment has been minimized.

@cmonr cmonr merged commit cd55994 into ARMmbed:master Oct 23, 2018

15 checks passed

ci-morph-build build completed
Details
ci-morph-exporter build completed
Details
ci-morph-mbed2-build build completed
Details
ci-morph-test test completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
jenkins-ci/cloud_client_smoke_test Success
Details
jenkins-ci/unittests Success
Details
travis-ci/astyle Passed, 612 files
Details
travis-ci/docs Local docs testing has passed
Details
travis-ci/events Passed, runtime is 9070 cycles (-49 cycles)
Details
travis-ci/gitattributestest Local gitattributestest testing has passed
Details
travis-ci/licence_check Local licence_check testing has passed
Details
travis-ci/littlefs Passed, code size is 8372B (+0.00%)
Details
travis-ci/tools-py2.7 Local tools-py2.7 testing has passed
Details

@cmonr cmonr removed the needs: CI label Oct 23, 2018

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