Skip to content

Commit d3d6158

Browse files
committed
WIP
1 parent 27d3253 commit d3d6158

File tree

11 files changed

+80
-9
lines changed

11 files changed

+80
-9
lines changed

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

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -651,6 +651,61 @@
651651
#endif
652652
#endif
653653

654+
#ifndef MYNEWT_VAL_BLE_POWER_CONTROL
655+
#ifdef CONFIG_BT_NIMBLE_BLE_POWER_CONTROL
656+
#define MYNEWT_VAL_BLE_POWER_CONTROL CONFIG_BT_NIMBLE_BLE_POWER_CONTROL
657+
#else
658+
#define MYNEWT_VAL_BLE_POWER_CONTROL (0)
659+
#endif
660+
#endif
661+
662+
#ifndef CONFIG_BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST
663+
#define MYNEWT_VAL_BLE_MAX_PERIODIC_ADVERTISER_LIST (0)
664+
#else
665+
#define MYNEWT_VAL_BLE_MAX_PERIODIC_ADVERTISER_LIST (CONFIG_BT_NIMBLE_MAX_PERIODIC_ADVERTISER_LIST)
666+
#endif
667+
668+
#ifndef CONFIG_BT_NIMBLE_GATT_CACHING
669+
#define MYNEWT_VAL_BLE_GATT_CACHING (0)
670+
#else
671+
#define MYNEWT_VAL_BLE_GATT_CACHING (CONFIG_BT_NIMBLE_GATT_CACHING)
672+
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CONNS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CONNS)
673+
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_SVCS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_SVCS)
674+
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_CHRS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_CHRS)
675+
#define MYNEWT_VAL_BLE_GATT_CACHING_MAX_DSCS (CONFIG_BT_NIMBLE_GATT_CACHING_MAX_DSCS)
676+
#endif
677+
678+
#ifndef CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
679+
#define CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN 0
680+
#endif
681+
682+
#if CONFIG_ESP_COEX_SW_COEXIST_ENABLE
683+
#define CONFIG_BT_NIMBLE_COEX_PHY_CODED_TX_RX_TLIM_EFF CONFIG_BT_LE_COEX_PHY_CODED_TX_RX_TLIM_EN
684+
#else
685+
#define CONFIG_BT_NIMBLE_COEX_PHY_CODED_TX_RX_TLIM_EFFF 0
686+
#endif
687+
688+
#ifndef MYNEWT_VAL_BLE_TRANSPORT_EVT_COUNT
689+
#define MYNEWT_VAL_BLE_TRANSPORT_EVT_COUNT (4)
690+
#endif
691+
692+
#ifndef MYNEWT_VAL_BLE_TRANSPORT_EVT_DISCARDABLE_COUNT
693+
#define MYNEWT_VAL_BLE_TRANSPORT_EVT_DISCARDABLE_COUNT (16)
694+
#endif
695+
696+
/* Value copied from BLE_TRANSPORT_ACL_COUNT */
697+
#ifndef MYNEWT_VAL_BLE_TRANSPORT_ACL_FROM_LL_COUNT
698+
#define MYNEWT_VAL_BLE_TRANSPORT_ACL_FROM_LL_COUNT (10)
699+
#endif
700+
701+
#ifndef MYNEWT_VAL_BLE_TRANSPORT_ACL_SIZE
702+
#define MYNEWT_VAL_BLE_TRANSPORT_ACL_SIZE (251)
703+
#endif
704+
705+
#ifndef MYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE
706+
#define MYNEWT_VAL_BLE_TRANSPORT_EVT_SIZE (70)
707+
#endif
708+
654709
#ifndef MYNEWT_VAL_BLE_SM_THEIR_KEY_DIST
655710
#define MYNEWT_VAL_BLE_SM_THEIR_KEY_DIST (0)
656711
#endif

src/nimble/nimble/host/src/ble_hs_hci.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ ble_hs_hci_rx_ack(uint8_t *ack_ev)
375375
ble_hs_hci_ack = (struct ble_hci_ev *) ack_ev;
376376
ble_npl_sem_release(&ble_hs_hci_sem);
377377
}
378-
378+
#if 0
379379
int
380380
ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
381381
{
@@ -406,7 +406,7 @@ ble_hs_hci_rx_evt(uint8_t *hci_ev, void *arg)
406406

407407
return 0;
408408
}
409-
409+
#endif
410410
#if !(SOC_ESP_NIMBLE_CONTROLLER)
411411
/**
412412
* Calculates the largest ACL payload that the controller can accept.

src/nimble/nimble/host/src/ble_hs_mbuf.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ ble_hs_mbuf_bare_pkt(void)
5757
return ble_hs_mbuf_gen_pkt(0);
5858
}
5959

60+
#if 0
6061
/**
6162
* Allocates an mbuf suitable for an HCI ACL data packet.
6263
*
@@ -72,6 +73,7 @@ ble_hs_mbuf_acl_pkt(void)
7273
return ble_hs_mbuf_gen_pkt(BLE_HCI_DATA_HDR_SZ + BLE_HS_CTRL_DATA_HDR_SZ + 1);
7374
#endif
7475
}
76+
#endif
7577

7678
/**
7779
* Allocates an mbuf suitable for an L2CAP data packet. The resulting packet

src/nimble/nimble/host/src/ble_sm_alg.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,7 @@ ble_sm_alg_g2(const uint8_t *u, const uint8_t *v, const uint8_t *x,
515515
return 0;
516516
}
517517

518+
#if 0
518519
int
519520
ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_y,
520521
const uint8_t *our_priv_key, uint8_t *out_dhkey)
@@ -611,6 +612,7 @@ ble_sm_alg_gen_dhkey(const uint8_t *peer_pub_key_x, const uint8_t *peer_pub_key_
611612
swap_buf(out_dhkey, dh, 32);
612613
return 0;
613614
}
615+
#endif
614616

615617
/* based on Core Specification 4.2 Vol 3. Part H 2.3.5.6.1 */
616618
static const uint8_t ble_sm_alg_dbg_priv_key[32] = {
@@ -690,6 +692,7 @@ void mbedtls_free_keypair(void)
690692
}
691693
#endif
692694

