pkg/nimble/netif: set max conn explicitly
This commit is contained in:
parent
a7cb0a4b77
commit
a595f89bbe
@ -76,6 +76,15 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The maximum number of BLE connections that can be open concurrently
|
||||||
|
*
|
||||||
|
* @note This value *must* be <= MYNEWT_VAL_BLE_MAX_CONNECTIONS
|
||||||
|
*/
|
||||||
|
#ifndef NIMBLE_NETIF_MAX_CONN
|
||||||
|
#define NIMBLE_NETIF_MAX_CONN (MYNEWT_VAL_BLE_MAX_CONNECTIONS)
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Default L2CAP channel ID to use
|
* @brief Default L2CAP channel ID to use
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -56,7 +56,7 @@
|
|||||||
#define MBUF_OVHD (sizeof(struct os_mbuf) + \
|
#define MBUF_OVHD (sizeof(struct os_mbuf) + \
|
||||||
sizeof(struct os_mbuf_pkthdr))
|
sizeof(struct os_mbuf_pkthdr))
|
||||||
#define MBUF_SIZE (MBUF_OVHD + MYNEWT_VAL_BLE_L2CAP_COC_MPS)
|
#define MBUF_SIZE (MBUF_OVHD + MYNEWT_VAL_BLE_L2CAP_COC_MPS)
|
||||||
#define MBUF_CNT (MYNEWT_VAL_BLE_MAX_CONNECTIONS * 2 * \
|
#define MBUF_CNT (NIMBLE_NETIF_MAX_CONN * 2 * \
|
||||||
((MTU_SIZE + (MBUF_SIZE - 1)) / MBUF_SIZE))
|
((MTU_SIZE + (MBUF_SIZE - 1)) / MBUF_SIZE))
|
||||||
|
|
||||||
/* thread flag used for signaling transmit readiness */
|
/* thread flag used for signaling transmit readiness */
|
||||||
|
|||||||
@ -23,7 +23,7 @@
|
|||||||
#define ENABLE_DEBUG (0)
|
#define ENABLE_DEBUG (0)
|
||||||
#include "debug.h"
|
#include "debug.h"
|
||||||
|
|
||||||
#define CONN_CNT (MYNEWT_VAL_BLE_MAX_CONNECTIONS)
|
#define CONN_CNT (NIMBLE_NETIF_MAX_CONN)
|
||||||
|
|
||||||
static mutex_t _lock = MUTEX_INIT;
|
static mutex_t _lock = MUTEX_INIT;
|
||||||
static nimble_netif_conn_t _conn[CONN_CNT];
|
static nimble_netif_conn_t _conn[CONN_CNT];
|
||||||
|
|||||||
@ -130,7 +130,7 @@ static void _cmd_info(void)
|
|||||||
#endif
|
#endif
|
||||||
puts("");
|
puts("");
|
||||||
|
|
||||||
printf(" Free slots: %u/%u\n", free, MYNEWT_VAL_BLE_MAX_CONNECTIONS);
|
printf(" Free slots: %u/%u\n", free, NIMBLE_NETIF_MAX_CONN);
|
||||||
printf("Advertising: ");
|
printf("Advertising: ");
|
||||||
if (nimble_netif_conn_get_adv() != NIMBLE_NETIF_CONN_INVALID) {
|
if (nimble_netif_conn_get_adv() != NIMBLE_NETIF_CONN_INVALID) {
|
||||||
puts("yes");
|
puts("yes");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user