Commit Graph

229 Commits

Author SHA1 Message Date
Prasad Alatkar 627546613e NimBLE: Update modlog & logcfg on ESP platform to avoid logging errors/warnings
* ESP specific patch for nimble 1.3.0 release

* NimBLE: Support configurable logging in NimBLE host.
2024-02-14 15:10:50 +05:30
Prasad Alatkar 03df51a35c nimble/porting: Explicitly NULL terminate potential non NULL terminated string buffer
os_mempool.c: Using strncpy, buffer will not be NULL terminated if size of
source string is same as buffer size. Explicitly added NULL character at the
end.
2024-02-14 15:10:34 +05:30
Andrej 551cc0127f porting: use macros for log level filtering
This reduces the size of the compiled binary by 7856 bytes.
2024-02-14 15:05:43 +05:30
Hrishikesh Dhayagude 3b44ea024d Use allocation strategy for dynamic buffers in NimBLE host stack 2024-02-14 14:51:15 +05:30
Hrishikesh Dhayagude ea41bd0bdb ESP-NimBLE: Allocate os_msys_init_1_data and os_msys_init_2_data dynamically
Allocating buffers dynamically and freeing when the job is done saves static memory
2024-02-14 14:51:03 +05:30
Hrishikesh Dhayagude 8f8927d94a nimble: Use the stop event to validate instead of an argument 2024-02-14 14:50:14 +05:30
Hrishikesh Dhayagude ca983d2798 NimBLE: Remove unused stuff from log.h 2024-02-14 14:49:43 +05:30
Prasad Alatkar fd31133ae0 NimBLE: Fix misc warnings and return code in ble_hs_tx_data
- Previously `ble_hs_tx_data` returned 0 irrespective of error code returned by
  `ble_hci_trans_hs_acl_tx`.
- Minor changes in `porting/nimble/` and `ble_gattc.c` to remove discard const
  qualifier warnings, fixes #4028.
2024-02-14 14:43:15 +05:30
Prasad Alatkar 38b5724ae4 NimBLE: Add menuconfig option to select NimBLE stack size
Add option to select NimBLE host stack size
2024-02-14 12:45:14 +05:30
Hrishikesh Dhayagude 895623861d NimBLE: Fix compilation warnings and errors
1. Remove networking macros from endian.h. They are not used in NimBLE (only used in socket transport, which our port does not use)

2. nvs_handle => nvs_handle_t

3. rom/queue.h => sys/queue.h
2024-02-14 12:33:28 +05:30
Hrishikesh Dhayagude 630443511e NimBLE: Fix warnings for os/queue.h
When the application includes headers which internally include
"rom/queue.h" mutliple redefinition warnings are seen for many #defines

Solution: Remove the common #defines in os/queue.h and instead include
rom/queue.h in it.
2024-02-14 12:33:16 +05:30
Hrishikesh Dhayagude 56f4975a22 NimBLE-component: Add support to disable/deinit NimBLE host and port 2024-02-14 12:32:12 +05:30
Hrishikesh Dhayagude bd54d216d5 Change Kconfig option names as per the Kconfig changes in NimBLE ESP-IDF 2024-02-14 12:32:04 +05:30
Sagar Bijwe 29722059a5 esp-nimble: Add support for logging
This change adds support for nimble logging using IDF APIs. By default,
nimble logging level is set to follow global logging configuration.
2024-02-14 12:30:40 +05:30
Sagar Bijwe 68e5f51df9 esp-nimble: Conditionally include nimble config for ESP platform
This change segregates nimble config for ESP platform from upstream
config. This should ease process of maintaining esp-nimble repository.
2024-02-14 12:29:24 +05:30
Sagar Bijwe 38470b3bcc esp-nimble: Make changes to NimBLE tasks 2024-02-14 12:23:38 +05:30
Sagar Bijwe 23e580f591 esp_nimble: Make changes to nimble code to make it compatible with IDF and VHCI
1) Modify a few porting functions for FreeRTOS.
2) Add freertos tasks for BLE host and mesh.
3) Keep a byte for packet type in transport buffers to make it compatible with ESP32 VHCI interface.
4) Modify host mutex lock functionality.
2024-02-14 12:16:32 +05:30
yuzhigang84@gmail.com e718a2fb22 porting/npl/linux: support C library (for example:musl) which didn't have PTHREAD_MUTEX_RECURSIVE_NP 2023-08-02 21:29:37 +02:00
Petro Karashchenko 3720e7656c porting/examples/linux: update steps in README.md
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-08-01 08:44:18 +02:00
Deomid "rojer" Ryabkov 064f050919 porting/npl/linux: PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP is a GNU extension
Need to provide `__USE_GNU` hint to pthread.h
2023-07-20 21:57:23 +02:00
Szymon Janc fd20c10596 porting/npl: Fix linux tests build
For now build with -m32 flag.
2023-07-20 21:56:27 +02:00
Szymon Janc 9bf905ffd5 porting/npl: Fix linux tests makefile clean target
clean target was failing if there was incomplete build.
2023-07-20 21:56:27 +02:00
Deomid "rojer" Ryabkov 188256f1ef porting/npl/linux: Replace pthread_yield() with sched_yield()
Per `pthread_yield(3)`:
```
  This call is nonstandard, but present on several other systems.
  Use the standardized sched_yield(2) instead.
```
2023-07-20 18:47:20 +02:00
Deomid "rojer" Ryabkov 18738b2743 if MYNEWT -> ifdef MYNEWT
Currently there's a mix of `#if MYNEWT` and `#ifdef MYNEWT` used
in the codebase to check if the environment is Mynewt or not.
This is incompatible with `-Wundef`, so switch common parts of the code to
uniformly use `#ifdef`.
2023-07-20 15:15:07 +02:00
Mingjie Shen cc556e97f4 porting: Add missing return statement 2023-07-19 13:54:20 +02:00
Mingjie Shen 28649933ad porting/examples: Fix implicit function declaration 2023-07-19 13:53:55 +02:00
Petro Karashchenko 62cfff4840 porting/npl/nuttx: add support for thread names
Use pthread_setname_np() to set names for created tasks

Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-08 22:08:07 +02:00
Petro Karashchenko a0f74cd181 porting/examples/nuttx: align parameters passed to ble_npl_task_init()
Signed-off-by: Petro Karashchenko <petro.karashchenko@gmail.com>
2023-07-08 22:08:07 +02:00
Bas van den Berg 333c575bbf build: fix various compile warnings
mostly comparison signed vs unsigned and possible un-initialized usage
2023-04-17 13:13:02 +02:00
raiden00pl 88758a8107 porting/nuttx/example: perform initialization if not done by NSH
For example, when Nimble NuttX example is the entry point for users applications.
2023-03-14 01:17:11 +01:00
Szymon Janc 17a8e61fde porting: Remove unused SYSINIT_PANIC_MSG
Those are no longer used.
2023-02-21 17:12:42 +01:00
Xiang Xiao e0e9629afe porting/nuttx; Fix error: unrecognized command-line option '-m32'
-m32 is supported by x64 toolchain, not arm-none-eabi-gcc

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-21 12:12:26 +01:00
Szymon Janc efb9058a42 nimble/ll: Add option to control initial DLE update
New option allows to select if controller should initiate DLE update
automatically for connection. By default it is enabled to not change
existing controller behavior.
2023-02-10 14:49:51 +01:00
Xiang Xiao 69c0d323a9 porting: Fix SYSINIT_PANIC_ASSERT_MSG refinition warning
porting/npl/nuttx/include/nimble/nimble_npl_os.h:40: warning: "SYSINIT_PANIC_ASSERT_MSG" redefined
   40 | #define SYSINIT_PANIC_ASSERT_MSG(rc, msg) do \
      |
