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

BLE: Cordio build time configuration through mbed_lib.json #9813

Merged
merged 8 commits into from
Feb 25, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions features/FEATURE_BLE/targets/TARGET_CORDIO/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ implementation.
* `cordio_stack`: Headers and sources of the cordio stack
* `mbed_os_adaptation`: Headers of the interface responsible for the bridge
between BLE API and the Cordio stack.

## Build time configuration

Build time configuration may be controlled through options set in:
`features\FEATURE_BLE\targets\TARGET_CORDIO\mbed_lib.json`

## Documentation

Expand Down
58 changes: 58 additions & 0 deletions features/FEATURE_BLE/targets/TARGET_CORDIO/mbed_lib.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
{
"name": "cordio",
"config": {
"max-connections": {
"help": "Maximum number of connections",
"value": 3,
"macro_name": "DM_CONN_MAX"
},
"max-syncs": {
"help": "Maximum number of periodic advertising synchronizations",
"value": 1,
"macro_name": "DM_SYNC_MAX"
},
"max-advertising-sets": {
"help": "Number of supported advertising sets: must be set to 1 for legacy advertising",
"value": 3,
"macro_name": "DM_NUM_ADV_SETS"
},
"max-phys": {
"help": "Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for legacy scanner and initiator",
"value": 3,
"macro_name": "DM_NUM_PHYS"
},
"max-l2cap-channels": {
"help": "Maximum number of connection oriented channels",
"value": 8,
"macro_name": "L2C_COC_CHAN_MAX"
},
"max-l2cap-clients": {
"help": "Maximum number of connection oriented channel registered clients",
"value": 4,
"macro_name": "L2C_COC_REG_MAX"
},
"max-att-writes": {
"help": "Maximum number of simultaneous ATT write commands",
"value": 1,
"macro_name": "ATT_NUM_SIMUL_WRITE_CMD"
},
"max-att-notifications": {
"help": "Maximum number of simultaneous ATT notifications",
"value": 1,
"macro_name": "ATT_NUM_SIMUL_NTF"
},
"max-smp-devices": {
"help": "Max number of devices in the security database",
"value": 3,
"macro_name": "SMP_DB_MAX_DEVICES"
},
"desired-att-mtu": {
"help": "Desired ATT_MTU, this needs to be between 23 and 517 (inclusive).",
"value": 23
},
"max-prepared-writes": {
"help": "Number of queued prepare writes supported by server.",
"value": 4
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,17 @@ l2cCfg_t *pL2cCfg = &l2cCfg;
ATT
**************************************************************************************************/

#if MBED_CONF_CORDIO_DESIRED_ATT_MTU < ATT_DEFAULT_MTU || MBED_CONF_CORDIO_DESIRED_ATT_MTU > ATT_MAX_MTU
#error "CORDIO_CFG_DESIRED_ATT_MTU value is outside valid range"
#endif

/* Configuration structure */
attCfg_t attCfg =
{
15, /* ATT server service discovery connection idle timeout in seconds */
ATT_DEFAULT_MTU, /* desired ATT MTU */
ATT_MAX_TRANS_TIMEOUT, /* transcation timeout in seconds */
4 /* number of queued prepare writes supported by server */
15, /* ATT server service discovery connection idle timeout in seconds */
MBED_CONF_CORDIO_DESIRED_ATT_MTU, /* desired ATT MTU */
ATT_MAX_TRANS_TIMEOUT, /* transaction timeout in seconds */
MBED_CONF_CORDIO_MAX_PREPARED_WRITES /* number of queued prepare writes supported by server */
};

/* Configuration pointer */
Expand Down