aZholtikov / zh_network

ESP32 ESP-IDF and ESP8266 RTOS SDK component (arduino library for ESP32 family) for ESP-NOW based mesh network.
Apache License 2.0
44 stars 6 forks source link

Support older version of esp-idf #6

Closed Moddingear closed 3 months ago

Moddingear commented 4 months ago

Hello,

Right now this library doesn't support espidf 4.x.x, that is used by Arduino.

Making it compatible with espidf 4.x.x only requires changing

#ifdef CONFIG_IDF_TARGET_ESP8266

by

#if defined(CONFIG_IDF_TARGET_ESP8266) || ESP_IDF_VERSION_MAJOR == 4

Doing so, the library builds without any warnings (Probably because the esp8266 is stuck with espidf4.x.x ?).

That would allow people using Arduino to use the library with espidf WiFi functions. Also, I've read issues #3 and #4

aZholtikov commented 4 months ago

Hi!

Thanks for the corrections.

  1. if defined(CONFIG_IDF_TARGET_ESP8266) || ESP_IDF_VERSION_MAJOR == 4). This is an important addition. It will be accepted.

  2. ESP_LOGE(TAG, ‘ESP-NOW message processing task internal error : at line %d’, LINE). This is an important addition. It will be accepted.
  3. define ESP_EVENT_BASE ZH_NETWORK. This is added only for information for doxygen documentation. This parameter has dependencies in the .c file and cannot be changed. Addition will not be accepted.

  4. ZH_NETWORK_MAX_MESSAGE_SIZE: Changing this parameter in the user's main program code goes against my philosophy. The user should install this component for himself, change ZH_NETWORK_MAX_MESSAGE_SIZE if necessary and use it in all his projects. Changing the parameter in programmes can lead to differences and incompatibilities. The addition will not be accepted.
  5. Moving header files. This is my programming style. Probably not the right one. But all my projects are done this way. The addition will not be accepted.

P.S. Since this repository is a mirror repository on my personal Git server, additions will be made to it, and updated on GitHub. Pull request will be closed with a full merge, but once changes are made to the repository on my Git server it will only be updated as described above. This will happen in a few days. At the moment some changes have been made to the component and it is being tested.

Thank you.