Skip to content

Conversation

@mhaberler
Copy link

not sure this is the proper way, but works for me:

/Users/mah/Ballon/src/BalloonWare/esp32-ble2mqtt/main/mqtt.c: In function 'mqtt_subscribe':
/Users/mah/esp/v5.2.1-git/components/mqtt/esp-mqtt/include/mqtt_client.h:464:84: error: '_Generic' selector of type 'const char *' is not compatible with any association
  464 | #define esp_mqtt_client_subscribe(client_handle, topic_type, qos_or_size) _Generic((topic_type), \
      |                                                                                    ^
/Users/mah/Ballon/src/BalloonWare/esp32-ble2mqtt/main/mqtt.c:165:9: note: in expansion of macro 'esp_mqtt_client_subscribe'
  165 |     if (esp_mqtt_client_subscribe(mqtt_handle, topic, qos) < 0)
      |         ^~~~~~~~~~~~~~~~~~~~~~~~~

not sure this is the proper way, but works for me:

    /Users/mah/Ballon/src/BalloonWare/esp32-ble2mqtt/main/mqtt.c: In function 'mqtt_subscribe':
    /Users/mah/esp/v5.2.1-git/components/mqtt/esp-mqtt/include/mqtt_client.h:464:84: error: '_Generic' selector of type 'const char *' is not compatible with any association
      464 | #define esp_mqtt_client_subscribe(client_handle, topic_type, qos_or_size) _Generic((topic_type), \
          |                                                                                    ^
    /Users/mah/Ballon/src/BalloonWare/esp32-ble2mqtt/main/mqtt.c:165:9: note: in expansion of macro 'esp_mqtt_client_subscribe'
      165 |     if (esp_mqtt_client_subscribe(mqtt_handle, topic, qos) < 0)
          |         ^~~~~~~~~~~~~~~~~~~~~~~~~
@shmuelzon
Copy link
Owner

Hey, there were some additional things that needed handling to fully support ESP-IDF v5.2.1. I've added them in #199.
For what it's worth, your modification for the MQTT API was the same one I opted for :)

@shmuelzon shmuelzon closed this Apr 20, 2024
@mhaberler mhaberler deleted the idf-5.2.1-fix branch April 20, 2024 18:07
@mhaberler
Copy link
Author

mhaberler commented Apr 20, 2024

yeah, had never heard of _Generic() before

appreciated - will give it a spin!

edit: works perfectly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants