I've been trying to implement the Event Loop Library. Posting and registering events using a hardcoded static string works fine.
When the string is dynamic and identical to the base it fails to trigger.
I'm registering an event using:
Code: Select all
esp_event_handler_instance_register("COMMANDBASE1", 0, commandfunction, NULL, NULL);
Code: Select all
esp_event_post("COMMANDBASE1", 0, NULL, 0, portMAX_DELAY)
This string is from UART so I cannot make it hardcoded.
Code: Select all
esp_event_post(basevar, 0, NULL, 0, portMAX_DELAY)
Code: Select all
inline esp_event_base_t filterEvents(char* eventBase)
{
if(strcmp(eventBase, "COMMANDBASE1") == 0)
{
return (esp_event_base_t)"COMMANDBASE1";
}
return (esp_event_base_t)"UNKNOWN";
}
esp_event_post(filterEvents(basevar),0, NULL, 0, portMAX_DELAY)