espressif / esp-mdf

Espressif Mesh Development Framework, limited maintain, recommend to use https://github.com/espressif/esp-mesh-lite
Other
781 stars 253 forks source link

MDF examples compilation as C++ code fails #17

Closed raulMrello closed 5 years ago

raulMrello commented 5 years ago

Environment

Problem Description

Trying to compile any example in folder esp-mdf/examples/ as C++ code raises multiple compilation errors in mwifi.h due to ' __builtin_types_compatible_p' gnu extension.

Expected Behavior

No compilation errors should be raised.

Actual Behavior

Multiple errors of this kind: "ESP-MDF/components/mwifi/include/mwifi.h:499:68: error: expected primary-expression before 'char' + __builtin_types_compatible_p(typeof(data), char **) *...."

Steps to reproduce

This is the reproduction of trying to compile esp-mdf/examples/function_demo/mwifi example as C++ code:

  1. Rename file esp-mdf/examples/function_demo/mwifi/main/mwifi_example.c as mwifi_example.cpp
  2. Modify mwifi_example.cpp app_main function as follows, to be C++ compatible:
    ...
    extern "C" {
    void app_main(void);
    }
    void app_main(){
    ....
    ....
    }

The rest of the file is not changed at all.

  1. Change component.mk file, adding -fpermissive this C++ flag to convert some errors into warnings and enabling gnu extensions support through -std=gnu++11 flag:

    CPPFLAGS := -std=gnu++11 -fpermissive
  2. Build example with command:

    make -j8 all

Compilation output with errors:

$ make -j8 all
Toolchain path: /opt/xtensa-esp32-elf/bin/xtensa-esp32-elf-gcc
Toolchain version: crosstool-ng-1.22.0-80-g6c4433a5
Compiler version: 5.2.0
Python requirements from C:/Users/user1/Programas/ESP-MDF/esp-idf\requirements.txt are satisfied.
CXX build/main/mwifi_example.o
In file included from C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_common.h:59:0,
                 from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:25:
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp: In function 'void tcp_client_write_task(void*)':
C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_mem.h:111:12: warning: invalid conversion from 'void*' to 'char*' [-fpermissive]
         ptr; \
            ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:36:21: note: in expansion of macro 'MDF_CALLOC'
     char *data    = MDF_CALLOC(1, MWIFI_PAYLOAD_LEN);
                     ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:39:44: warning: missing initializer for member 'mwifi_data_type_t::upgrade' [-Wmissing-field-initializers]
     mwifi_data_type_t data_type      = {0x0};
                                            ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:39:44: warning: missing initializer for member 'mwifi_data_type_t::communicate' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:39:44: warning: missing initializer for member 'mwifi_data_type_t::reserved' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:39:44: warning: missing initializer for member 'mwifi_data_type_t::protocol' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:39:44: warning: missing initializer for member 'mwifi_data_type_t::custom' [-Wmissing-field-initializers]
