pkg/nimble/netif: set max conn explicitly

This commit is contained in:
Hauke Petersen 2019-09-30 20:46:58 +02:00
parent a7cb0a4b77
commit a595f89bbe
4 changed files with 12 additions and 3 deletions

View File

@ -76,6 +76,15 @@
extern "C" {
#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
*/

View File

@ -56,7 +56,7 @@
#define MBUF_OVHD (sizeof(struct os_mbuf) + \
sizeof(struct os_mbuf_pkthdr))
#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))
/* thread flag used for signaling transmit readiness */

View File

@ -23,7 +23,7 @@
#define ENABLE_DEBUG (0)
#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 nimble_netif_conn_t _conn[CONN_CNT];

View File

@ -130,7 +130,7 @@ static void _cmd_info(void)
#endif
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: ");
if (nimble_netif_conn_get_adv() != NIMBLE_NETIF_CONN_INVALID) {
puts("yes");