695+
#if 0
693696
/**
694697
* pub: 64 bytes
695698
* priv: 32 bytes
@@ -726,6 +729,7 @@ ble_sm_alg_gen_key_pair(uint8_t *pub, uint8_t *priv)
726729

727730
return 0;
728731
}
732+
#endif
729733

730734
#if MYNEWT_VAL(SELFTEST)
731735
/* Unit tests rely on custom RNG function not being set */

src/nimble/porting/nimble/src/nimble_port.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343

4444
#if SOC_ESP_NIMBLE_CONTROLLER
4545
#if CONFIG_SW_COEXIST_ENABLE
46-
#include "esp_coexist_internal.h"
46+
//#include "esp_coexist_internal.h"
4747
#endif
4848
#endif
4949

@@ -117,6 +117,8 @@ esp_err_t esp_nimble_init(void)
117117

118118
os_msys_init();
119119

120+
#else
121+
ble_npl_eventq_init(&g_eventq_dflt);
120122
#endif
121123

122124
/* Initialize the host */

src/nimble/porting/nimble/src/os_mbuf.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
* @defgroup OSMqueue Queue of Mbufs
5656
* @{
5757
*/
58-
58+
#if 0
5959
STAILQ_HEAD(, os_mbuf_pool) g_msys_pool_list =
6060
STAILQ_HEAD_INITIALIZER(g_msys_pool_list);
6161

@@ -1258,3 +1258,4 @@ os_mbuf_pack_chains(struct os_mbuf *m1, struct os_mbuf *m2)
12581258

12591259
return m1;
12601260
}
1261+
#endif

src/nimble/porting/nimble/src/os_mempool.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* specific language governing permissions and limitations
1717
* under the License.
1818
*/
19-
19+
#if 0
2020
#include "../include/os/os.h"
2121
#include "../include/os/os_trace_api.h"
2222

@@ -484,3 +484,4 @@ os_mempool_module_init(void)
484484
{
485485
STAILQ_INIT(&g_os_mempool_list);
486486
}
487+
#endif

src/nimble/porting/nimble/src/os_msys_init.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ os_msys_buf_free(void)
181181

182182
}
183183
#endif
184-
184+
#if 0
185185
void os_msys_init(void)
186186
{
187187
#if OS_MSYS_SANITY_ENABLED
@@ -216,3 +216,4 @@ void os_msys_init(void)
216216
SYSINIT_PANIC_ASSERT(rc == 0);
217217
#endif
218218
}
219+
#endif

src/nimble/porting/npl/freertos/src/npl_os_freertos.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1409,6 +1409,7 @@ npl_freertos_hw_set_isr(int irqn, void (*addr)(void))
14091409
}
14101410
#endif
14111411

1412+
#if 0
14121413
struct ble_npl_event *
14131414
npl_freertos_eventq_get(struct ble_npl_eventq *evq, ble_npl_time_t tmo)
14141415
{
@@ -1868,6 +1869,7 @@ npl_freertos_callout_get_ticks(struct ble_npl_callout *co)
18681869
return xTimerGetExpiryTime(co->handle);
18691870
#endif
18701871
}
1872+
#endif
18711873

18721874
ble_npl_time_t
18731875
npl_freertos_callout_remaining_ticks(struct ble_npl_callout *co,
@@ -1907,7 +1909,7 @@ npl_freertos_callout_remaining_ticks(struct ble_npl_callout *co,
19071909

19081910
return rt;
19091911
}
1910-
1912+
#if 0
19111913
ble_npl_error_t
19121914
npl_freertos_time_ms_to_ticks(uint32_t ms, ble_npl_time_t *out_ticks)
19131915
{
@@ -1937,5 +1939,5 @@ npl_freertos_time_ticks_to_ms(ble_npl_time_t ticks, uint32_t *out_ms)
19371939

19381940
return 0;
19391941
}
1940-
1942+
#endif
19411943
#endif // CONFIG_NIMBLE_STACK_USE_MEM_POOLS

src/nimconfig.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@
284284
#define CONFIG_BTDM_SCAN_DUPL_TYPE_DATA_DEVICE 2
285285
#endif
286286

287-
#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3)
287+
#if !defined(CONFIG_IDF_TARGET_ESP32) && !defined(CONFIG_IDF_TARGET_ESP32C3) && !defined(CONFIG_IDF_TARGET_ESP32S3) && \
288+
!defined(CONFIG_IDF_TARGET_ESP32H2) && !defined(CONFIG_IDF_TARGET_ESP32C2) && !defined(CONFIG_IDF_TARGET_ESP32C6)
288289
#define CONFIG_IDF_TARGET_ESP32 1
289290
#endif
290291

src/syscfg/syscfg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#pragma once
2+
#include "nimble/porting/nimble/include/syscfg/syscfg.h"

0 commit comments

Comments
 (0)