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

nrf52-ble: fix total links count #7966

Merged
merged 2 commits into from
Oct 23, 2018
Merged

Conversation

pingdan32
Copy link
Contributor

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 nrf52-ble: fix total link count nrf52-ble: fix total links count Sep 3, 2018
@0xc0170 0xc0170 requested a review from a team September 3, 2018 09:13
@0xc0170
Copy link
Contributor

0xc0170 commented Sep 20, 2018

@ARMmbed/mbed-os-pan Please review

pan-
pan- previously requested changes Sep 20, 2018
Copy link
Member

@pan- pan- left a comment

Choose a reason for hiding this comment

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

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 ?

@pingdan32
Copy link
Contributor Author

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-
Copy link
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
Copy link
Contributor Author

@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.

@cmonr cmonr dismissed pan-’s stale review October 18, 2018 15:39

Changes addressed. Review?

@cmonr
Copy link
Contributor

cmonr commented Oct 18, 2018

@pan- Mind re-reviewing?

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 23, 2018

/morph build

@mbed-ci
Copy link

mbed-ci commented Oct 23, 2018

Build : FAILURE

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

@0xc0170
Copy link
Contributor

0xc0170 commented Oct 23, 2018

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

/morph build

@mbed-ci
Copy link

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
Copy link

mbed-ci commented Oct 23, 2018

@cmonr
Copy link
Contributor

cmonr commented Oct 23, 2018

/morph mbed2-build

@mbed-ci
Copy link

mbed-ci commented Oct 23, 2018

@cmonr cmonr merged commit cd55994 into ARMmbed:master Oct 23, 2018
@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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants