Issue compiling BLE GATT example

brisket_bronson
Posts: 1
Joined: Sun Aug 25, 2024 12:50 pm

Issue compiling BLE GATT example

Postby brisket_bronson » Sun Aug 25, 2024 1:04 pm

I'm not really sure what's happening here, but I saw other old discussions in the forum from people with the same issues.

I can normally run, build, flash, and use the GATT server BLE example. No problems at all.
But when I try to use the very same file in my other ESP-IDF project, I get errors like
  1. error: jump to case label
  1. error: enumeration value 'ESP_GATTS_CONF_EVT' not handled in switch
Things that I've tried:
  • Change the extension from .c to .cpp
  • Have this code inside my project
  • Moved this code to a separate component
The results are still the same.
What can be the reason for this?

Here's some bigger chunk of the logs:
  1. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:340:10: error: jump to case label
  2.   340 |     case ESP_GATTS_READ_EVT: {
  3.       |          ^~~~~~~~~~~~~~~~~~
  4. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  5.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  6.       |                   ^~~
  7. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  8.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  9.       |                   ^~~~~~~~~~~~~~~~
  10. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:354:10: error: jump to case label
  11.   354 |     case ESP_GATTS_WRITE_EVT: {
  12.       |          ^~~~~~~~~~~~~~~~~~~
  13. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  14.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  15.       |                   ^~~
  16. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  17.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  18.       |                   ^~~~~~~~~~~~~~~~
  19. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:398:10: error: jump to case label
  20.   398 |     case ESP_GATTS_EXEC_WRITE_EVT:
  21.       |          ^~~~~~~~~~~~~~~~~~~~~~~~
  22. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  23.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  24.       |                   ^~~
  25. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  26.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  27.       |                   ^~~~~~~~~~~~~~~~
  28. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:403:10: error: jump to case label
  29.   403 |     case ESP_GATTS_MTU_EVT:
  30.       |          ^~~~~~~~~~~~~~~~~
  31. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  32.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  33.       |                   ^~~
  34. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  35.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  36.       |                   ^~~~~~~~~~~~~~~~
  37. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:406:10: error: jump to case label
  38.   406 |     case ESP_GATTS_UNREG_EVT:
  39.       |          ^~~~~~~~~~~~~~~~~~~
  40. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  41.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  42.       |                   ^~~
  43. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  44.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  45.       |                   ^~~~~~~~~~~~~~~~
  46. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:408:10: error: jump to case label
  47.   408 |     case ESP_GATTS_CREATE_EVT:
  48.       |          ^~~~~~~~~~~~~~~~~~~~
  49. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  50.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  51.       |                   ^~~
  52. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  53.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  54.       |                   ^~~~~~~~~~~~~~~~
  55. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:424:10: error: jump to case label
  56.   424 |     case ESP_GATTS_ADD_INCL_SRVC_EVT:
  57.       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  58. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  59.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  60.       |                   ^~~~~~~~~~~~
  61. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  62.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  63.       |                   ^~~
  64. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  65.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  66.       |                   ^~~~~~~~~~~~~~~~
  67. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:426:10: error: jump to case label
  68.   426 |     case ESP_GATTS_ADD_CHAR_EVT: {
  69.       |          ^~~~~~~~~~~~~~~~~~~~~~
  70. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  71.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  72.       |                   ^~~~~~~~~~~~
  73. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  74.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  75.       |                   ^~~
  76. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  77.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  78.       |                   ^~~~~~~~~~~~~~~~
  79. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:451:10: error: jump to case label
  80.   451 |     case ESP_GATTS_ADD_CHAR_DESCR_EVT:
  81.       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  82. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  83.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  84.       |                   ^~~~~~~~~~~~
  85. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  86.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  87.       |                   ^~~
  88. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  89.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  90.       |                   ^~~~~~~~~~~~~~~~
  91. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:456:10: error: jump to case label
  92.   456 |     case ESP_GATTS_DELETE_EVT:
  93.       |          ^~~~~~~~~~~~~~~~~~~~
  94. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  95.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  96.       |                   ^~~~~~~~~~~~
  97. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  98.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  99.       |                   ^~~
  100. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  101.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  102.       |                   ^~~~~~~~~~~~~~~~
  103. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:458:10: error: jump to case label
  104.   458 |     case ESP_GATTS_START_EVT:
  105.       |          ^~~~~~~~~~~~~~~~~~~
  106. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  107.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  108.       |                   ^~~~~~~~~~~~
  109. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  110.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  111.       |                   ^~~
  112. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  113.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  114.       |                   ^~~~~~~~~~~~~~~~
  115. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:462:10: error: jump to case label
  116.   462 |     case ESP_GATTS_STOP_EVT:
  117.       |          ^~~~~~~~~~~~~~~~~~
  118. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  119.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  120.       |                   ^~~~~~~~~~~~
  121. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  122.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  123.       |                   ^~~
  124. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  125.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  126.       |                   ^~~~~~~~~~~~~~~~
  127. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:464:10: error: jump to case label
  128.   464 |     case ESP_GATTS_CONNECT_EVT: {
  129.       |          ^~~~~~~~~~~~~~~~~~~~~
  130. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  131.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  132.       |                   ^~~~~~~~~~~~
  133. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  134.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  135.       |                   ^~~
  136. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  137.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  138.       |                   ^~~~~~~~~~~~~~~~
  139. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:465:54: warning: missing initializer for member 'esp_ble_conn_update_params_t::min_int' [-Wmissing-field-initializers]
  140.   465 |         esp_ble_conn_update_params_t conn_params = {0};
  141.       |                                                      ^
  142. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:465:54: warning: missing initializer for member 'esp_ble_conn_update_params_t::max_int' [-Wmissing-field-initializers]
  143. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:465:54: warning: missing initializer for member 'esp_ble_conn_update_params_t::latency' [-Wmissing-field-initializers]
  144. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:465:54: warning: missing initializer for member 'esp_ble_conn_update_params_t::timeout' [-Wmissing-field-initializers]
  145. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:481:10: error: jump to case label
  146.   481 |     case ESP_GATTS_DISCONNECT_EVT:
  147.       |          ^~~~~~~~~~~~~~~~~~~~~~~~
  148. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  149.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  150.       |                   ^~~~~~~~~~~~
  151. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  152.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  153.       |                   ^~~
  154. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  155.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  156.       |                   ^~~~~~~~~~~~~~~~
  157. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:485:10: error: jump to case label
  158.   485 |     case ESP_GATTS_CONF_EVT:
  159.       |          ^~~~~~~~~~~~~~~~~~
  160. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  161.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  162.       |                   ^~~~~~~~~~~~
  163. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  164.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  165.       |                   ^~~
  166. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  167.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  168.       |                   ^~~~~~~~~~~~~~~~
  169. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:491:10: error: jump to case label
  170.   491 |     case ESP_GATTS_OPEN_EVT:
  171.       |          ^~~~~~~~~~~~~~~~~~
  172. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  173.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  174.       |                   ^~~~~~~~~~~~
  175. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  176.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  177.       |                   ^~~
  178. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  179.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  180.       |                   ^~~~~~~~~~~~~~~~
  181. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:492:10: error: jump to case label
  182.   492 |     case ESP_GATTS_CANCEL_OPEN_EVT:
  183.       |          ^~~~~~~~~~~~~~~~~~~~~~~~~
  184. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  185.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  186.       |                   ^~~~~~~~~~~~
  187. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  188.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  189.       |                   ^~~
  190. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  191.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  192.       |                   ^~~~~~~~~~~~~~~~
  193. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:493:10: error: jump to case label
  194.   493 |     case ESP_GATTS_CLOSE_EVT:
  195.       |          ^~~~~~~~~~~~~~~~~~~
  196. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  197.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  198.       |                   ^~~~~~~~~~~~
  199. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  200.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  201.       |                   ^~~
  202. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  203.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  204.       |                   ^~~~~~~~~~~~~~~~
  205. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:494:10: error: jump to case label
  206.   494 |     case ESP_GATTS_LISTEN_EVT:
  207.       |          ^~~~~~~~~~~~~~~~~~~~
  208. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  209.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  210.       |                   ^~~~~~~~~~~~
  211. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  212.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  213.       |                   ^~~
  214. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  215.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  216.       |                   ^~~~~~~~~~~~~~~~
  217. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:495:10: error: jump to case label
  218.   495 |     case ESP_GATTS_CONGEST_EVT:
  219.       |          ^~~~~~~~~~~~~~~~~~~~~
  220. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  221.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  222.       |                   ^~~~~~~~~~~~
  223. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  224.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  225.       |                   ^~~
  226. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  227.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  228.       |                   ^~~~~~~~~~~~~~~~
  229. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:496:5: error: jump to case label
  230.   496 |     default:
  231.       |     ^~~~~~~
  232. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:416:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  233.   416 |         esp_err_t add_char_ret = esp_ble_gatts_add_char(gl_profile_tab[PROFILE_A_APP_ID].service_handle, &gl_profile_tab[PROFILE_A_APP_ID].char_uuid,
  234.       |                   ^~~~~~~~~~~~
  235. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:325:19: note:   crosses initialization of 'esp_err_t ret'
  236.   325 |         esp_err_t ret = esp_ble_gap_config_adv_data(&adv_data);
  237.       |                   ^~~
  238. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:308:19: note:   crosses initialization of 'esp_err_t set_dev_name_ret'
  239.   308 |         esp_err_t set_dev_name_ret = esp_ble_gap_set_device_name(TEST_DEVICE_NAME);
  240.       |                   ^~~~~~~~~~~~~~~~
  241. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_READ_EVT' not handled in switch [-Werror=switch]
  242.   300 |     switch (event) {
  243.       |            ^
  244. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_WRITE_EVT' not handled in switch [-Werror=switch]
  245. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_EXEC_WRITE_EVT' not handled in switch [-Werror=switch]
  246. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_MTU_EVT' not handled in switch [-Werror=switch]
  247. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_CONF_EVT' not handled in switch [-Werror=switch]
  248. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_UNREG_EVT' not handled in switch [-Werror=switch]
  249. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_CREATE_EVT' not handled in switch [-Werror=switch]
  250. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_ADD_INCL_SRVC_EVT' not handled in switch [-Werror=switch]
  251. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_ADD_CHAR_EVT' not handled in switch [-Werror=switch]
  252. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_ADD_CHAR_DESCR_EVT' not handled in switch [-Werror=switch]
  253. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_DELETE_EVT' not handled in switch [-Werror=switch]
  254. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_START_EVT' not handled in switch [-Werror=switch]
  255. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_STOP_EVT' not handled in switch [-Werror=switch]
  256. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_CONNECT_EVT' not handled in switch [-Werror=switch]
  257. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_DISCONNECT_EVT' not handled in switch [-Werror=switch]
  258. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_OPEN_EVT' not handled in switch [-Werror=switch]
  259. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_CANCEL_OPEN_EVT' not handled in switch [-Werror=switch]
  260. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_CLOSE_EVT' not handled in switch [-Werror=switch]
  261. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_LISTEN_EVT' not handled in switch [-Werror=switch]
  262. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_CONGEST_EVT' not handled in switch [-Werror=switch]
  263. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_RESPONSE_EVT' not handled in switch [-Werror=switch]
  264. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_CREAT_ATTR_TAB_EVT' not handled in switch [-Werror=switch]
  265. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_SET_ATTR_VAL_EVT' not handled in switch [-Werror=switch]
  266. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:300:12: error: enumeration value 'ESP_GATTS_SEND_SERVICE_CHANGE_EVT' not handled in switch [-Werror=switch]
  267. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp: In function 'void gatts_profile_b_event_handler(esp_gatts_cb_event_t, esp_gatt_if_t, esp_ble_gatts_cb_param_t*)':
  268. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:595:10: error: jump to case label
  269.   595 |     case ESP_GATTS_ADD_INCL_SRVC_EVT:
  270.       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  271. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  272.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  273.       |                   ^~~~~~~~~~~~
  274. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:597:10: error: jump to case label
  275.   597 |     case ESP_GATTS_ADD_CHAR_EVT:
  276.       |          ^~~~~~~~~~~~~~~~~~~~~~
  277. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  278.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  279.       |                   ^~~~~~~~~~~~
  280. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:608:10: error: jump to case label
  281.   608 |     case ESP_GATTS_ADD_CHAR_DESCR_EVT:
  282.       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
  283. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  284.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  285.       |                   ^~~~~~~~~~~~
  286. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:613:10: error: jump to case label
  287.   613 |     case ESP_GATTS_DELETE_EVT:
  288.       |          ^~~~~~~~~~~~~~~~~~~~
  289. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  290.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  291.       |                   ^~~~~~~~~~~~
  292. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:615:10: error: jump to case label
  293.   615 |     case ESP_GATTS_START_EVT:
  294.       |          ^~~~~~~~~~~~~~~~~~~
  295. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  296.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  297.       |                   ^~~~~~~~~~~~
  298. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:619:10: error: jump to case label
  299.   619 |     case ESP_GATTS_STOP_EVT:
  300.       |          ^~~~~~~~~~~~~~~~~~
  301. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  302.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  303.       |                   ^~~~~~~~~~~~
  304. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:621:10: error: jump to case label
  305.   621 |     case ESP_GATTS_CONNECT_EVT:
  306.       |          ^~~~~~~~~~~~~~~~~~~~~
  307. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  308.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  309.       |                   ^~~~~~~~~~~~
  310. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:628:10: error: jump to case label
  311.   628 |     case ESP_GATTS_CONF_EVT:
  312.       |          ^~~~~~~~~~~~~~~~~~
  313. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  314.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  315.       |                   ^~~~~~~~~~~~
  316. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:634:10: error: jump to case label
  317.   634 |     case ESP_GATTS_DISCONNECT_EVT:
  318.       |          ^~~~~~~~~~~~~~~~~~~~~~~~
  319. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  320.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  321.       |                   ^~~~~~~~~~~~
  322. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:635:10: error: jump to case label
  323.   635 |     case ESP_GATTS_OPEN_EVT:
  324.       |          ^~~~~~~~~~~~~~~~~~
  325. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  326.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  327.       |                   ^~~~~~~~~~~~
  328. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:636:10: error: jump to case label
  329.   636 |     case ESP_GATTS_CANCEL_OPEN_EVT:
  330.       |          ^~~~~~~~~~~~~~~~~~~~~~~~~
  331. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:587:19: note:   crosses initialization of 'esp_err_t add_char_ret'
  332.   587 |         esp_err_t add_char_ret =esp_ble_gatts_add_char( gl_profile_tab[PROFILE_B_APP_ID].service_handle, &gl_profile_tab[PROFILE_B_APP_ID].char_uuid,
  333.       |                   ^~~~~~~~~~~~
  334. /Users/myusername/workspace/myprojectname/components/ble/ble.cpp:637:10: error: jump to case label
  335.   637 |     case ESP_GATTS_CLOSE_EVT:
  336.       |          ^~~~~~~~~~~~~~~~~~~
  337.  

Who is online

Users browsing this forum: No registered users and 145 guests