nimble/host/services/tps/src/ble_svc_tps.c:22:
porting/nimble/include/sysinit/sysinit.h:32: note: this is the location of the previous definition
   32 | #define SYSINIT_PANIC_ASSERT_MSG(rc, msg)   assert(rc)
      |

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-08 16:12:16 +01:00
Szymon Janc 674eeafa0b nimble/ports: Refresh syscfg 2023-02-07 08:37:18 +01:00
Xiang Xiao ed083b36cb porting/nuttx: Fix error: implicit declaration of function 'usleep'
Report here:
https://github.com/apache/nuttx/actions/runs/4098214664/jobs/7067171681

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-02-06 08:44:58 +01:00
Szymon Janc 33942430e3 nimble/ports: Refresh syscfg 2023-02-02 20:04:35 +01:00
Szymon Janc 58a71bad16 portling/linux: Fix build on latest Fedora
This leads to implicit include of unistd.h which provides link symbol
that collide with mesh internal symbols. If needed c files may include
it directly.
2022-12-13 00:21:58 +01:00
Szymon Janc 2587fbfd8b nimble/mesh: Fix build on linux
Use MIN/MAX macros instead of min/max.
2022-12-13 00:21:58 +01:00
Szymon Janc eddc008fa5 porting/examples: Fix build error on linux
Since 'using namespace std' was removed from public header it is
needed to explicitly use it when using std::list
2022-12-13 00:21:58 +01:00
timoxd7 cea78d32c2 Fixed min/max formatting 2022-11-22 10:07:45 +01:00
timoxd7 32f2ab3ab6 Moved min/max macros from global scope in header file to translation unit exlusice c files 2022-11-22 10:07:45 +01:00
timoxd7 639da1a0f3 Removed 'using namespace std;' from header file 2022-11-22 10:07:45 +01:00
Rahul Tank 18203ccafc nimble/host: Add HCI Commands/ events for connection subrating 2022-10-05 16:09:52 +02:00
Szymon Janc b21575c894 nimble/ports: Refresh syscfg 2022-10-03 15:22:29 +02:00
Hang Fan d21a386e96 porting/examples: Fix build error
Add default macro of MYNEWT_VAL_BLE_L2CAP_COC_SDU_BUFF_COUNT
to avoid build error.
2022-09-27 08:32:45 +02:00
Szymon Janc 60b51b0b80 nimble/ports: Refresh syscfg 2022-09-08 11:58:53 +02:00
larry a77acc4250 porting/npl/nuttx: fix callout_handler implement
callout_thread is working for all timeout callout, it need
an endless loop to catch all message.
2022-08-04 09:01:51 +02:00
Krzysztof Kopyściński acaa9351b1 nimble/host/sm: rename BLE_SM_SC_LVL to BLE_SM_LVL
This rename makes it consistent with Core specification Vol. 3,
part C, 10.2.1 LE security mode 1. This level specifies security
requirements for both SC and legacy pairing, not only SC.
Updated description of this setting.
2022-06-29 13:53:36 +02:00
Hauke Petersen 49001982f2 porting/os_mbuf: silence Wcast-align warnings 2022-06-02 10:10:26 +02:00