put cordio cfg in mbed_lib.json

pull/9813/head
paul-szczepanek-arm 2019-02-22 11:28:28 +00:00
parent f61dee1626
commit 86546440d7
3 changed files with 74 additions and 10 deletions

View File

@ -0,0 +1,60 @@
{
"name": "cordio",
"config": {
"cordio-cfg-max-connections": {
"help": "Maximum number of connections",
"value": 3,
"macro_name": "CORDIO_CFG_MAX_CONNECTIONS"
},
"cordio-cfg-max-syncs": {
"help": "Maximum number of periodic advertising synchronizations",
"value": 1,
"macro_name": "CORDIO_CFG_MAX_SYNCS"
},
"cordio-cfg-max-advertising-sets": {
"help": "Number of supported advertising sets: must be set to 1 for legacy advertising",
"value": 3,
"macro_name": "CORDIO_CFG_MAX_ADVERTISING_SETS"
},
"cordio-cfg-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": "CORDIO_CFG_MAX_PHYS"
},
"cordio-cfg-max-l2cap-channels": {
"help": "Maximum number of connection oriented channels",
"value": 8,
"macro_name": "CORDIO_CFG_MAX_L2CAP_CHANNELS"
},
"cordio-cfg-max-l2cap-clients": {
"help": "Maximum number of connection oriented channel registered clients",
"value": 4,
"macro_name": "CORDIO_CFG_MAX_L2CAP_CLIENTS"
},
"cordio-cfg-max-att-writes": {
"help": "Maximum number of simultaneous ATT write commands",
"value": 1,
"macro_name": "CORDIO_CFG_MAX_ATT_WRITES"
},
"cordio-cfg-max-att-notifications": {
"help": "Maximum number of simultaneous ATT notifications",
"value": 1,
"macro_name": "CORDIO_CFG_MAX_ATT_NOTIFICATIONS"
},
"cordio-cfg-max-smp-devices": {
"help": "Max number of devices in the security database",
"value": 3,
"macro_name": "CORDIO_CFG_MAX_SMP_DEVICES"
},
"cordio-cfg-desired-att-mtu": {
"help": "Desired ATT_MTU, this needs to be between 23 and 517 (inclusive).",
"value": 23,
"macro_name": "CORDIO_CFG_DESIRED_ATT_MTU"
},
"cordio-cfg-max-prepared-writes": {
"help": "Number of queued prepare writes supported by server.",
"value": 23,
"macro_name": "CORDIO_CFG_MAX_PREPARED_WRITES"
}
}
}

View File

@ -62,11 +62,15 @@ l2cCfg_t *pL2cCfg = &l2cCfg;
ATT ATT
**************************************************************************************************/ **************************************************************************************************/
#if CORDIO_CFG_DESIRED_ATT_MTU < ATT_DEFAULT_MTU || CORDIO_CFG_DESIRED_ATT_MTU > ATT_MAX_MTU
#error "CORDIO_CFG_DESIRED_ATT_MTU value is outside valid range"
#endif
/* Configuration structure */ /* Configuration structure */
attCfg_t attCfg = attCfg_t attCfg =
{ {
15, /* ATT server service discovery connection idle timeout in seconds */ 15, /* ATT server service discovery connection idle timeout in seconds */
ATT_DEFAULT_MTU, /* desired ATT MTU */ CORDIO_CFG_DESIRED_ATT_MTU, /* desired ATT MTU */
ATT_MAX_TRANS_TIMEOUT, /* transcation timeout in seconds */ ATT_MAX_TRANS_TIMEOUT, /* transcation timeout in seconds */
4 /* number of queued prepare writes supported by server */ 4 /* number of queued prepare writes supported by server */
}; };

View File

@ -76,23 +76,23 @@ extern "C" {
/**@{*/ /**@{*/
/*! \brief Maximum number of connections */ /*! \brief Maximum number of connections */
#ifndef DM_CONN_MAX #ifndef DM_CONN_MAX
#define DM_CONN_MAX 3 #define DM_CONN_MAX CORDIO_CFG_MAX_CONNECTIONS
#endif #endif
/*! \brief Maximum number of periodic advertising synchronizations */ /*! \brief Maximum number of periodic advertising synchronizations */
#ifndef DM_SYNC_MAX #ifndef DM_SYNC_MAX
#define DM_SYNC_MAX 1 #define DM_SYNC_MAX CORDIO_CFG_MAX_SYNCS
#endif #endif
/*! \brief Number of supported advertising sets: must be set to 1 for legacy advertising */ /*! \brief Number of supported advertising sets: must be set to 1 for legacy advertising */
#ifndef DM_NUM_ADV_SETS #ifndef DM_NUM_ADV_SETS
#define DM_NUM_ADV_SETS 3 #define DM_NUM_ADV_SETS CORDIO_CFG_MAX_ADVERTISING_SETS
#endif #endif
/*! \brief Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for /*! \brief Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for
legacy scanner and initiator */ legacy scanner and initiator */
#ifndef DM_NUM_PHYS #ifndef DM_NUM_PHYS
#define DM_NUM_PHYS 3 #define DM_NUM_PHYS CORDIO_CFG_MAX_PHYS
#endif #endif
/**@}*/ /**@}*/
@ -106,12 +106,12 @@ extern "C" {
/**@{*/ /**@{*/
/*! \brief Maximum number of connection oriented channels */ /*! \brief Maximum number of connection oriented channels */
#ifndef L2C_COC_CHAN_MAX #ifndef L2C_COC_CHAN_MAX
#define L2C_COC_CHAN_MAX 8 #define L2C_COC_CHAN_MAX CORDIO_CFG_MAX_L2CAP_CHANNELS
#endif #endif
/*! \brief Maximum number of connection oriented channel registered clients */ /*! \brief Maximum number of connection oriented channel registered clients */
#ifndef L2C_COC_REG_MAX #ifndef L2C_COC_REG_MAX
#define L2C_COC_REG_MAX 4 #define L2C_COC_REG_MAX CORDIO_CFG_MAX_L2CAP_CLIENTS
#endif #endif
/**@}*/ /**@}*/
@ -125,12 +125,12 @@ extern "C" {
/**@{*/ /**@{*/
/*! \brief Maximum number of simultaneous ATT write commands */ /*! \brief Maximum number of simultaneous ATT write commands */
#ifndef ATT_NUM_SIMUL_WRITE_CMD #ifndef ATT_NUM_SIMUL_WRITE_CMD
#define ATT_NUM_SIMUL_WRITE_CMD 1 #define ATT_NUM_SIMUL_WRITE_CMD CORDIO_CFG_MAX_ATT_WRITES
#endif #endif
/*! \brief Maximum number of simultaneous ATT notifications */ /*! \brief Maximum number of simultaneous ATT notifications */
#ifndef ATT_NUM_SIMUL_NTF #ifndef ATT_NUM_SIMUL_NTF
#define ATT_NUM_SIMUL_NTF 1 #define ATT_NUM_SIMUL_NTF CORDIO_CFG_MAX_ATT_NOTIFICATIONS
#endif #endif
/**@}*/ /**@}*/
@ -144,7 +144,7 @@ extern "C" {
/**@{*/ /**@{*/
/*! Max number of devices in the database */ /*! Max number of devices in the database */
#ifndef SMP_DB_MAX_DEVICES #ifndef SMP_DB_MAX_DEVICES
#define SMP_DB_MAX_DEVICES 3 #define SMP_DB_MAX_DEVICES CORDIO_CFG_MAX_SMP_DEVICES
#endif #endif
/**@}*/ /**@}*/