Re: #mqtt #mqtt
Boie, Andrew P
Unless I'm missing something there's nothing preventing you from calling fifo APIs inside an ISR.
Otherwise, there would be assertions about it in kernel/queue.c
From: users@... [mailto:users@...] On Behalf Of Prabhu Vinod, Karthik
Sent: Tuesday, February 5, 2019 9:22 AM
To: Lubos, Robert <robert.lubos@...>; users@...
Subject: Re: [Zephyr-users] #mqtt
Thanks for the reply lubos. Ok, because I am slightly confused since I ran k_is_in_isr() inside evt_handler inside MQTT_PUBLISH and it returned 1 which means the code was running inside an ISR.
Karthik Prabhu Vinod
Help save the planet by choosing not to use single use plastics. Pick paper, bamboo or metal cutlery and carry your own bag to the grocery store. Every little thing you do makes an impact.
From: <users@...> on behalf of "Lubos, Robert" <robert.lubos@...>
MQTT event callback will run in the same thread from which you call `mqtt_input` function. So in case you call it from ISR (not recommended), the event callback will also run from ISR. I’m not sure how Zephyr’s test engine works internally, but perhaps it’s tests are run from ISR context. So while the code in the test might be fine to read and analyze, perhaps you should move it to real sample if you want to play with it.
I’m also not sure that you problems pertain from calling `k_fifo_put` form the IRQ context. According to documentation, this kernel function is safe to call from ISR, and I know it is used that way in existing code.
From: users@... [mailto:users@...]
On Behalf Of Prabhu Vinod, Karthik