In file included from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:26:0:
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:497:52: error: expected primary-expression before 'typeof'
                       __builtin_types_compatible_p(typeof(data), char *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                    ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:497:66: error: expected primary-expression before 'char'
                       __builtin_types_compatible_p(typeof(data), char *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                                  ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:497:72: error: '__builtin_types_compatible_p' was not declared in this scope
                       __builtin_types_compatible_p(typeof(data), char *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                                        ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:498:54: error: expected primary-expression before 'typeof'
                       + __builtin_types_compatible_p(typeof(data), uint8_t *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                      ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:498:76: error: expected primary-expression before '*' token
                       + __builtin_types_compatible_p(typeof(data), uint8_t *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                                            ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:498:77: error: expected primary-expression before ')' token
                       + __builtin_types_compatible_p(typeof(data), uint8_t *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                                             ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:499:54: error: expected primary-expression before 'typeof'
                       + __builtin_types_compatible_p(typeof(data), char **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL \
                                                      ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:499:68: error: expected primary-expression before 'char'
                       + __builtin_types_compatible_p(typeof(data), char **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL \
                                                                    ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:500:54: error: expected primary-expression before 'typeof'
                       + __builtin_types_compatible_p(typeof(data), uint8_t **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL)
                                                      ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:500:76: error: expected primary-expression before '*' token
                       + __builtin_types_compatible_p(typeof(data), uint8_t **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL)
                                                                            ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:500:78: error: expected primary-expression before ')' token
                       + __builtin_types_compatible_p(typeof(data), uint8_t **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL)
                                                                              ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:50:15: note: in expansion of macro 'mwifi_root_read'
         ret = mwifi_root_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp: In function 'int socket_tcp_client_create(const char*, uint16_t)':
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:84:9: error: expected primary-expression before '.' token
         .sin_addr.s_addr = inet_addr(ip),
         ^
In file included from C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_common.h:59:0,
                 from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:25:
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp: In function 'void tcp_client_read_task(void*)':
C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_mem.h:89:12: warning: invalid conversion from 'void*' to 'char*' [-fpermissive]
         ptr; \
            ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:107:21: note: in expansion of macro 'MDF_MALLOC'
     char *data    = MDF_MALLOC(MWIFI_PAYLOAD_LEN);
                     ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:110:45: warning: missing initializer for member 'mwifi_data_type_t::upgrade' [-Wmissing-field-initializers]
     mwifi_data_type_t data_type       = {0x0};
                                             ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:110:45: warning: missing initializer for member 'mwifi_data_type_t::communicate' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:110:45: warning: missing initializer for member 'mwifi_data_type_t::reserved' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:110:45: warning: missing initializer for member 'mwifi_data_type_t::protocol' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:110:45: warning: missing initializer for member 'mwifi_data_type_t::custom' [-Wmissing-field-initializers]
In file included from C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_common.h:59:0,
                 from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:25:
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp: In function 'void node_read_task(void*)':
C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_mem.h:89:12: warning: invalid conversion from 'void*' to 'char*' [-fpermissive]
         ptr; \
            ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:193:21: note: in expansion of macro 'MDF_MALLOC'
     char *data    = MDF_MALLOC(MWIFI_PAYLOAD_LEN);
                     ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:195:44: warning: missing initializer for member 'mwifi_data_type_t::upgrade' [-Wmissing-field-initializers]
     mwifi_data_type_t data_type      = {0x0};
                                            ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:195:44: warning: missing initializer for member 'mwifi_data_type_t::communicate' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:195:44: warning: missing initializer for member 'mwifi_data_type_t::reserved' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:195:44: warning: missing initializer for member 'mwifi_data_type_t::protocol' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:195:44: warning: missing initializer for member 'mwifi_data_type_t::custom' [-Wmissing-field-initializers]
In file included from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:26:0:
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:429:47: error: expected primary-expression before 'typeof'
                  __builtin_types_compatible_p(typeof(data), char *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                               ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:429:61: error: expected primary-expression before 'char'
                  __builtin_types_compatible_p(typeof(data), char *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                             ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:429:67: error: '__builtin_types_compatible_p' was not declared in this scope
                  __builtin_types_compatible_p(typeof(data), char *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                                   ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:430:49: error: expected primary-expression before 'typeof'
                  + __builtin_types_compatible_p(typeof(data), uint8_t *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                 ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:430:71: error: expected primary-expression before '*' token
                  + __builtin_types_compatible_p(typeof(data), uint8_t *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                                       ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:430:72: error: expected primary-expression before ')' token
                  + __builtin_types_compatible_p(typeof(data), uint8_t *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                                                                        ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:431:49: error: expected primary-expression before 'typeof'
                  + __builtin_types_compatible_p(typeof(data), char **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL \
                                                 ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:431:63: error: expected primary-expression before 'char'
                  + __builtin_types_compatible_p(typeof(data), char **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL \
                                                               ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:432:49: error: expected primary-expression before 'typeof'
                  + __builtin_types_compatible_p(typeof(data), uint8_t **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL)
                                                 ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:432:71: error: expected primary-expression before '*' token
                  + __builtin_types_compatible_p(typeof(data), uint8_t **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL)
                                                                       ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:432:73: error: expected primary-expression before ')' token
                  + __builtin_types_compatible_p(typeof(data), uint8_t **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL)
                                                                         ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:208:15: note: in expansion of macro 'mwifi_read'
         ret = mwifi_read(src_addr, &data_type, data, &size, portMAX_DELAY);
               ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:223:59: warning: invalid conversion from 'int' to 'gpio_num_t' [-fpermissive]
         gpio_set_level(CONFIG_LED_GPIO_NUM, pSub->valueint);
                                                           ^
In file included from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/esp32/include/esp_sleep.h:19:0,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/esp32/include/esp_system.h:21,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/freertos/include/freertos/portable.h:126,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/freertos/include/freertos/FreeRTOS.h:105,
                 from C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_common.h:36,
                 from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:25:
C:/Users/user1/Programas/ESP-MDF/esp-idf/components/driver/include/driver/gpio.h:315:11: note:   initializing argument 1 of 'esp_err_t gpio_set_level(gpio_num_t, uint32_t)'
 esp_err_t gpio_set_level(gpio_num_t gpio_num, uint32_t level);
           ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp: In function 'void node_write_task(void*)':
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:240:44: warning: missing initializer for member 'mwifi_data_type_t::upgrade' [-Wmissing-field-initializers]
     mwifi_data_type_t data_type      = {0x0};
                                            ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:240:44: warning: missing initializer for member 'mwifi_data_type_t::communicate' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:240:44: warning: missing initializer for member 'mwifi_data_type_t::reserved' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:240:44: warning: missing initializer for member 'mwifi_data_type_t::protocol' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:240:44: warning: missing initializer for member 'mwifi_data_type_t::custom' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:251:90: warning: invalid conversion from 'int' to 'gpio_num_t' [-fpermissive]
                         count++, esp_mesh_get_layer(), gpio_get_level(CONFIG_LED_GPIO_NUM));
                                                                                          ^
In file included from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/esp32/include/esp_sleep.h:19:0,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/esp32/include/esp_system.h:21,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/freertos/include/freertos/portable.h:126,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/freertos/include/freertos/FreeRTOS.h:105,
                 from C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_common.h:36,
                 from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:25:
C:/Users/user1/Programas/ESP-MDF/esp-idf/components/driver/include/driver/gpio.h:329:5: note:   initializing argument 1 of 'int gpio_get_level(gpio_num_t)'
 int gpio_get_level(gpio_num_t gpio_num);
     ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp: In function 'void print_system_info_timercb(void*)':
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:272:39: warning: invalid conversion from 'int' to 'wifi_second_chan_t' [-fpermissive]
     wifi_second_chan_t second       = 0;
                                       ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::len' [-Wmissing-field-initializers]
     mesh_assoc_t mesh_assoc         = {0x0};
                                           ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::oui' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::type' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::encrypted' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::version' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::mesh_type' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::mesh_id' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::layer_cap' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::layer' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::assoc_cap' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::assoc' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::leaf_cap' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::leaf_assoc' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::root_cap' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::self_cap' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::layer2_cap' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::scan_ap_num' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::rssi' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::router_rssi' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::flag' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::rc_addr' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::rc_rssi' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::vote_addr' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::vote_rssi' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::vote_ttl' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::votes' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::my_votes' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::reason' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::child' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:275:43: warning: missing initializer for member 'mesh_assoc_t::toDS' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'wifi_sta_info_t::rssi' [-Wmissing-field-initializers]
     wifi_sta_list_t wifi_sta_list   = {0x0};
                                           ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'wifi_sta_info_t::phy_11b' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'wifi_sta_info_t::phy_11g' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'wifi_sta_info_t::phy_11n' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'wifi_sta_info_t::phy_lr' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'wifi_sta_info_t::reserved' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'wifi_sta_list_t::num' [-Wmissing-field-initializers]
In file included from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:26:0:
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp: In function 'void app_main()':
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:175:5: sorry, unimplemented: non-trivial designated initializers not supported
     };
     ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:385:33: note: in expansion of macro 'MWIFI_INIT_CONFIG_DEFAULT'
     mwifi_init_config_t cfg   = MWIFI_INIT_CONFIG_DEFAULT();
                                 ^
C:/Users/user1/Programas/ESP-MDF/components/mwifi/include/mwifi.h:175:5: sorry, unimplemented: non-trivial designated initializers not supported
     };
     ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:385:33: note: in expansion of macro 'MWIFI_INIT_CONFIG_DEFAULT'
     mwifi_init_config_t cfg   = MWIFI_INIT_CONFIG_DEFAULT();
                                 ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: error: C99 designator 'router_ssid' outside aggregate initializer
     };
     ^
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: error: C99 designator 'router_password' outside aggregate initializer
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: error: C99 designator 'mesh_id' outside aggregate initializer
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: error: C99 designator 'mesh_password' outside aggregate initializer
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: sorry, unimplemented: non-trivial designated initializers not supported
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: sorry, unimplemented: non-trivial designated initializers not supported
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: warning: missing initializer for member 'mwifi_config_t::mesh_password' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: warning: missing initializer for member 'mwifi_config_t::mesh_type' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: warning: missing initializer for member 'mwifi_config_t::channel' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: warning: missing initializer for member 'mwifi_config_t::channel_switch_disable' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:391:5: warning: missing initializer for member 'mwifi_config_t::router_switch_disable' [-Wmissing-field-initializers]
C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:400:67: warning: invalid conversion from 'int' to 'gpio_num_t' [-fpermissive]
     gpio_set_direction(CONFIG_LED_GPIO_NUM, GPIO_MODE_INPUT_OUTPUT);
                                                                   ^
In file included from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/esp32/include/esp_sleep.h:19:0,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/esp32/include/esp_system.h:21,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/freertos/include/freertos/portable.h:126,
                 from C:/Users/user1/Programas/ESP-MDF/esp-idf/components/freertos/include/freertos/FreeRTOS.h:105,
                 from C:/Users/user1/Programas/ESP-MDF/components/mcommon/include/mdf_common.h:36,
                 from C:/Users/user1/workspace/iot/ESP32/mwifi_demo/main/mwifi_example.cpp:25:
C:/Users/user1/Programas/ESP-MDF/esp-idf/components/driver/include/driver/gpio.h:344:11: note:   initializing argument 1 of 'esp_err_t gpio_set_direction(gpio_num_t, gpio_mode_t)'
 esp_err_t gpio_set_direction(gpio_num_t gpio_num, gpio_mode_t mode);
           ^
make[1]: *** [/C/Users/user1/Programas/ESP-MDF/esp-idf/make/component_wrapper.mk:292: mwifi_example.o] Error 1
CC build/smartconfig_ack/smartconfig_ack.o
CC build/sdmmc/sdmmc_sd.o
make: *** [/C/Users/user1/Programas/ESP-MDF/esp-idf/make/project.mk:527: component-main-build] Error 2
make: *** Se espera a que terminen otras tareas....
CC build/soc/esp32/rtc_clk.o
CC build/sdmmc/sdmmc_cmd.o
CC build/spi_flash/flash_ops.o
CC build/spiffs/esp_spiffs.o
CC build/soc/esp32/rtc_time.o
CC build/sdmmc/sdmmc_mmc.o
AR build/smartconfig_ack/libsmartconfig_ack.a
CC build/spi_flash/cache_utils.o
CC build/sdmmc/sdmmc_common.o
CC build/spi_flash/spi_flash_rom_patch.o
CC build/spiffs/spiffs_api.o
CC build/soc/esp32/rtc_sleep.o
CC build/sdmmc/sdmmc_io.o
CC build/spi_flash/partition.o
CC build/sdmmc/sdmmc_init.o
CC build/soc/esp32/gpio_periph.o
CC build/spiffs/spiffs/src/spiffs_hydrogen.o
CC build/soc/esp32/rtc_clk_init.o
fatal: No es un repositorio git (ni ninguno de los directorios superiores): .git
Project do not have git repo, it needs to get PROJECT_VER from `git describe` command.
App "mwifi_demo" version: ""
CC build/soc/esp32/spi_periph.o
CC build/spi_flash/flash_mmap.o
CC build/soc/esp32/rtc_init.o
CC build/soc/esp32/sdio_slave_periph.o
CC build/app_update/esp_app_desc.o
AR build/sdmmc/libsdmmc.a
CC build/spiffs/spiffs/src/spiffs_check.o
CC build/soc/esp32/rtc_wdt.o
CC build/soc/esp32/sdmmc_periph.o
CC build/soc/esp32/cpu_util.o
CC build/soc/esp32/rtc_periph.o
AR build/app_update/libapp_update.a
CC build/soc/esp32/rtc_pm.o
CC build/soc/esp32/soc_memory_layout.o
AR build/spi_flash/libspi_flash.a
CC build/soc/src//memory_layout_utils.o
CC build/spiffs/spiffs/src/spiffs_nucleus.o
CC build/spiffs/spiffs/src/spiffs_gc.o
CC build/spiffs/spiffs/src/spiffs_cache.o
AR build/soc/libsoc.a
AR build/spiffs/libspiffs.a

sdkconfig content:

# Automatically generated file; DO NOT EDIT.
# Espressif IoT Development Framework Configuration
#
CONFIG_IDF_TARGET="esp32"

#
# SDK tool configuration
#
CONFIG_TOOLPREFIX="xtensa-esp32-elf-"
CONFIG_PYTHON="/C/Python27/python.exe"
CONFIG_MAKE_WARN_UNDEFINED_VARIABLES=y

#
# Application manager
#
CONFIG_APP_COMPILE_TIME_DATE=y

#
# Bootloader config
#
CONFIG_LOG_BOOTLOADER_LEVEL_NONE=
CONFIG_LOG_BOOTLOADER_LEVEL_ERROR=
CONFIG_LOG_BOOTLOADER_LEVEL_WARN=
CONFIG_LOG_BOOTLOADER_LEVEL_INFO=y
CONFIG_LOG_BOOTLOADER_LEVEL_DEBUG=
CONFIG_LOG_BOOTLOADER_LEVEL_VERBOSE=
CONFIG_LOG_BOOTLOADER_LEVEL=3
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_8V=
CONFIG_BOOTLOADER_VDDSDIO_BOOST_1_9V=y
CONFIG_BOOTLOADER_FACTORY_RESET=
CONFIG_BOOTLOADER_APP_TEST=
CONFIG_BOOTLOADER_WDT_ENABLE=y
CONFIG_BOOTLOADER_WDT_DISABLE_IN_USER_CODE=
CONFIG_BOOTLOADER_WDT_TIME_MS=9000

#
# Security features
#
CONFIG_SECURE_SIGNED_APPS_NO_SECURE_BOOT=
CONFIG_SECURE_BOOT_ENABLED=
CONFIG_FLASH_ENCRYPTION_ENABLED=

#
# Serial flasher config
#
CONFIG_ESPTOOLPY_PORT="COM6"
CONFIG_ESPTOOLPY_BAUD_115200B=y
CONFIG_ESPTOOLPY_BAUD_230400B=
CONFIG_ESPTOOLPY_BAUD_921600B=
CONFIG_ESPTOOLPY_BAUD_2MB=
CONFIG_ESPTOOLPY_BAUD_OTHER=
CONFIG_ESPTOOLPY_BAUD_OTHER_VAL=115200
CONFIG_ESPTOOLPY_BAUD=115200
CONFIG_ESPTOOLPY_COMPRESSED=y
CONFIG_FLASHMODE_QIO=
CONFIG_FLASHMODE_QOUT=
CONFIG_FLASHMODE_DIO=y
CONFIG_FLASHMODE_DOUT=
CONFIG_ESPTOOLPY_FLASHMODE="dio"
CONFIG_ESPTOOLPY_FLASHFREQ_80M=
CONFIG_ESPTOOLPY_FLASHFREQ_40M=y
CONFIG_ESPTOOLPY_FLASHFREQ_26M=
CONFIG_ESPTOOLPY_FLASHFREQ_20M=
CONFIG_ESPTOOLPY_FLASHFREQ="40m"
CONFIG_ESPTOOLPY_FLASHSIZE_1MB=
CONFIG_ESPTOOLPY_FLASHSIZE_2MB=
CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_ESPTOOLPY_FLASHSIZE_8MB=
CONFIG_ESPTOOLPY_FLASHSIZE_16MB=
CONFIG_ESPTOOLPY_FLASHSIZE="4MB"
CONFIG_ESPTOOLPY_FLASHSIZE_DETECT=y
CONFIG_ESPTOOLPY_BEFORE_RESET=y
CONFIG_ESPTOOLPY_BEFORE_NORESET=
CONFIG_ESPTOOLPY_BEFORE="default_reset"
CONFIG_ESPTOOLPY_AFTER_RESET=y
CONFIG_ESPTOOLPY_AFTER_NORESET=
CONFIG_ESPTOOLPY_AFTER="hard_reset"
CONFIG_MONITOR_BAUD_9600B=
CONFIG_MONITOR_BAUD_57600B=
CONFIG_MONITOR_BAUD_115200B=y
CONFIG_MONITOR_BAUD_230400B=
CONFIG_MONITOR_BAUD_921600B=
CONFIG_MONITOR_BAUD_2MB=
CONFIG_MONITOR_BAUD_OTHER=
CONFIG_MONITOR_BAUD_OTHER_VAL=115200
CONFIG_MONITOR_BAUD=115200

#
# Example Configuration
#
CONFIG_ROUTER_SSID="Invitado"
CONFIG_ROUTER_PASSWORD="11FF00DECA"
CONFIG_MESH_ID="123456"
CONFIG_MESH_PASSWORD="MESH_PASSWORD"
CONFIG_LED_GPIO_NUM=25
CONFIG_SERVER_IP="192.168.0.1"
CONFIG_SERVER_PORT=8070

#
# Partition Table
#
CONFIG_PARTITION_TABLE_SINGLE_APP=
CONFIG_PARTITION_TABLE_TWO_OTA=
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y

#
# Compiler options
#
CONFIG_OPTIMIZATION_LEVEL_DEBUG=y
CONFIG_OPTIMIZATION_LEVEL_RELEASE=
CONFIG_OPTIMIZATION_ASSERTIONS_ENABLED=y
CONFIG_OPTIMIZATION_ASSERTIONS_SILENT=
CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=
CONFIG_CXX_EXCEPTIONS=
CONFIG_STACK_CHECK_NONE=y
CONFIG_STACK_CHECK_NORM=
CONFIG_STACK_CHECK_STRONG=
CONFIG_STACK_CHECK_ALL=
CONFIG_STACK_CHECK=
CONFIG_WARN_WRITE_STRINGS=
CONFIG_DISABLE_GCC8_WARNINGS=

#
# Component config
#

#
# Application Level Tracing
#
CONFIG_ESP32_APPTRACE_DEST_TRAX=
CONFIG_ESP32_APPTRACE_DEST_NONE=y
CONFIG_ESP32_APPTRACE_ENABLE=
CONFIG_ESP32_APPTRACE_LOCK_ENABLE=y
CONFIG_AWS_IOT_SDK=

#
# Bluetooth
#
CONFIG_BT_ENABLED=
CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=0
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_ACL_CONN_EFF=0
CONFIG_BTDM_CONTROLLER_BR_EDR_MAX_SYNC_CONN_EFF=0
CONFIG_BTDM_CONTROLLER_PINNED_TO_CORE=0
CONFIG_BT_RESERVE_DRAM=0

#
# Driver configurations
#

#
# ADC configuration
#
CONFIG_ADC_FORCE_XPD_FSM=
CONFIG_ADC2_DISABLE_DAC=y

#
# SPI configuration
#
CONFIG_SPI_MASTER_IN_IRAM=
CONFIG_SPI_MASTER_ISR_IN_IRAM=y
CONFIG_SPI_SLAVE_IN_IRAM=
CONFIG_SPI_SLAVE_ISR_IN_IRAM=y

#
# ESP32-specific
#
CONFIG_IDF_TARGET_ESP32=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_80=
CONFIG_ESP32_DEFAULT_CPU_FREQ_160=y
CONFIG_ESP32_DEFAULT_CPU_FREQ_240=
CONFIG_ESP32_DEFAULT_CPU_FREQ_MHZ=160
CONFIG_SPIRAM_SUPPORT=
CONFIG_MEMMAP_TRACEMEM=
CONFIG_MEMMAP_TRACEMEM_TWOBANKS=
CONFIG_ESP32_TRAX=
CONFIG_TRACEMEM_RESERVE_DRAM=0x0

#
# Core dump
#
CONFIG_ESP32_ENABLE_COREDUMP_TO_FLASH=y
CONFIG_ESP32_ENABLE_COREDUMP_TO_UART=
CONFIG_ESP32_ENABLE_COREDUMP_TO_NONE=
CONFIG_ESP32_ENABLE_COREDUMP=y
CONFIG_ESP32_CORE_DUMP_MAX_TASKS_NUM=64
CONFIG_TWO_UNIVERSAL_MAC_ADDRESS=
CONFIG_FOUR_UNIVERSAL_MAC_ADDRESS=y
CONFIG_NUMBER_OF_UNIVERSAL_MAC_ADDRESS=4
CONFIG_SYSTEM_EVENT_QUEUE_SIZE=32
CONFIG_SYSTEM_EVENT_TASK_STACK_SIZE=2304
CONFIG_MAIN_TASK_STACK_SIZE=3584
CONFIG_IPC_TASK_STACK_SIZE=1024
CONFIG_TIMER_TASK_STACK_SIZE=4096
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF=y
CONFIG_NEWLIB_STDOUT_LINE_ENDING_LF=
CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR=
CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF=
CONFIG_NEWLIB_STDIN_LINE_ENDING_LF=
CONFIG_NEWLIB_STDIN_LINE_ENDING_CR=y
CONFIG_NEWLIB_NANO_FORMAT=
CONFIG_CONSOLE_UART_DEFAULT=y
CONFIG_CONSOLE_UART_CUSTOM=
CONFIG_CONSOLE_UART_NONE=
CONFIG_CONSOLE_UART_NUM=0
CONFIG_CONSOLE_UART_BAUDRATE=115200
CONFIG_ULP_COPROC_ENABLED=
CONFIG_ULP_COPROC_RESERVE_MEM=0
CONFIG_ESP32_PANIC_PRINT_HALT=
CONFIG_ESP32_PANIC_PRINT_REBOOT=y
CONFIG_ESP32_PANIC_SILENT_REBOOT=
CONFIG_ESP32_PANIC_GDBSTUB=
CONFIG_ESP32_DEBUG_OCDAWARE=y
CONFIG_ESP32_DEBUG_STUBS_ENABLE=y
CONFIG_INT_WDT=y
CONFIG_INT_WDT_TIMEOUT_MS=300
CONFIG_TASK_WDT=y
CONFIG_TASK_WDT_PANIC=y
CONFIG_TASK_WDT_TIMEOUT_S=10
CONFIG_TASK_WDT_CHECK_IDLE_TASK_CPU0=y
CONFIG_BROWNOUT_DET=y
CONFIG_BROWNOUT_DET_LVL_SEL_0=y
CONFIG_BROWNOUT_DET_LVL_SEL_1=
CONFIG_BROWNOUT_DET_LVL_SEL_2=
CONFIG_BROWNOUT_DET_LVL_SEL_3=
CONFIG_BROWNOUT_DET_LVL_SEL_4=
CONFIG_BROWNOUT_DET_LVL_SEL_5=
CONFIG_BROWNOUT_DET_LVL_SEL_6=
CONFIG_BROWNOUT_DET_LVL_SEL_7=
CONFIG_BROWNOUT_DET_LVL=0
CONFIG_REDUCE_PHY_TX_POWER=y
CONFIG_ESP32_TIME_SYSCALL_USE_RTC_FRC1=y
CONFIG_ESP32_TIME_SYSCALL_USE_RTC=
CONFIG_ESP32_TIME_SYSCALL_USE_FRC1=
CONFIG_ESP32_TIME_SYSCALL_USE_NONE=
CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_RC=y
CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_CRYSTAL=
CONFIG_ESP32_RTC_CLOCK_SOURCE_EXTERNAL_OSC=
CONFIG_ESP32_RTC_CLOCK_SOURCE_INTERNAL_8MD256=
CONFIG_ESP32_RTC_CLK_CAL_CYCLES=1024
CONFIG_ESP32_DEEP_SLEEP_WAKEUP_DELAY=2000
CONFIG_ESP32_XTAL_FREQ_40=y
CONFIG_ESP32_XTAL_FREQ_26=
CONFIG_ESP32_XTAL_FREQ_AUTO=
CONFIG_ESP32_XTAL_FREQ=40
CONFIG_DISABLE_BASIC_ROM_CONSOLE=
CONFIG_NO_BLOBS=
CONFIG_ESP_TIMER_PROFILING=
CONFIG_COMPATIBLE_PRE_V2_1_BOOTLOADERS=
CONFIG_ESP_ERR_TO_NAME_LOOKUP=y
CONFIG_ESP32_RTCDATA_IN_FAST_MEM=

#
# Wi-Fi
#
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=10
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_STATIC_TX_BUFFER=
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER=y
CONFIG_ESP32_WIFI_TX_BUFFER_TYPE=1
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=32
CONFIG_ESP32_WIFI_CSI_ENABLED=
CONFIG_ESP32_WIFI_AMPDU_TX_ENABLED=y
CONFIG_ESP32_WIFI_TX_BA_WIN=6
CONFIG_ESP32_WIFI_AMPDU_RX_ENABLED=y
CONFIG_ESP32_WIFI_RX_BA_WIN=6
CONFIG_ESP32_WIFI_NVS_ENABLED=y
CONFIG_ESP32_WIFI_SOFTAP_BEACON_MAX_LEN=752
CONFIG_ESP32_WIFI_DEBUG_LOG_ENABLE=

#
# PHY
#
CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE=y
CONFIG_ESP32_PHY_INIT_DATA_IN_PARTITION=
CONFIG_ESP32_PHY_MAX_WIFI_TX_POWER=20
CONFIG_ESP32_PHY_MAX_TX_POWER=20

#
# Power Management
#
CONFIG_PM_ENABLE=

#
# ADC-Calibration
#
CONFIG_ADC_CAL_EFUSE_TP_ENABLE=y
CONFIG_ADC_CAL_EFUSE_VREF_ENABLE=y
CONFIG_ADC_CAL_LUT_ENABLE=y

#
# Event Loop Library
#
CONFIG_EVENT_LOOP_PROFILING=

#
# ESP HTTP client
#
CONFIG_ESP_HTTP_CLIENT_ENABLE_HTTPS=y

#
# HTTP Server
#
CONFIG_HTTPD_MAX_REQ_HDR_LEN=512
CONFIG_HTTPD_MAX_URI_LEN=512

#
# Ethernet
#
CONFIG_DMA_RX_BUF_NUM=10
CONFIG_DMA_TX_BUF_NUM=10
CONFIG_EMAC_L2_TO_L3_RX_BUF_MODE=y
CONFIG_EMAC_CHECK_LINK_PERIOD_MS=2000
CONFIG_EMAC_TASK_PRIORITY=20
CONFIG_EMAC_TASK_STACK_SIZE=3072

#
# FAT Filesystem support
#
CONFIG_FATFS_CODEPAGE_DYNAMIC=
CONFIG_FATFS_CODEPAGE_437=y
CONFIG_FATFS_CODEPAGE_720=
CONFIG_FATFS_CODEPAGE_737=
CONFIG_FATFS_CODEPAGE_771=
CONFIG_FATFS_CODEPAGE_775=
CONFIG_FATFS_CODEPAGE_850=
CONFIG_FATFS_CODEPAGE_852=
CONFIG_FATFS_CODEPAGE_855=
CONFIG_FATFS_CODEPAGE_857=
CONFIG_FATFS_CODEPAGE_860=
CONFIG_FATFS_CODEPAGE_861=
CONFIG_FATFS_CODEPAGE_862=
CONFIG_FATFS_CODEPAGE_863=
CONFIG_FATFS_CODEPAGE_864=
CONFIG_FATFS_CODEPAGE_865=
CONFIG_FATFS_CODEPAGE_866=
CONFIG_FATFS_CODEPAGE_869=
CONFIG_FATFS_CODEPAGE_932=
CONFIG_FATFS_CODEPAGE_936=
CONFIG_FATFS_CODEPAGE_949=
CONFIG_FATFS_CODEPAGE_950=
CONFIG_FATFS_CODEPAGE=437
CONFIG_FATFS_LFN_NONE=y
CONFIG_FATFS_LFN_HEAP=
CONFIG_FATFS_LFN_STACK=
CONFIG_FATFS_FS_LOCK=0
CONFIG_FATFS_TIMEOUT_MS=10000
CONFIG_FATFS_PER_FILE_CACHE=y

#
# Modbus configuration
#
CONFIG_MB_UART_RXD=22
CONFIG_MB_UART_TXD=23
CONFIG_MB_UART_RTS=18
CONFIG_MB_QUEUE_LENGTH=20
CONFIG_MB_SERIAL_TASK_STACK_SIZE=2048
CONFIG_MB_SERIAL_BUF_SIZE=256
CONFIG_MB_SERIAL_TASK_PRIO=10
CONFIG_MB_CONTROLLER_SLAVE_ID_SUPPORT=
CONFIG_MB_CONTROLLER_NOTIFY_TIMEOUT=20
CONFIG_MB_CONTROLLER_NOTIFY_QUEUE_SIZE=20
CONFIG_MB_CONTROLLER_STACK_SIZE=4096
CONFIG_MB_EVENT_QUEUE_TIMEOUT=20
CONFIG_MB_TIMER_PORT_ENABLED=y
CONFIG_MB_TIMER_GROUP=0
CONFIG_MB_TIMER_INDEX=0

#
# FreeRTOS
#
CONFIG_FREERTOS_UNICORE=y
CONFIG_FREERTOS_NO_AFFINITY=0x7FFFFFFF
CONFIG_FREERTOS_CORETIMER_0=y
CONFIG_FREERTOS_CORETIMER_1=
CONFIG_FREERTOS_HZ=1000
CONFIG_FREERTOS_ASSERT_ON_UNTESTED_FUNCTION=y
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_NONE=
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_PTRVAL=
CONFIG_FREERTOS_CHECK_STACKOVERFLOW_CANARY=y
CONFIG_FREERTOS_WATCHPOINT_END_OF_STACK=
CONFIG_FREERTOS_INTERRUPT_BACKTRACE=y
CONFIG_FREERTOS_THREAD_LOCAL_STORAGE_POINTERS=1
CONFIG_FREERTOS_ASSERT_FAIL_ABORT=y
CONFIG_FREERTOS_ASSERT_FAIL_PRINT_CONTINUE=
CONFIG_FREERTOS_ASSERT_DISABLE=
CONFIG_FREERTOS_IDLE_TASK_STACKSIZE=1536
CONFIG_FREERTOS_ISR_STACKSIZE=1536
CONFIG_FREERTOS_LEGACY_HOOKS=
CONFIG_FREERTOS_MAX_TASK_NAME_LEN=16
CONFIG_SUPPORT_STATIC_ALLOCATION=
CONFIG_TIMER_TASK_PRIORITY=1
CONFIG_TIMER_TASK_STACK_DEPTH=3072
CONFIG_TIMER_QUEUE_LENGTH=10
CONFIG_FREERTOS_QUEUE_REGISTRY_SIZE=0
CONFIG_FREERTOS_USE_TRACE_FACILITY=y
CONFIG_FREERTOS_USE_STATS_FORMATTING_FUNCTIONS=y
CONFIG_FREERTOS_VTASKLIST_INCLUDE_COREID=
CONFIG_FREERTOS_GENERATE_RUN_TIME_STATS=
CONFIG_FREERTOS_DEBUG_INTERNALS=
CONFIG_FREERTOS_TASK_FUNCTION_WRAPPER=y

#
# Heap memory debugging
#
CONFIG_HEAP_POISONING_DISABLED=y
CONFIG_HEAP_POISONING_LIGHT=
CONFIG_HEAP_POISONING_COMPREHENSIVE=
CONFIG_HEAP_TRACING=

#
# libsodium
#
CONFIG_LIBSODIUM_USE_MBEDTLS_SHA=y

#
# Log output
#
CONFIG_LOG_DEFAULT_LEVEL_NONE=
CONFIG_LOG_DEFAULT_LEVEL_ERROR=
CONFIG_LOG_DEFAULT_LEVEL_WARN=
CONFIG_LOG_DEFAULT_LEVEL_INFO=y
CONFIG_LOG_DEFAULT_LEVEL_DEBUG=
CONFIG_LOG_DEFAULT_LEVEL_VERBOSE=
CONFIG_LOG_DEFAULT_LEVEL=3
CONFIG_LOG_COLORS=y

#
# LWIP
#
CONFIG_L2_TO_L3_COPY=
CONFIG_LWIP_IRAM_OPTIMIZATION=
CONFIG_LWIP_MAX_SOCKETS=10
CONFIG_USE_ONLY_LWIP_SELECT=
CONFIG_LWIP_SO_REUSE=y
CONFIG_LWIP_SO_REUSE_RXTOALL=y
CONFIG_LWIP_SO_RCVBUF=
CONFIG_LWIP_DHCP_MAX_NTP_SERVERS=1
CONFIG_LWIP_IP_FRAG=
CONFIG_LWIP_IP_REASSEMBLY=
CONFIG_LWIP_STATS=
CONFIG_LWIP_ETHARP_TRUST_IP_MAC=
CONFIG_ESP_GRATUITOUS_ARP=y
CONFIG_GARP_TMR_INTERVAL=60
CONFIG_TCPIP_RECVMBOX_SIZE=32
CONFIG_LWIP_DHCP_DOES_ARP_CHECK=y
CONFIG_LWIP_DHCP_RESTORE_LAST_IP=

#
# DHCP server
#
CONFIG_LWIP_DHCPS_LEASE_UNIT=60
CONFIG_LWIP_DHCPS_MAX_STATION_NUM=8
CONFIG_LWIP_AUTOIP=
CONFIG_LWIP_NETIF_LOOPBACK=y
CONFIG_LWIP_LOOPBACK_MAX_PBUFS=8

#
# TCP
#
CONFIG_LWIP_MAX_ACTIVE_TCP=16
CONFIG_LWIP_MAX_LISTENING_TCP=16
CONFIG_TCP_MAXRTX=12
CONFIG_TCP_SYNMAXRTX=6
CONFIG_TCP_MSS=1436
CONFIG_TCP_MSL=60000
CONFIG_TCP_SND_BUF_DEFAULT=5744
CONFIG_TCP_WND_DEFAULT=5744
CONFIG_TCP_RECVMBOX_SIZE=6
CONFIG_TCP_QUEUE_OOSEQ=y
CONFIG_ESP_TCP_KEEP_CONNECTION_WHEN_IP_CHANGES=
CONFIG_TCP_OVERSIZE_MSS=y
CONFIG_TCP_OVERSIZE_QUARTER_MSS=
CONFIG_TCP_OVERSIZE_DISABLE=

#
# UDP
#
CONFIG_LWIP_MAX_UDP_PCBS=16
CONFIG_UDP_RECVMBOX_SIZE=6
CONFIG_TCPIP_TASK_STACK_SIZE=3072
CONFIG_TCPIP_TASK_AFFINITY_NO_AFFINITY=y
CONFIG_TCPIP_TASK_AFFINITY_CPU0=
CONFIG_TCPIP_TASK_AFFINITY=0x7FFFFFFF
CONFIG_PPP_SUPPORT=

#
# ICMP
#
CONFIG_LWIP_MULTICAST_PING=
CONFIG_LWIP_BROADCAST_PING=

#
# LWIP RAW API
#
CONFIG_LWIP_MAX_RAW_PCBS=16

#
# mbedTLS
#
CONFIG_MBEDTLS_INTERNAL_MEM_ALLOC=y
CONFIG_MBEDTLS_DEFAULT_MEM_ALLOC=
CONFIG_MBEDTLS_CUSTOM_MEM_ALLOC=
CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN=16384
CONFIG_MBEDTLS_ASYMMETRIC_CONTENT_LEN=
CONFIG_MBEDTLS_DEBUG=
CONFIG_MBEDTLS_HARDWARE_AES=y
CONFIG_MBEDTLS_HARDWARE_MPI=
CONFIG_MBEDTLS_HARDWARE_SHA=
CONFIG_MBEDTLS_HAVE_TIME=y
CONFIG_MBEDTLS_HAVE_TIME_DATE=
CONFIG_MBEDTLS_TLS_SERVER_AND_CLIENT=y
CONFIG_MBEDTLS_TLS_SERVER_ONLY=
CONFIG_MBEDTLS_TLS_CLIENT_ONLY=
CONFIG_MBEDTLS_TLS_DISABLED=
CONFIG_MBEDTLS_TLS_SERVER=y
CONFIG_MBEDTLS_TLS_CLIENT=y
CONFIG_MBEDTLS_TLS_ENABLED=y

#
# TLS Key Exchange Methods
#
CONFIG_MBEDTLS_PSK_MODES=
CONFIG_MBEDTLS_KEY_EXCHANGE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_DHE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ELLIPTIC_CURVE=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_RSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA=y
CONFIG_MBEDTLS_KEY_EXCHANGE_ECDH_RSA=y
CONFIG_MBEDTLS_SSL_RENEGOTIATION=y
CONFIG_MBEDTLS_SSL_PROTO_SSL3=
CONFIG_MBEDTLS_SSL_PROTO_TLS1=y
CONFIG_MBEDTLS_SSL_PROTO_TLS1_1=y
CONFIG_MBEDTLS_SSL_PROTO_TLS1_2=y
CONFIG_MBEDTLS_SSL_PROTO_DTLS=
CONFIG_MBEDTLS_SSL_ALPN=y
CONFIG_MBEDTLS_SSL_SESSION_TICKETS=y

#
# Symmetric Ciphers
#
CONFIG_MBEDTLS_AES_C=y
CONFIG_MBEDTLS_CAMELLIA_C=
CONFIG_MBEDTLS_DES_C=
CONFIG_MBEDTLS_RC4_DISABLED=y
CONFIG_MBEDTLS_RC4_ENABLED_NO_DEFAULT=
CONFIG_MBEDTLS_RC4_ENABLED=
CONFIG_MBEDTLS_BLOWFISH_C=
CONFIG_MBEDTLS_XTEA_C=
CONFIG_MBEDTLS_CCM_C=y
CONFIG_MBEDTLS_GCM_C=y
CONFIG_MBEDTLS_RIPEMD160_C=

#
# Certificates
#
CONFIG_MBEDTLS_PEM_PARSE_C=y
CONFIG_MBEDTLS_PEM_WRITE_C=y
CONFIG_MBEDTLS_X509_CRL_PARSE_C=y
CONFIG_MBEDTLS_X509_CSR_PARSE_C=y
CONFIG_MBEDTLS_ECP_C=y
CONFIG_MBEDTLS_ECDH_C=y
CONFIG_MBEDTLS_ECDSA_C=y
CONFIG_MBEDTLS_ECP_DP_SECP192R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP224R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP256R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP384R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP521R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP192K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP224K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_SECP256K1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP256R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP384R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_BP512R1_ENABLED=y
CONFIG_MBEDTLS_ECP_DP_CURVE25519_ENABLED=y
CONFIG_MBEDTLS_ECP_NIST_OPTIM=y

#
# MDF Mcommon
#
CONFIG_MDF_TASK_DEFAULT_PRIOTY=6
CONFIG_MDF_TASK_PINNED_TO_CORE=0
CONFIG_MDF_MEM_DEBUG=y
CONFIG_MDF_ERR_TO_NAME_LOOKUP=y
CONFIG_MDF_LOG_LEVEL_NONE=
CONFIG_MDF_LOG_LEVEL_ERROR=
CONFIG_MDF_LOG_LEVEL_WARN=
CONFIG_MDF_LOG_LEVEL_INFO=
CONFIG_MDF_LOG_LEVEL_DEBUG=y
CONFIG_MDF_LOG_LEVEL_VERBOSE=
CONFIG_MDF_LOG_LEVEL=4

#
# MDF Mconfig
#
CONFIG_MCONFIG_WHITELIST_ENABLE=y
CONFIG_MCONFIG_WHITELIST_SECURITY_ENABLE=
CONFIG_MCONFIG_CHAIN_LMK="lmk1234567890123"

#
# mDNS
#
CONFIG_MDNS_MAX_SERVICES=10

#
# MDF Mespnow
#
CONFIG_MESPNOW_RETRANSMIT_NUM=3
CONFIG_MESPNOW_DEFAULT_PMK="pmk1234567890123"
CONFIG_MESPNOW_LOG_LEVEL=2

#
# ESP-MQTT Configurations
#
CONFIG_MQTT_PROTOCOL_311=y
CONFIG_MQTT_TRANSPORT_SSL=y
CONFIG_MQTT_TRANSPORT_WEBSOCKET=y
CONFIG_MQTT_TRANSPORT_WEBSOCKET_SECURE=y
CONFIG_MQTT_USE_CUSTOM_CONFIG=
CONFIG_MQTT_TASK_CORE_SELECTION_ENABLED=
CONFIG_MQTT_CUSTOM_OUTBOX=

#
# MDF Mupgrade
#
CONFIG_MUPGRADE_RETRY_COUNT=10
CONFIG_MUPGRADE_WAIT_RESPONSE_TIMEOUT=3000
CONFIG_MUPGRADE_STATUS_REPORT_INTERVAL=10
CONFIG_MUPGRADE_FIRMWARE_CHECK=
CONFIG_MUPGRADE_VERSION_FALLBACK_RESTART=y
CONFIG_MUPGRADE_RESTART_COUNT=10
CONFIG_MUPGRADE_RESTART_TIMEOUT=5000
CONFIG_MUPGRADE_VERSION_FALLBACK_FACTORY=y

#
# MDF Mwifi
#

#
# Root config
#
CONFIG_MWIFI_VOTE_PERCENTAGE=90
CONFIG_MWIFI_VOTE_MAX_COUNT=15
CONFIG_MWIFI_BACKOFF_RSSI=-78
CONFIG_MWIFI_SCAN_MINI_COUNT=10
CONFIG_MWIFI_ROOT_HEALING_MS=6000
CONFIG_MWIFI_ROOT_CONFLICTS_ENABLE=

#
# Capacity config
#
CONFIG_MWIFI_CAPACITY_NUM=256
CONFIG_MWIFI_MAX_LAYER=16
CONFIG_MWIFI_MAX_CONNECTION=6

#
# Stability config
#
CONFIG_MWIFI_ASSOC_EXPIRE_MS=30000
CONFIG_MWIFI_BEACON_INTERVAL_MS=100
CONFIG_MWIFI_PASSIVE_SCAN_MS=300
CONFIG_MWIFI_MONITOR_DURATION_MS=60000
CONFIG_MWIFI_CNX_RSSI=-120
CONFIG_MWIFI_SELECT_RSSI=-78
CONFIG_MWIFI_SWITCH_RSSI=-78
CONFIG_MWIFI_ATTEMPT_COUNT=60
CONFIG_MWIFI_MONITOR_IE_COUNT=10

#
# Transmission config
#
CONFIG_MWIFI_XON_QSIZE=64
CONFIG_MWIFI_RETRANSMIT_ENABLE=y
CONFIG_MWIFI_DATA_DROP_ENABLE=y

#
# NVS
#

#
# OpenSSL
#
CONFIG_OPENSSL_DEBUG=
CONFIG_OPENSSL_ASSERT_DO_NOTHING=y
CONFIG_OPENSSL_ASSERT_EXIT=

#
# PThreads
#
CONFIG_ESP32_PTHREAD_TASK_PRIO_DEFAULT=5
CONFIG_ESP32_PTHREAD_TASK_STACK_SIZE_DEFAULT=3072
CONFIG_PTHREAD_STACK_MIN=768
CONFIG_ESP32_PTHREAD_TASK_CORE_DEFAULT=-1
CONFIG_ESP32_PTHREAD_TASK_NAME_DEFAULT="pthread"

#
# SPI Flash driver
#
CONFIG_SPI_FLASH_VERIFY_WRITE=
CONFIG_SPI_FLASH_ENABLE_COUNTERS=
CONFIG_SPI_FLASH_ROM_DRIVER_PATCH=y
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ABORTS=y
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_FAILS=
CONFIG_SPI_FLASH_WRITING_DANGEROUS_REGIONS_ALLOWED=

#
# SPIFFS Configuration
#
CONFIG_SPIFFS_MAX_PARTITIONS=3

#
# SPIFFS Cache Configuration
#
CONFIG_SPIFFS_CACHE=y
CONFIG_SPIFFS_CACHE_WR=y
CONFIG_SPIFFS_CACHE_STATS=
CONFIG_SPIFFS_PAGE_CHECK=y
CONFIG_SPIFFS_GC_MAX_RUNS=10
CONFIG_SPIFFS_GC_STATS=
CONFIG_SPIFFS_PAGE_SIZE=256
CONFIG_SPIFFS_OBJ_NAME_LEN=32
CONFIG_SPIFFS_USE_MAGIC=y
CONFIG_SPIFFS_USE_MAGIC_LENGTH=y
CONFIG_SPIFFS_META_LENGTH=4
CONFIG_SPIFFS_USE_MTIME=y

#
# Debug Configuration
#
CONFIG_SPIFFS_DBG=
CONFIG_SPIFFS_API_DBG=
CONFIG_SPIFFS_GC_DBG=
CONFIG_SPIFFS_CACHE_DBG=
CONFIG_SPIFFS_CHECK_DBG=
CONFIG_SPIFFS_TEST_VISUALISATION=

#
# TCP/IP Adapter
#
CONFIG_IP_LOST_TIMER_INTERVAL=120
CONFIG_TCPIP_LWIP=y

#
# Unity unit testing library
#
CONFIG_UNITY_ENABLE_FLOAT=y
CONFIG_UNITY_ENABLE_DOUBLE=y
CONFIG_UNITY_ENABLE_COLOR=
CONFIG_UNITY_ENABLE_IDF_TEST_RUNNER=y
CONFIG_UNITY_ENABLE_FIXTURE=

#
# Virtual file system
#
CONFIG_SUPPRESS_SELECT_DEBUG_OUTPUT=y
CONFIG_SUPPORT_TERMIOS=y

#
# Wear Levelling
#
CONFIG_WL_SECTOR_SIZE_512=
CONFIG_WL_SECTOR_SIZE_4096=y
CONFIG_WL_SECTOR_SIZE=4096
raulMrello commented 5 years ago

Overview

I found a possible solution, but as I've only tested it using mwifi, I prefer to leave the issue already opened.

Description

In file mwifi.h I've replaced all occurrences of

__builtin_types_compatible_p(typeof(data)

By this one:

cxx__builtin_types_compatible_p(data

And I've declared that new macro, as will be shown later. As this file is going to be compiled as C++ code, I've done these changes:

Previously:

#ifdef __cplusplus
extern "C" {
#endif /**< _cplusplus */

Now:

#ifdef __cplusplus

/* -----------------------------------------------------------------------------------
 * Next templates makes gnu builtin: __builtin_types_compatible_p
 * compatible with C++ compilation
 */
template<typename T, typename U>
struct is_same {
    static const int value = 0;
};

template<typename T>
struct is_same<T, T> {
    static const int value = 1;
};

template<typename T, typename U>
int cxx_is_compatible() { return is_same<T, U>::value; }

/* -----------------------------------------------------------------------------------
 */

extern "C" {
#endif /**< _cplusplus */

/* Macro adaptation for C++ compilation, using previous C++ templates for type checking */
#define cxx__builtin_types_compatible_p(data, type)  cxx_is_compatible<decltype(data),type>()

mwifi.h File content:

This is the content of mwifi.h file solving this issue. Nevertheless, other ESP-MDF files should modified accordingly if C++ compilation is also required.

/*
 * ESPRESSIF MIT License
 *
 * Copyright (c) 2018 <ESPRESSIF SYSTEMS (SHANGHAI) PTE LTD>
 *
 * Permission is hereby granted for use on all ESPRESSIF SYSTEMS products, in which case,
 * it is free of charge, to any person obtaining a copy of this software and associated
 * documentation files (the "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the Software is furnished
 * to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all copies or
 * substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */

#ifndef __MWIFI_H__
#define __MWIFI_H__

#include "mdf_common.h"
#include "esp_mesh.h"
#include "esp_mesh_internal.h"

#ifdef __cplusplus

/* -----------------------------------------------------------------------------------
 * Next templates makes gnu builtin: __builtin_types_compatible_p
 * compatible with C++ compilation
 */
template<typename T, typename U>
struct is_same {
    static const int value = 0;
};

template<typename T>
struct is_same<T, T> {
    static const int value = 1;
};

template<typename T, typename U>
int cxx_is_compatible() { return is_same<T, U>::value; }

/* -----------------------------------------------------------------------------------
 */

extern "C" {
#endif /**< _cplusplus */

/* Macro adaptation for C++ compilation, using previous C++ templates for type checking */
#define cxx__builtin_types_compatible_p(data, type)  cxx_is_compatible<decltype(data),type>()

#define MWIFI_PAYLOAD_LEN       (1456) /**< Max payload size(in bytes) */

#define MWIFI_ADDR_LEN          (6) /**< Length of MAC address */
#define MWIFI_ADDR_NONE         {0x0, 0x0, 0x0, 0x0, 0x0, 0x0}
#define MWIFI_ADDR_ROOT         {0xFF, 0x0, 0x0, 0x1, 0x0, 0x0}
#define MWIFI_ADDR_ANY          {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} /**< All node in the mesh network */
#define MWIFI_ADDR_BROADCAST    {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0XFE} /**< Other node except the root */
#define MWIFI_ADDR_IS_EMPTY(addr) (((addr)[0] | (addr)[1] | (addr)[2] | (addr)[3] | (addr)[4] | (addr)[5]) == 0x0)
#define MWIFI_ADDR_IS_ANY(addr)   (((addr)[0] & (addr)[1] & (addr)[2] & (addr)[3] & (addr)[4] & (addr)[5]) == 0xFF)
#define MWIFI_ADDR_IS_BROADCAST(addr) (((addr)[0] & (addr)[1] & (addr)[2] & (addr)[3] & (addr)[4]) == 0xFF && (addr)[5] == 0xFE)

/**
 * @brief Mwifi error code definition
 */
#define MDF_ERR_MWIFI_NOT_INIT                  (MDF_ERR_MWIFI_BASE + 1)  /**< Mwifi isn't initialized */
#define MDF_ERR_MWIFI_INITED                    (MDF_ERR_MWIFI_BASE + 2)  /**< Mwifi has been initialized */
#define MDF_ERR_MWIFI_NOT_START                 (MDF_ERR_MWIFI_BASE + 3)  /**< Mwifi isn't started */
#define MDF_ERR_MWIFI_ARGUMENT                  (MDF_ERR_MWIFI_BASE + 4)  /**< Illegal argument */
#define MDF_ERR_MWIFI_EXCEED_PAYLOAD            (MDF_ERR_MWIFI_BASE + 5)  /**< Packet size exceeds payload */
#define MDF_ERR_MWIFI_TIMEOUT                   (MDF_ERR_MWIFI_BASE + 6)  /**< Timeout */
#define MDF_ERR_MWIFI_DISCONNECTED              (MDF_ERR_MWIFI_BASE + 7)  /**< Disconnected with parent on station interface */
#define MDF_ERR_MWIFI_NO_CONFIG                 (MDF_ERR_MWIFI_BASE + 8)  /**< Router not configured */
#define MDF_ERR_MWIFI_NO_FOUND                  (MDF_ERR_MWIFI_BASE + 9)  /**< Routes or devices not found */

/**
 * @brief enumerated list of Mwifi event id
 */
#define MDF_EVENT_MWIFI_STARTED                 (MESH_EVENT_STARTED)            /**< Mwifi is started */
#define MDF_EVENT_MWIFI_STOPPED                 (MESH_EVENT_STOPPED)            /**< Mwifi is stopped */
#define MDF_EVENT_MWIFI_CHANNEL_SWITCH          (MESH_EVENT_CHANNEL_SWITCH)     /**< Channel switch */
#define MDF_EVENT_MWIFI_CHILD_CONNECTED         (MESH_EVENT_CHILD_CONNECTED)    /**< A child is connected on softAP interface */
#define MDF_EVENT_MWIFI_CHILD_DISCONNECTED      (MESH_EVENT_CHILD_DISCONNECTED) /**< A child is disconnected on softAP interface */
#define MDF_EVENT_MWIFI_ROUTING_TABLE_ADD       (MESH_EVENT_ROUTING_TABLE_ADD)  /**< Routing table is changed by adding newly joined children */
#define MDF_EVENT_MWIFI_ROUTING_TABLE_REMOVE    (MESH_EVENT_ROUTING_TABLE_REMOVE) /**< Routing table is changed by removing leave children */
#define MDF_EVENT_MWIFI_PARENT_CONNECTED        (MESH_EVENT_PARENT_CONNECTED)   /**< Parent is connected on station interface */
#define MDF_EVENT_MWIFI_PARENT_DISCONNECTED     (MESH_EVENT_PARENT_DISCONNECTED) /**< Parent is disconnected on station interface */
#define MDF_EVENT_MWIFI_NO_PARENT_FOUND         (MESH_EVENT_NO_PARENT_FOUND)    /**< No parent found */
#define MDF_EVENT_MWIFI_LAYER_CHANGE            (MESH_EVENT_LAYER_CHANGE)       /**< Layer changes over the Mwifi network */
#define MDF_EVENT_MWIFI_TODS_STATE              (MESH_EVENT_TODS_STATE)         /**< State represents if root is able to access external IP network */
#define MDF_EVENT_MWIFI_VOTE_STARTED            (MESH_EVENT_VOTE_STARTED)       /**< The process of voting a new root is started either by children or by root */
#define MDF_EVENT_MWIFI_VOTE_STOPPED            (MESH_EVENT_VOTE_STOPPED)       /**< The process of voting a new root is stopped */
#define MDF_EVENT_MWIFI_ROOT_ADDRESS            (MESH_EVENT_ROOT_ADDRESS)       /**< The root address is obtained. It is posted by Mwifi stack automatically. */
#define MDF_EVENT_MWIFI_ROOT_SWITCH_REQ         (MESH_EVENT_ROOT_SWITCH_REQ)    /**< Root switch request sent from a new voted root candidate */
#define MDF_EVENT_MWIFI_ROOT_SWITCH_ACK         (MESH_EVENT_ROOT_SWITCH_ACK)    /**< Root switch acknowledgment responds the above request sent from current root */
#define MDF_EVENT_MWIFI_ROOT_GOT_IP             (MESH_EVENT_ROOT_GOT_IP)        /**< Root obtains the IP address. It is posted by LwIP stack automatically */
#define MDF_EVENT_MWIFI_ROOT_LOST_IP            (MESH_EVENT_ROOT_LOST_IP)       /**< Root loses the IP address. It is posted by LwIP stack automatically */
#define MDF_EVENT_MWIFI_ROOT_ASKED_YIELD        (MESH_EVENT_ROOT_ASKED_YIELD)   /**< Root is asked yield by a more powerful existing root. */

#define MDF_EVENT_MWIFI_SCAN_DONE               (MESH_EVENT_SCAN_DONE)          /**< if self-organized networking is disabled */
#define MDF_EVENT_MWIFI_NETWORK_STATE           (MESH_EVENT_NETWORK_STATE)      /**< network state, such as whether current mesh network has a root. */
#define MDF_EVENT_MWIFI_STOP_RECONNECTION       (MESH_EVENT_STOP_RECONNECTION)  /**< the root stops reconnecting to the router and non-root devices stop reconnecting to their parents. */
#define MDF_EVENT_MWIFI_FIND_NETWORK            (MESH_EVENT_FIND_NETWORK)       /**< when the channel field in mesh configuration is set to zero, mesh stack will perform a
                                                                                     full channel scan to find a mesh network that can join, and return the channel value
                                                                                     after finding it. */
#define MDF_EVENT_MWIFI_ROUTER_SWITCH           (MESH_EVENT_ROUTER_SWITCH)      /**< if users specify BSSID of the router in mesh configuration, when the root connects to another
                                                                                     router with the same SSID, this event will be posted and the new router information is attached. */

#define MDF_EVENT_MWIFI_CHANNEL_NO_FOUND        (64)                            /**< The router's channel is not set. */

/**
 * @brief  Mwifi initialization configuration
 */
typedef struct {
    /**
     * @brief Mesh root configuration
     */
    uint8_t vote_percentage;    /**< Vote percentage threshold above which the node becoms a root */
    uint8_t vote_max_count;     /**< Max multiple voting each device can have for the self-healing of a MESH network */
    int8_t backoff_rssi;        /**< RSSI threshold below which connections to the root node are not allowed */
    uint8_t scan_min_count;     /**< Minimum scan times before being a root */
    bool root_conflicts_enable; /**< Allow more than one root in one network */
    uint16_t root_healing_ms;   /**< Time lag between the moment a root node is disconnected from the network and the moment
                                     the devices start electing another root node  */

    /**
     * @brief Mesh network capacity configuration
     */
    uint16_t capacity_num;      /**< Network capacity, defining max number of devices allowed in the MESH network */
    uint8_t max_layer;          /**< Max number of allowed layers */
    uint8_t max_connection;     /**< Max number of MESH softAP connections */

    /**
     * @brief Mesh network stability configuration
     */
    uint16_t assoc_expire_ms;   /**< Period of time after which a MESH softAP breaks its association with inactive leaf nodes */
    uint16_t beacon_interval_ms;/**< Mesh softAP beacon interval */
    uint16_t passive_scan_ms;   /**< Mesh station passive scan duration */
    uint16_t monitor_duration_ms; /**<  Period (ms) for monitoring the parent's RSSI. If the signal stays weak throughout the
                                        period, the node will find another parent offering more stable connection */
    int8_t cnx_rssi;            /**< RSSI threshold above which the connection with a parent is considered strong */
    int8_t select_rssi;         /**< RSSI threshold for parent selection. Its value should be greater than switch_rssi */
    int8_t switch_rssi;         /**< RSSI threshold below which a node selects a parent with better RSSI */
    uint8_t attempt_count;      /**< Parent selection fail times, if the scan times reach this value,
                                     device will disconnect with associated children and join self-healing */
    uint8_t monitor_ie_count;   /**< Allowed number of changes a parent node can introduce into its information element (IE),
                                     before the leaf nodes must update their own IEs accordingly */

    /**
     * @brief Mesh network data transmission configuration
     */
    uint8_t xon_qsize;          /**< Number of MESH buffer queues */
    bool retransmit_enable;     /**< Enable a source node to retransmit data to the node from which it failed to receive ACK */
    bool data_drop_enable;      /**< If a root is changed, enable the new root to drop the previous packet */
} mwifi_init_config_t;

#ifndef CONFIG_MWIFI_ROOT_CONFLICTS_ENABLE
#define CONFIG_MWIFI_ROOT_CONFLICTS_ENABLE false
#endif /**< CONFIG_MWIFI_ROOT_CONFLICTS_ENABLE */

#ifndef CONFIG_MWIFI_RETRANSMIT_ENABLE
#define CONFIG_MWIFI_RETRANSMIT_ENABLE false
#endif /**< CONFIG_MWIFI_RETRANSMIT_ENABLE */

#define MWIFI_INIT_CONFIG_DEFAULT() { \
        /**.vote_percentage       =*/ CONFIG_MWIFI_VOTE_PERCENTAGE, \
        /**.vote_max_count        =*/ CONFIG_MWIFI_VOTE_MAX_COUNT, \
        /**.backoff_rssi          =*/ CONFIG_MWIFI_BACKOFF_RSSI, \
        /**.scan_min_count        =*/ CONFIG_MWIFI_SCAN_MINI_COUNT, \
        /**.root_conflicts_enable =*/ CONFIG_MWIFI_ROOT_CONFLICTS_ENABLE, \
        /**.root_healing_ms       =*/ CONFIG_MWIFI_ROOT_HEALING_MS, \
        /**.capacity_num          =*/ CONFIG_MWIFI_CAPACITY_NUM, \
        /**.max_layer             =*/ CONFIG_MWIFI_MAX_LAYER, \
        /**.max_connection        =*/ CONFIG_MWIFI_MAX_CONNECTION, \
        /**.assoc_expire_ms       =*/ CONFIG_MWIFI_ASSOC_EXPIRE_MS, \
        /**.beacon_interval_ms    =*/ CONFIG_MWIFI_BEACON_INTERVAL_MS, \
        /**.passive_scan_ms       =*/ CONFIG_MWIFI_PASSIVE_SCAN_MS, \
        /**.monitor_duration_ms   =*/ CONFIG_MWIFI_MONITOR_DURATION_MS, \
        /**.cnx_rssi              =*/ CONFIG_MWIFI_CNX_RSSI, \
        /**.select_rssi           =*/ CONFIG_MWIFI_SELECT_RSSI, \
        /**.switch_rssi           =*/ CONFIG_MWIFI_SWITCH_RSSI, \
        /**.attempt_count         =*/ CONFIG_MWIFI_ATTEMPT_COUNT, \
        /**.monitor_ie_count      =*/ CONFIG_MWIFI_MONITOR_IE_COUNT, \
        /**.xon_qsize             =*/ CONFIG_MWIFI_XON_QSIZE, \
        /**.retransmit_enable     =*/ CONFIG_MWIFI_RETRANSMIT_ENABLE, \
        /**.data_drop_enable      =*/ CONFIG_MWIFI_DATA_DROP_ENABLE, \
    };

/**
 * @brief Mwifi AP configuration
 */
typedef struct {
    /**
     * @brief  Information about the router connected to the root.
     *         This item does not need to be set in the routerless scheme.
     */
    char router_ssid[32];     /**< SSID of the router */
    char router_password[64]; /**< Password of router */
    uint8_t router_bssid[6];  /**< BSSID, if this value is specified, users should also specify "router_switch_disable" */

    /**
     * @brief  Information about the mesh internal connected.
     */
    uint8_t mesh_id[6];     /**< Mesh network ID. Nodes sharing the same MESH ID can communicate with one another */
    char mesh_password[64]; /**< Password for secure communication between devices in a MESH network */
    uint8_t mesh_type;      /**< Only MESH_IDLE, MESH_ROOT, MESH_NODE and MESH_LEAF device types are supported.
                                 Routerless solutions must be configured as MESH_ROOT or MESH_NODE
                                 MESH_IDLE: The node type is selected by MESH according to the network conditions.
                                 MESH_ROOT: The Device is the root node
                                 MESH_NODE: The device is a non-root node and contains intermediate nodes and leaf nodes.
                                 MESH_LEAF: The device is a leaf node, closes the softap, and is used in a low-power solutions.*/

    uint8_t channel;        /**< Channel, mesh and router will be on the same channel */
    uint8_t channel_switch_disable; /**< If this value is not set, when "attempt" (mwifi_init_config_t) times is reached, device will change to
                                         a full channel scan for a network that could join. */
    uint8_t router_switch_disable;  /**< If the BSSID is specified and this value is not also set, when the router of this specified BSSID
                                         fails to be found after "attempt" (mwifi_init_config_t) times, the whole network is allowed to switch
                                         to another router with the same SSID. The new router might also be on a different channel.
                                         There is a risk that if the password is different between the new switched router and the previous
                                         one, the mesh network could be established but the root will never connect to the new switched router. */
} mwifi_config_t;

/**
 * @brief Mesh network internal data transmission method.
 */
enum mwifi_communication_method {
    MWIFI_COMMUNICATE_UNICAST,   /**< Send data by unicast. */
    MWIFI_COMMUNICATE_MULTICAST, /**< Send data by multicast. */
    MWIFI_COMMUNICATE_BROADCAST, /**< Send data by broadcast. */
};

/**
 * @brief Mwifi packet type
 */
typedef struct {
    bool compression    : 1; /**< Enable data compression. If the data sent is json format or string,
                                 use data compression to increase the data transmission rate. */
    bool upgrade        : 1; /**< Upgrade packet flag */
    uint8_t communicate : 2; /**< Mesh data communication method, There are three types:
                                  MWIFI_COMMUNICATE_UNICAST, MWIFI_COMMUNICATE_MULTICAST, MWIFI_COMMUNICATE_BROADCAST*/
    uint8_t reserved    : 2; /**< Bit: 4..5 reserved */
    uint8_t protocol    : 2; /**< Type of transmitted application protocol */
    uint32_t custom;         /**< Type of transmitted application data */
} __attribute__((packed)) mwifi_data_type_t;

/**
 * @brief Buffer space when reading data
 */
typedef enum {
    MLINK_DATA_MEMORY_MALLOC_INTERNAL = 1,  /**< Buffer space is requested by internal when reading data */
    MLINK_DATA_MEMORY_MALLOC_EXTERNAL = 2,  /**< Buffer space is requested by external when reading data */
} mlink_data_memory_t;

/**
 * @brief  Get mesh networking IE.
 *
 * @param  mesh_assoc pointer mesh networking IE.
 *
 * @return
 *    - ESP_OK
 *    - ESP_FAIL
 */
esp_err_t esp_wifi_vnd_mesh_get(mesh_assoc_t *mesh_assoc);

/**
 * @brief  Mwifi initialization
 *
 * @attention 1. This API should be called after WiFi is started.
 * @attention 2. This API must be called before all other Mwifi API can be called.
 * @attention 3. Always use WIFI_INIT_CONFIG_DEFAULT macro to init the config to default values,
 *               this can guarantee all the fields got correct value when more fields
 *               are added into wifi_init_config_t in future release. If you want
 *               to set your owner initial values, overwrite the default values
 *               which are set by WIFI_INIT_CONFIG_DEFAULT.
 *
 * @param  config  Mwifi initialization configuration.
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_INIT
 *    - MDF_ERR_MWIFI_INITED
 */
mdf_err_t mwifi_init(mwifi_init_config_t *config);

/**
 * @brief  Deinit mwifi
 *         Free all resource allocated in mwifi_init and stop Mwifi task.
 *
 * @attention This API should be called if you want to remove Mwifi from the system.
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_INIT
 */
mdf_err_t mwifi_deinit(void);

/**
 * @brief     Set Mwifi configuration
 *
 * @attention This API shall be called between esp_mesh_init() and esp_mesh_start().
 *
 * @param     init_config Use MWIFI_INIT_CONFIG_DEFAULT() to initialize the default values.
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_ARGUMENT
 */
mdf_err_t mwifi_set_init_config(mwifi_init_config_t *init_config);

/**
 * @brief  Get Mwifi init configuration.
 *
 * @param  init_config pointer to Mwifi init configuration.
 *
 * @return             [description]
 */
mdf_err_t mwifi_get_init_config(mwifi_init_config_t *init_config);

/**
 * @brief  Set the configuration of the AP
 *
 * @attention This API shall be called between esp_mesh_init() and esp_mesh_start().
 *
 * @param  config pointer to AP configuration
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_ARGUMENT
 */
mdf_err_t mwifi_set_config(mwifi_config_t *config);

/**
 * @brief  Get the configuration of the AP
 *
 * @param  config pointer to AP configuration
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_ARGUMENT
 */
mdf_err_t mwifi_get_config(mwifi_config_t *config);

/**
 * @brief  Start Mwifi according to current configuration
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_INIT
 */
mdf_err_t mwifi_start(void);

/**
 * @brief  Stop mwifi
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_INIT
 */
mdf_err_t mwifi_stop(void);

/**
 * @brief  restart mwifi
 *
 * @attention This API should be called when the Mwifi configuration is modified.
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_INIT
 */
mdf_err_t mwifi_restart();

/**
 * @brief  wether wifi_mesh is running
 *
 * @return
 *    - true
 *    - flase
 */
bool mwifi_is_started(void);

/**
 * @brief  wether wifi_mesh is disconnected
 *
 * @return
 *    - true
 *    - flase
 */
bool mwifi_is_connected(void);

/**
 * @brief  Send a packet to any node in the mesh network.
 *
 * @attention 1. If data encryption is enabled, you must ensure that the task that
 *               calls this function is greater than 8KB.
 *            2. When sending data to the root node, if the destination address
 *               is NULL, the root node receives it using mwifi_root_read(). If
 *               the destination address is the mac address of the root node, the
 *               root node receives it using mwifi_read()
 *
 * @param  dest_addrs The address of the final destination of the packet
 *                    If the packet is to the root and "dest_addr" parameter is NULL
 * @param  data_type  The type of the data
 *                    If the default configuration is used, this parameter is NULL
 * @param  data       Pointer to a sending wifi mesh packet
 * @param  size       The length of the data
 * @param  block      Whether to block waiting for data transmission results
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_START
 */
mdf_err_t mwifi_write(const uint8_t *dest_addrs, const mwifi_data_type_t *data_type,
                      const void *data, size_t size, bool block);

/**
 * @brief  Receive a packet targeted to self over the mesh network
 *
 * @param  src_addr    The address of the original source of the packet
 * @param  data_type   The type of the data
 * @param  data        Pointer to the received mesh packet
 *                     To apply for buffer space externally, set the type of the data parameter to be (char *) or (uint8_t *)
 *                     To apply for buffer space internally, set the type of the data parameter to be (char **) or (uint8_t **)
 * @param  size        A non-zero pointer to the variable holding the length of out_value.
 *                     In case out_value is not zero, will be set to the actual length of the value written.
 * @param  wait_ticks  Wait time if a packet isn't immediately available
 * @param  type        Buffer space when reading data
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_START
 *    - ESP_ERR_MESH_ARGUMENT
 *    - ESP_ERR_MESH_NOT_START
 *    - ESP_ERR_MESH_TIMEOUT
 *    - ESP_ERR_MESH_DISCARD
 */
mdf_err_t __mwifi_read(uint8_t *src_addr, mwifi_data_type_t *data_type, void *data, size_t *size, TickType_t wait_ticks, mlink_data_memory_t type);
#define mwifi_read(src_addr, data_type, data, size, wait_ticks) \
    __mwifi_read(src_addr, data_type, (void *)data, size, wait_ticks, \
                 cxx__builtin_types_compatible_p(data, char *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                 + cxx__builtin_types_compatible_p(data, uint8_t *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                 + cxx__builtin_types_compatible_p(data, char **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL \
                 + cxx__builtin_types_compatible_p(data, uint8_t **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL)

/**
 * @brief  The root sends a packet to the device in the mesh.
 *
 * @attention 1. If data encryption is enabled, you must ensure that the task that
 *               calls this function is greater than 8KB
 *            2. This API is only used at the root node
 *            3. Can send data to multiple devices at the same time
 *            4. Packets are only transmitted down
 *
 * @param  dest_addrs     The address of the final destination of the packet
 * @param  dest_addrs_num Number of destination addresses
 * @param  data_type      The type of the data
 * @param  data           Pointer to a sending wifi mesh packet
 * @param  size           The length of the data
 * @param  block          Whether to block waiting for data transmission results
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_START
 *    - ESP_ERR_MESH_ARGUMENT
 *    - ESP_ERR_MESH_NOT_START
 *    - ESP_ERR_MESH_DISCONNECTED
 *    - ESP_ERR_MESH_OPT_UNKNOWN
 *    - ESP_ERR_MESH_EXCEED_MTU
 *    - ESP_ERR_MESH_NO_MEMORY
 *    - ESP_ERR_MESH_TIMEOUT
 *    - ESP_ERR_MESH_QUEUE_FULL
 *    - ESP_ERR_MESH_NO_ROUTE_FOUND
 *    - ESP_ERR_MESH_DISCARD
 */
mdf_err_t mwifi_root_write(const uint8_t *dest_addrs, size_t dest_addrs_num,
                           const mwifi_data_type_t *data_type, const void *data,
                           size_t size, bool block);

/**
 * @brief  receive a packet targeted to external IP network
 *         root uses this API to receive packets destined to external IP network
 *         root forwards the received packets to the final destination via socket.
 *         This API is only used at the root node
 *
 * @attention This API is only used at the root node
 *
 * @param  src_addr    the address of the original source of the packet
 * @param  data_type   the type of the data
 * @param  data        Pointer to the received mesh packet
 *                     To apply for buffer space externally, set the type of the data parameter to be (char *) or (uint8_t *)
 *                     To apply for buffer space internally, set the type of the data parameter to be (char **) or (uint8_t **)
 * @param  size        The length of the data
 * @param  wait_ticks  wait time if a packet isn't immediately available(0:no wait, portMAX_DELAY:wait forever)
 * @param  type        Buffer space when reading data
 *
 * @return
 *    - MDF_OK
 *    - MDF_ERR_MWIFI_NOT_START
 *    - ESP_ERR_MESH_ARGUMENT
 *    - ESP_ERR_MESH_NOT_START
 *    - ESP_ERR_MESH_TIMEOUT
 *    - ESP_ERR_MESH_DISCARD
 */
mdf_err_t __mwifi_root_read(uint8_t *src_addr, mwifi_data_type_t *data_type,
                            void *data, size_t *size, TickType_t wait_ticks, mlink_data_memory_t type);
#define mwifi_root_read(src_addr, data_type, data, size, wait_ticks) \
    __mwifi_root_read(src_addr, data_type, (void *)data, size, wait_ticks, \
                      cxx__builtin_types_compatible_p(data, char *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                      + cxx__builtin_types_compatible_p(data, uint8_t *) * MLINK_DATA_MEMORY_MALLOC_EXTERNAL \
                      + cxx__builtin_types_compatible_p(data, char **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL \
                      + cxx__builtin_types_compatible_p(data, uint8_t **) * MLINK_DATA_MEMORY_MALLOC_INTERNAL)

#ifdef __cplusplus
}
#endif /**< _cplusplus */
#endif /**< __MWIFI_H__ */
zhanzhaocheng commented 5 years ago

Thank you very much, this change can solve the problem of C++ compilation error perfectly. I have merged your changes into the master branch.

Elijahg commented 5 years ago

Unfortunately @raulMrello's fixes don't seem to work for me. When following his instructions, I get a boatload of errors.

/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'mesh_assoc_t::vote_rssi' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'mesh_assoc_t::vote_ttl' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'mesh_assoc_t::votes' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'mesh_assoc_t::my_votes' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'mesh_assoc_t::reason' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'mesh_assoc_t::child' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:276:43: warning: missing initializer for member 'mesh_assoc_t::toDS' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:277:43: warning: missing initializer for member 'wifi_sta_info_t::rssi' [-Wmissing-field-initializers]
     wifi_sta_list_t wifi_sta_list   = {0x0};
                                           ^
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:277:43: warning: missing initializer for member 'wifi_sta_info_t::phy_11b' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:277:43: warning: missing initializer for member 'wifi_sta_info_t::phy_11g' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:277:43: warning: missing initializer for member 'wifi_sta_info_t::phy_11n' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:277:43: warning: missing initializer for member 'wifi_sta_info_t::phy_lr' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:277:43: warning: missing initializer for member 'wifi_sta_info_t::reserved' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:277:43: warning: missing initializer for member 'wifi_sta_list_t::num' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp: In function 'void app_main()':
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: error: C99 designator 'router_ssid' outside aggregate initializer
     };
     ^
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: error: C99 designator 'router_password' outside aggregate initializer
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: error: C99 designator 'mesh_id' outside aggregate initializer
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: error: C99 designator 'mesh_password' outside aggregate initializer
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: sorry, unimplemented: non-trivial designated initializers not supported
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: sorry, unimplemented: non-trivial designated initializers not supported
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: warning: missing initializer for member 'mwifi_config_t::mesh_password' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: warning: missing initializer for member 'mwifi_config_t::mesh_type' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: warning: missing initializer for member 'mwifi_config_t::channel' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: warning: missing initializer for member 'mwifi_config_t::channel_switch_disable' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:382:5: warning: missing initializer for member 'mwifi_config_t::router_switch_disable' [-Wmissing-field-initializers]
/esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:391:67: warning: invalid conversion from 'int' to 'gpio_num_t' [-fpermissive]
     gpio_set_direction(CONFIG_LED_GPIO_NUM, GPIO_MODE_INPUT_OUTPUT);
                                                                   ^
In file included from /esp/esp-mdf/esp-idf/components/esp32/include/esp_sleep.h:19:0,
                 from /esp/esp-mdf/esp-idf/components/esp32/include/esp_system.h:21,
                 from /esp/esp-mdf/esp-idf/components/freertos/include/freertos/portable.h:126,
                 from /esp/esp-mdf/esp-idf/components/freertos/include/freertos/FreeRTOS.h:105,
                 from /esp/esp-mdf/components/mcommon/include/mdf_common.h:36,
                 from /esp/esp-mdf/examples/function_demo/mwifi/main/mwifi_example.cpp:25:
/esp/esp-mdf/esp-idf/components/driver/include/driver/gpio.h:344:11: note:   initializing argument 1 of 'esp_err_t gpio_set_direction(gpio_num_t, gpio_mode_t)'
 esp_err_t gpio_set_direction(gpio_num_t gpio_num, gpio_mode_t mode);
           ^
make[1]: *** [mwifi_example.o] Error 1

I've been discussing with Leenowell on the ESP32 forum about including the [mcommon / mwifi / mconfig]_example.c in a C++ class in a new .cpp file, but this doesn't allow direct access to the MDF APIs.

Elijahg commented 5 years ago

I've actually found a solution to this - it's rather late here now but I'll update this tomorrow with the fixes.

ESP-LBB commented 5 years ago

Closing as this question appears to be answered. For more info about this issue, please refer to the discussion on BBS MDF