Merge pull request #9813 from paul-szczepanek-arm/cordio-cfg

BLE: Cordio build time configuration through mbed_lib.json
pull/9842/head
Cruz Monrreal 2019-02-25 17:28:56 -06:00 committed by GitHub
commit d0881ad259
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 71 additions and 4 deletions

View File

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

View File

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

View File

@ -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 */