Skip to content

Commit 8654644

Browse files
put cordio cfg in mbed_lib.json
1 parent f61dee1 commit 8654644

File tree

3 files changed

+74
-10
lines changed

3 files changed

+74
-10
lines changed
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
{
2+
"name": "cordio",
3+
"config": {
4+
"cordio-cfg-max-connections": {
5+
"help": "Maximum number of connections",
6+
"value": 3,
7+
"macro_name": "CORDIO_CFG_MAX_CONNECTIONS"
8+
},
9+
"cordio-cfg-max-syncs": {
10+
"help": "Maximum number of periodic advertising synchronizations",
11+
"value": 1,
12+
"macro_name": "CORDIO_CFG_MAX_SYNCS"
13+
},
14+
"cordio-cfg-max-advertising-sets": {
15+
"help": "Number of supported advertising sets: must be set to 1 for legacy advertising",
16+
"value": 3,
17+
"macro_name": "CORDIO_CFG_MAX_ADVERTISING_SETS"
18+
},
19+
"cordio-cfg-max-phys": {
20+
"help": "Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for legacy scanner and initiator",
21+
"value": 3,
22+
"macro_name": "CORDIO_CFG_MAX_PHYS"
23+
},
24+
"cordio-cfg-max-l2cap-channels": {
25+
"help": "Maximum number of connection oriented channels",
26+
"value": 8,
27+
"macro_name": "CORDIO_CFG_MAX_L2CAP_CHANNELS"
28+
},
29+
"cordio-cfg-max-l2cap-clients": {
30+
"help": "Maximum number of connection oriented channel registered clients",
31+
"value": 4,
32+
"macro_name": "CORDIO_CFG_MAX_L2CAP_CLIENTS"
33+
},
34+
"cordio-cfg-max-att-writes": {
35+
"help": "Maximum number of simultaneous ATT write commands",
36+
"value": 1,
37+
"macro_name": "CORDIO_CFG_MAX_ATT_WRITES"
38+
},
39+
"cordio-cfg-max-att-notifications": {
40+
"help": "Maximum number of simultaneous ATT notifications",
41+
"value": 1,
42+
"macro_name": "CORDIO_CFG_MAX_ATT_NOTIFICATIONS"
43+
},
44+
"cordio-cfg-max-smp-devices": {
45+
"help": "Max number of devices in the security database",
46+
"value": 3,
47+
"macro_name": "CORDIO_CFG_MAX_SMP_DEVICES"
48+
},
49+
"cordio-cfg-desired-att-mtu": {
50+
"help": "Desired ATT_MTU, this needs to be between 23 and 517 (inclusive).",
51+
"value": 23,
52+
"macro_name": "CORDIO_CFG_DESIRED_ATT_MTU"
53+
},
54+
"cordio-cfg-max-prepared-writes": {
55+
"help": "Number of queued prepare writes supported by server.",
56+
"value": 23,
57+
"macro_name": "CORDIO_CFG_MAX_PREPARED_WRITES"
58+
}
59+
}
60+
}

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/cfg/cfg_stack.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,15 @@ l2cCfg_t *pL2cCfg = &l2cCfg;
6262
ATT
6363
**************************************************************************************************/
6464

65+
#if CORDIO_CFG_DESIRED_ATT_MTU < ATT_DEFAULT_MTU || CORDIO_CFG_DESIRED_ATT_MTU > ATT_MAX_MTU
66+
#error "CORDIO_CFG_DESIRED_ATT_MTU value is outside valid range"
67+
#endif
68+
6569
/* Configuration structure */
6670
attCfg_t attCfg =
6771
{
6872
15, /* ATT server service discovery connection idle timeout in seconds */
69-
ATT_DEFAULT_MTU, /* desired ATT MTU */
73+
CORDIO_CFG_DESIRED_ATT_MTU, /* desired ATT MTU */
7074
ATT_MAX_TRANS_TIMEOUT, /* transcation timeout in seconds */
7175
4 /* number of queued prepare writes supported by server */
7276
};

features/FEATURE_BLE/targets/TARGET_CORDIO/stack/cordio_stack/ble-host/sources/stack/cfg/cfg_stack.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -76,23 +76,23 @@ extern "C" {
7676
/**@{*/
7777
/*! \brief Maximum number of connections */
7878
#ifndef DM_CONN_MAX
79-
#define DM_CONN_MAX 3
79+
#define DM_CONN_MAX CORDIO_CFG_MAX_CONNECTIONS
8080
#endif
8181

8282
/*! \brief Maximum number of periodic advertising synchronizations */
8383
#ifndef DM_SYNC_MAX
84-
#define DM_SYNC_MAX 1
84+
#define DM_SYNC_MAX CORDIO_CFG_MAX_SYNCS
8585
#endif
8686

8787
/*! \brief Number of supported advertising sets: must be set to 1 for legacy advertising */
8888
#ifndef DM_NUM_ADV_SETS
89-
#define DM_NUM_ADV_SETS 3
89+
#define DM_NUM_ADV_SETS CORDIO_CFG_MAX_ADVERTISING_SETS
9090
#endif
9191

9292
/*! \brief Number of scanner and initiator PHYs (LE 1M, LE 2M and LE Coded): must be set to 1 for
9393
legacy scanner and initiator */
9494
#ifndef DM_NUM_PHYS
95-
#define DM_NUM_PHYS 3
95+
#define DM_NUM_PHYS CORDIO_CFG_MAX_PHYS
9696
#endif
9797
/**@}*/
9898

@@ -106,12 +106,12 @@ extern "C" {
106106
/**@{*/
107107
/*! \brief Maximum number of connection oriented channels */
108108
#ifndef L2C_COC_CHAN_MAX
109-
#define L2C_COC_CHAN_MAX 8
109+
#define L2C_COC_CHAN_MAX CORDIO_CFG_MAX_L2CAP_CHANNELS
110110
#endif
111111

112112
/*! \brief Maximum number of connection oriented channel registered clients */
113113
#ifndef L2C_COC_REG_MAX
114-
#define L2C_COC_REG_MAX 4
114+
#define L2C_COC_REG_MAX CORDIO_CFG_MAX_L2CAP_CLIENTS
115115
#endif
116116
/**@}*/
117117

@@ -125,12 +125,12 @@ extern "C" {
125125
/**@{*/
126126
/*! \brief Maximum number of simultaneous ATT write commands */
127127
#ifndef ATT_NUM_SIMUL_WRITE_CMD
128-
#define ATT_NUM_SIMUL_WRITE_CMD 1
128+
#define ATT_NUM_SIMUL_WRITE_CMD CORDIO_CFG_MAX_ATT_WRITES
129129
#endif
130130

131131
/*! \brief Maximum number of simultaneous ATT notifications */
132132
#ifndef ATT_NUM_SIMUL_NTF
133-
#define ATT_NUM_SIMUL_NTF 1
133+
#define ATT_NUM_SIMUL_NTF CORDIO_CFG_MAX_ATT_NOTIFICATIONS
134134
#endif
135135
/**@}*/
136136

@@ -144,7 +144,7 @@ extern "C" {
144144
/**@{*/
145145
/*! Max number of devices in the database */
146146
#ifndef SMP_DB_MAX_DEVICES
147-
#define SMP_DB_MAX_DEVICES 3
147+
#define SMP_DB_MAX_DEVICES CORDIO_CFG_MAX_SMP_DEVICES
148148
#endif
149149
/**@}*/
150150

0 commit comments

Comments
 (0)