mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-25 06:23:53 +01:00
Merge pull request #11273 from haukepetersen/opt_nimble_ver370305a
ble/nimble: bump version to 9d4bda2
This commit is contained in:
commit
5c35ea814f
@ -1,6 +1,6 @@
|
||||
PKG_NAME = nimble
|
||||
PKG_URL = https://github.com/apache/mynewt-nimble.git
|
||||
PKG_VERSION = a7b3c939146e735b59d55bff740c906bde6f86f9
|
||||
PKG_VERSION = 9d4bda2edcf0e7c2a03aa908321293a53361d258
|
||||
PKG_LICENSE = Apache-2.0
|
||||
|
||||
TDIR = $(RIOTPKG)/$(PKG_NAME)
|
||||
|
||||
@ -29,6 +29,8 @@
|
||||
|
||||
#include "assert.h"
|
||||
#include "shell.h"
|
||||
#include "thread.h"
|
||||
#include "thread_flags.h"
|
||||
#include "net/bluetil/ad.h"
|
||||
|
||||
#include "nimble_l2cap_test_conf.h"
|
||||
@ -36,8 +38,9 @@
|
||||
#define ENABLE_DEBUG (1)
|
||||
#include "debug.h"
|
||||
|
||||
#define FLAG_UP (1u << 0)
|
||||
#define FLAG_SYNC (1u << 1)
|
||||
#define FLAG_UP (1u << 0)
|
||||
#define FLAG_SYNC (1u << 1)
|
||||
#define FLAG_TX_UNSTALLED (1u << 2)
|
||||
|
||||
/* synchronization state */
|
||||
static thread_t *_main;
|
||||
@ -96,6 +99,9 @@ static int _on_l2cap_evt(struct ble_l2cap_event *event, void *arg)
|
||||
case BLE_L2CAP_EVENT_COC_DATA_RECEIVED:
|
||||
_on_data(event);
|
||||
break;
|
||||
case BLE_L2CAP_EVENT_COC_TX_UNSTALLED:
|
||||
thread_flags_set(_main, FLAG_TX_UNSTALLED);
|
||||
break;
|
||||
case BLE_L2CAP_EVENT_COC_ACCEPT:
|
||||
/* this event should never be triggered for the L2CAP client */
|
||||
/* fallthrough */
|
||||
@ -191,9 +197,12 @@ static void _send(uint32_t type, uint32_t seq, size_t len)
|
||||
|
||||
do {
|
||||
res = ble_l2cap_send(_coc, txd);
|
||||
if (res == BLE_HS_EBUSY) {
|
||||
thread_flags_wait_all(FLAG_TX_UNSTALLED);
|
||||
}
|
||||
} while (res == BLE_HS_EBUSY);
|
||||
|
||||
if (res != 0) {
|
||||
if ((res != 0) && (res != BLE_HS_ESTALLED)) {
|
||||
printf("# err: failed to send (%i)\n", res);
|
||||
assert(0);
|
||||
}
|
||||
|
||||
@ -63,7 +63,7 @@ static void _on_data(struct ble_l2cap_event *event)
|
||||
printf("# Received: len %5i, seq %5u\n", rx_len, (unsigned)_rxbuf[POS_SEQ]);
|
||||
|
||||
res = ble_l2cap_send(_coc, rxd);
|
||||
assert(res == 0);
|
||||
assert((res == 0) || (res == BLE_HS_ESTALLED));
|
||||
|
||||
/* allocate new mbuf for receiving new data */
|
||||
rxd = os_mbuf_get_pkthdr(&_coc_mbuf_pool, 0);
|
||||
@ -118,6 +118,9 @@ static int _on_l2cap_evt(struct ble_l2cap_event *event, void *arg)
|
||||
case BLE_L2CAP_EVENT_COC_DATA_RECEIVED:
|
||||
_on_data(event);
|
||||
break;
|
||||
case BLE_L2CAP_EVENT_COC_TX_UNSTALLED:
|
||||
/* this event is expected, but we have nothing to do here */
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
break;
|
||||
|
||||
@ -15,7 +15,7 @@ CFLAGS += -DAPP_CID=$(APP_CID)
|
||||
# configure NimBLE
|
||||
USEPKG += nimble
|
||||
CFLAGS += -DMYNEWT_VAL_BLE_L2CAP_COC_MAX_NUM=1
|
||||
CFLAGS += -DMYNEWT_VAL_BLE_L2CAP_COC_MTU=250
|
||||
CFLAGS += -DMYNEWT_VAL_BLE_L2CAP_COC_MPS=250
|
||||
CFLAGS += -DMYNEWT_VAL_BLE_MAX_CONNECTIONS=1
|
||||
CFLAGS += -DMYNEWT_VAL_MSYS_1_BLOCK_COUNT=55
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user