@@ -151,65 +151,6 @@ macro(nf_fix_esp32c3_rom_file)
151151
152152endmacro ()
153153
154- # fixes the NimBLE version for IDF 5.5.3 which causes connection issues
155- function (nf_fix_nimble_idf553 )
156-
157- # Check we are running on IDF v5.5.3, if not, no need to do anything
158- string (FIND "${MY_IDF_VER} " "v5.5.3" ESP32_IDF_VERSION_INDEX)
159- if (ESP32_IDF_VERSION_INDEX EQUAL -1)
160- return ()
161- endif ()
162-
163- set (TRANSPORT_PATH ${esp32_idf_SOURCE_DIR } /components/bt/host/nimble/nimble/nimble/transport/src/transport.c)
164- file (READ
165- ${TRANSPORT_PATH}
166- ESP32_NIMBLE_TRANSPORT_CONTENT )
167-
168- message (STATUS "Check if Nimble on IDF v5.5.3 needs patching" )
169-
170- # Check if the file already has the correct include to avoid doing the replacement multiple times
171- string (FIND "${ESP32_NIMBLE_TRANSPORT_CONTENT} " "#include <nimble/nimble_opt.h>" ESP32_NIMBLE_TRANSPORT_FOUND_INDEX)
172- if (NOT ${ESP32_NIMBLE_TRANSPORT_FOUND_INDEX} EQUAL -1)
173- # the file already has the correct include, no need to do anything
174- message (STATUS "Nimble on IDF v5.5.3 already patched" )
175- return ()
176- endif ()
177-
178- message (STATUS "Patching Nimble on IDF v5.5.3 - transport.c" )
179-
180- string (REPLACE
181- "#include <nimble/hci_common.h>"
182- "#include <nimble/hci_common.h>
183- #include <nimble/nimble_opt.h>"
184- ESP32_NIMBLE_TRANSPORT_NEW_CONTENT
185- "${ESP32_NIMBLE_TRANSPORT_CONTENT} " )
186-
187- file (WRITE
188- ${TRANSPORT_PATH}
189- "${ESP32_NIMBLE_TRANSPORT_NEW_CONTENT} " )
190-
191- set (HCI_UART_PATH ${esp32_idf_SOURCE_DIR } /components/bt/host/nimble/nimble/nimble/transport/uart/src/hci_uart.c)
192-
193- message (STATUS "Patching Nimble on IDF v5.5.3 - hci_uart.c" )
194-
195- file (READ
196- ${HCI_UART_PATH}
197- ESP32_NIMBLE_HCI_UART_CONTENT )
198-
199- string (REPLACE
200- "#include \" hal/hal_uart.h\" "
201- "#include \" hal/hal_uart.h\"
202- #include \" nimble/nimble_opt.h\" "
203- ESP32_NIMBLE_HCI_UART_NEW_CONTENT
204- "${ESP32_NIMBLE_HCI_UART_CONTENT} " )
205-
206- file (WRITE
207- ${HCI_UART_PATH}
208- "${ESP32_NIMBLE_HCI_UART_NEW_CONTENT} " )
209-
210- message (STATUS "Patching Nimble on IDF v5.5.3 - complete" )
211-
212- endfunction ()
213154
214155# setting compile definitions for a target based on general build options
215156# TARGET parameter to set the target that's setting them for
@@ -1092,9 +1033,6 @@ macro(nf_add_idf_as_library)
10921033
10931034 nf_fix_esp32c3_rom_file ()
10941035
1095- # Check if nimble needs patching, only relevant for IDF v5.5.3
1096- nf_fix_nimble_idf553 ()
1097-
10981036 # find out if there is support for BLE
10991037 string (FIND ${SDKCONFIG_DEFAULT_CONTENTS} "CONFIG_BT_ENABLED=y" CONFIG_BT_ENABLED_POS)
11001038
0 commit comments