Skip to content

Commit 52b2afd

Browse files
committed
Update NimBLE core version to esp-nimble 1.4.0 @ea0710b
1 parent 8ff8f0f commit 52b2afd

File tree

163 files changed

+18482
-8347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

163 files changed

+18482
-8347
lines changed

src/nimble/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Features highlight:
3333
- Support for up to 32 simultaneous connections.
3434
- Legacy and SC (secure connections) SMP support (pairing and bonding).
3535
- Advertising Extensions.
36+
- Periodic Advertising.
3637
- Coded (aka Long Range) and 2M PHYs.
3738
- Bluetooth Mesh.
3839

src/nimble/RELEASE_NOTES.md

Lines changed: 7 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# RELEASE NOTES
22

3-
18 March 2020 - Apache NimBLE v1.3.0
3+
24 March 2021 - Apache NimBLE v1.4.0
44

55
For full release notes, please visit the
66
[Apache Mynewt Wiki](https://cwiki.apache.org/confluence/display/MYNEWT/Release+Notes).
@@ -10,23 +10,12 @@ replaces the proprietary SoftDevice on Nordic chipsets.
1010

1111
New features in this version of NimBLE include:
1212

13-
* Support for Bluetooth Core Specification 5.1
14-
* New blestress test application
15-
* Dialog DA1469x CMAC driver
16-
* Support for LE Secure Connections out-of-band (OOB) association model
17-
* Support for automated generation of syscfg for ports
18-
* Qualification related bugfixes
19-
* BLE Mesh improvements - fixes and resync with latest Zephyr code
20-
* RIOT OS port fixes and improvements
21-
* btshell sample application improvements
22-
* improvements for bttester application
23-
* Controller duplicates filtering improvements
24-
* Multi PHY support improvements
25-
* Memory and CPU usage optimizations
26-
* Use of packed structs for HCI (code size reduction)
27-
* Linux sample improvements
28-
* PTS test instructions updates
29-
* Clock managements improvements in controller
13+
* Support for PHY on Dialog Configurable MAC (CMAC)
14+
* Support for PHY on Nordic nRF5340
15+
* Support for Apache NuttX port of NimBLE
16+
* Controller-to-host flow control support
17+
* Support for USB transport
18+
* Various bugfixes
3019

3120
If working on next-generation RTOS and Bluetooth protocol stack
3221
sounds exciting to you, get in touch, by sending a mail to the Apache Mynewt

src/nimble/console/console.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
extern "C" {
88
#endif
99

10-
#define console_printf printf
10+
#define console_printf(_fmt, ...) printf(_fmt, ##__VA_ARGS__)
1111

1212
#ifdef __cplusplus
1313
}

src/nimble/esp_port/port/include/esp_nimble_cfg.h

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -922,6 +922,10 @@
922922
#define MYNEWT_VAL_BLE_MESH_LPN_GROUPS (10)
923923
#endif
924924

925+
#ifndef MYNEWT_VAL_BLE_MESH_LPN_SUB_ALL_NODES_ADDR
926+
#define MYNEWT_VAL_BLE_MESH_LPN_SUB_ALL_NODES_ADDR (1)
927+
#endif
928+
925929
#ifndef MYNEWT_VAL_BLE_MESH_LPN_INIT_POLL_TIMEOUT
926930
#define MYNEWT_VAL_BLE_MESH_LPN_INIT_POLL_TIMEOUT (MYNEWT_VAL_BLE_MESH_LPN_POLL_TIMEOUT)
927931
#endif
@@ -1043,6 +1047,10 @@
10431047
#endif
10441048
#endif
10451049

1050+
#ifndef MYNEWT_VAL_BLE_MESH_CDB
1051+
#define MYNEWT_VAL_BLE_MESH_CDB (0)
1052+
#endif
1053+
10461054
#ifndef MYNEWT_VAL_BLE_MESH_PROV_LOG_LVL
10471055
#define MYNEWT_VAL_BLE_MESH_PROV_LOG_LVL (1)
10481056
#endif
@@ -1088,6 +1096,14 @@
10881096
#define MYNEWT_VAL_BLE_MESH_RX_SDU_MAX (72)
10891097
#endif
10901098

1099+
#ifndef MYNEWT_VAL_BLE_MESH_SEG_BUFS
1100+
#define MYNEWT_VAL_BLE_MESH_SEG_BUFS (72)
1101+
#endif
1102+
1103+
#ifndef MYNEWT_VAL_BLE_MESH_RX_SEG_MAX
1104+
#define MYNEWT_VAL_BLE_MESH_RX_SEG_MAX (3)
1105+
#endif
1106+
10911107
#ifndef MYNEWT_VAL_BLE_MESH_RX_SEG_MSG_COUNT
10921108
#define MYNEWT_VAL_BLE_MESH_RX_SEG_MSG_COUNT (2)
10931109
#endif
@@ -1100,6 +1116,63 @@
11001116
#define MYNEWT_VAL_BLE_MESH_SEQ_STORE_RATE (128)
11011117
#endif
11021118

1119+
1120+
#ifndef MYNEWT_VAL_BLE_MESH_TX_SEG_RETRANS_COUNT
1121+
#define MYNEWT_VAL_BLE_MESH_TX_SEG_RETRANS_COUNT (4)
1122+
#endif
1123+
1124+
#ifndef MYNEWT_VAL_BLE_MESH_TX_SEG_RETRANS_TIMEOUT_UNICAST
1125+
#define MYNEWT_VAL_BLE_MESH_TX_SEG_RETRANS_TIMEOUT_UNICAST (400)
1126+
#endif
1127+
1128+
#ifndef MYNEWT_VAL_BLE_MESH_TX_SEG_RETRANS_TIMEOUT_GROUP
1129+
#define MYNEWT_VAL_BLE_MESH_TX_SEG_RETRANS_TIMEOUT_GROUP (50)
1130+
#endif
1131+
1132+
#ifndef MYNEWT_VAL_BLE_MESH_LOOPBACK_BUFS
1133+
#define MYNEWT_VAL_BLE_MESH_LOOPBACK_BUFS (3)
1134+
#endif
1135+
1136+
#ifndef MYNEWT_VAL_BLE_MESH_DEFAULT_TTL
1137+
#define MYNEWT_VAL_BLE_MESH_DEFAULT_TTL (7)
1138+
#endif
1139+
1140+
#ifndef MYNEWT_VAL_BLE_MESH_NETWORK_TRANSMIT_COUNT
1141+
#define MYNEWT_VAL_BLE_MESH_NETWORK_TRANSMIT_COUNT (2)
1142+
#endif
1143+
1144+
#ifndef MYNEWT_VAL_BLE_MESH_NETWORK_TRANSMIT_INTERVAL
1145+
#define MYNEWT_VAL_BLE_MESH_NETWORK_TRANSMIT_INTERVAL (20)
1146+
#endif
1147+
1148+
#ifndef MYNEWT_VAL_BLE_MESH_RELAY_RETRANSMIT_COUNT
1149+
#define MYNEWT_VAL_BLE_MESH_RELAY_RETRANSMIT_COUNT (2)
1150+
#endif
1151+
1152+
#ifndef MYNEWT_VAL_BLE_MESH_PB_ADV_RETRANS_TIMEOUT
1153+
#define MYNEWT_VAL_BLE_MESH_PB_ADV_RETRANS_TIMEOUT (500)
1154+
#endif
1155+
1156+
#ifndef MYNEWT_VAL_BLE_MESH_RELAY_ENABLED
1157+
#define MYNEWT_VAL_BLE_MESH_RELAY_ENABLED (1)
1158+
#endif
1159+
1160+
#ifndef MYNEWT_VAL_BLE_MESH_GATT_PROXY_ENABLED
1161+
#define MYNEWT_VAL_BLE_MESH_GATT_PROXY_ENABLED (1)
1162+
#endif
1163+
1164+
#ifndef MYNEWT_VAL_BLE_MESH_FRIEND_ENABLED
1165+
#define MYNEWT_VAL_BLE_MESH_FRIEND_ENABLED (1)
1166+
#endif
1167+
1168+
#ifndef MYNEWT_VAL_BLE_MESH_BEACON_ENABLED
1169+
#define MYNEWT_VAL_BLE_MESH_BEACON_ENABLED (1)
1170+
#endif
1171+
1172+
#ifndef MYNEWT_VAL_BLE_MESH_RELAY_RETRANSMIT_INTERVAL
1173+
#define MYNEWT_VAL_BLE_MESH_RELAY_RETRANSMIT_INTERVAL (20)
1174+
#endif
1175+
11031176
/* Overridden by apps/blemesh (defined by @apache-mynewt-nimble/nimble/host/mesh) */
11041177
#ifndef MYNEWT_VAL_BLE_MESH_SETTINGS
11051178
#define MYNEWT_VAL_BLE_MESH_SETTINGS (0)
@@ -1158,6 +1231,10 @@
11581231
#define MYNEWT_VAL_BLE_MESH_TX_SEG_MSG_COUNT (4)
11591232
#endif
11601233

1234+
#ifndef MYNEWT_VAL_BLE_MESH_UNPROV_BEACON_INT
1235+
#define MYNEWT_VAL_BLE_MESH_UNPROV_BEACON_INT (5)
1236+
#endif
1237+
11611238
/*** @apache-mynewt-nimble/nimble/host/services/ans */
11621239
#ifndef MYNEWT_VAL_BLE_SVC_ANS_NEW_ALERT_CAT
11631240
#define MYNEWT_VAL_BLE_SVC_ANS_NEW_ALERT_CAT (0)
@@ -1370,6 +1447,18 @@
13701447
#define MYNEWT_VAL_BLE_HCI_UART_STOP_BITS (1)
13711448
#endif
13721449

1450+
#ifndef CONFIG_BLE_TX_CCA_ENABLED
1451+
#define MYNEWT_VAL_BLE_TX_CCA_ENABLED (0)
1452+
#else
1453+
#define MYNEWT_VAL_BLE_TX_CCA_ENABLED (CONFIG_BLE_TX_CCA_ENABLED)
1454+
#endif
1455+
1456+
#ifndef CONFIG_BLE_CCA_RSSI_THRESH
1457+
#define MYNEWT_VAL_BLE_CCA_RSSI_THRESH (50)
1458+
#else
1459+
#define MYNEWT_VAL_BLE_CCA_RSSI_THRESH (CONFIG_BLE_CCA_RSSI_THRESH)
1460+
#endif
1461+
13731462
#ifndef MYNEWT_VAL_NEWT_FEATURE_LOGCFG
13741463
#define MYNEWT_VAL_NEWT_FEATURE_LOGCFG (1)
13751464
#endif

src/nimble/nimble/controller/include/controller/ble_ll.h

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,29 @@ extern "C" {
6969
/* Timing jitter as per spec is +/16 usecs */
7070
#define BLE_LL_JITTER_USECS (16)
7171

72+
73+
#if MYNEWT_VAL(BLE_LL_SCA) < 0
74+
#error Invalid SCA value
75+
#elif MYNEWT_VAL(BLE_LL_SCA) <= 20
76+
#define BLE_LL_SCA_ENUM 7
77+
#elif MYNEWT_VAL(BLE_LL_SCA) <= 30
78+
#define BLE_LL_SCA_ENUM 6
79+
#elif MYNEWT_VAL(BLE_LL_SCA) <= 50
80+
#define BLE_LL_SCA_ENUM 5
81+
#elif MYNEWT_VAL(BLE_LL_SCA) <= 75
82+
#define BLE_LL_SCA_ENUM 4
83+
#elif MYNEWT_VAL(BLE_LL_SCA) <= 100
84+
#define BLE_LL_SCA_ENUM 3
85+
#elif MYNEWT_VAL(BLE_LL_SCA) <= 150
86+
#define BLE_LL_SCA_ENUM 2
87+
#elif MYNEWT_VAL(BLE_LL_SCA) <= 250
88+
#define BLE_LL_SCA_ENUM 1
89+
#elif MYNEWT_VAL(BLE_LL_SCA) <= 500
90+
#define BLE_LL_SCA_ENUM 0
91+
#else
92+
#error Invalid SCA value
93+
#endif
94+
7295
/* Packet queue header definition */
7396
STAILQ_HEAD(ble_ll_pkt_q, os_mbuf_pkthdr);
7497

@@ -373,6 +396,12 @@ struct ble_dev_addr
373396
#define BLE_LL_LLID_DATA_START (2)
374397
#define BLE_LL_LLID_CTRL (3)
375398

399+
#define BLE_LL_LLID_IS_CTRL(hdr) \
400+
(((hdr) & BLE_LL_DATA_HDR_LLID_MASK) == BLE_LL_LLID_CTRL)
401+
#define BLE_LL_LLID_IS_DATA(hdr) \
402+
((((hdr) & BLE_LL_DATA_HDR_LLID_MASK) == BLE_LL_LLID_DATA_START) || \
403+
(((hdr) & BLE_LL_DATA_HDR_LLID_MASK) == BLE_LL_LLID_DATA_FRAG))
404+
376405
/*
377406
* CONNECT_REQ
378407
* -> InitA (6 bytes)
@@ -415,6 +444,14 @@ struct ble_dev_addr
415444
#define BLE_LL_ADDR_SUBTYPE_RPA (1)
416445
#define BLE_LL_ADDR_SUBTYPE_NRPA (2)
417446

447+
/* ACAD data types */
448+
#define BLE_LL_ACAD_CHANNEL_MAP_UPDATE_IND 0x28
449+
450+
struct ble_ll_acad_channel_map_update_ind {
451+
uint8_t map[5];
452+
uint16_t instant;
453+
} __attribute__((packed));
454+
418455
/*--- External API ---*/
419456
/* Initialize the Link Layer */
420457
void ble_ll_init(void);
@@ -545,6 +582,7 @@ void ble_ll_rand_sample(uint8_t rnum);
545582
int ble_ll_rand_data_get(uint8_t *buf, uint8_t len);
546583
void ble_ll_rand_prand_get(uint8_t *prand);
547584
int ble_ll_rand_start(void);
585+
uint32_t ble_ll_rand(void);
548586

549587
static inline int
550588
ble_ll_get_addr_type(uint8_t txrxflag)

src/nimble/nimble/controller/include/controller/ble_ll_conn.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@ extern "C" {
5858
/* Definition for RSSI when the RSSI is unknown */
5959
#define BLE_LL_CONN_UNKNOWN_RSSI (127)
6060

61+
#define BLE_LL_CONN_HANDLE_ISO_OFFSET (0x0100)
62+
6163
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_LE_ENCRYPTION)
6264
/*
6365
* Encryption states for a connection
@@ -69,6 +71,7 @@ extern "C" {
6971
enum conn_enc_state {
7072
CONN_ENC_S_UNENCRYPTED = 1,
7173
CONN_ENC_S_ENCRYPTED,
74+
CONN_ENC_S_ENC_RSP_TO_BE_SENT,
7275
CONN_ENC_S_ENC_RSP_WAIT,
7376
CONN_ENC_S_PAUSE_ENC_RSP_WAIT,
7477
CONN_ENC_S_PAUSED,
@@ -270,6 +273,10 @@ struct ble_ll_conn_sm
270273
uint8_t last_rxd_hdr_byte; /* note: possibly can make 1 bit since we
271274
only use the MD bit now */
272275

276+
#if MYNEWT_VAL(BLE_LL_CFG_FEAT_CTRL_TO_HOST_FLOW_CONTROL)
277+
uint16_t cth_flow_pending;
278+
#endif
279+
273280
/* connection event mgmt */
274281
uint8_t reject_reason;
275282
uint8_t host_reply_opcode;

0 commit comments

Comments
 (0)