Hello Everyone,
I am using the ESP32C3 WIFI module and the tool is Espressif IDE.
By using Access Point + UDP Server Example, I have done the UDP receiving packets in polling mode. But now I want to receive UDP packets in interrupt mode.
Please give me any suggestions for receiving UDP packets in interrupt mode.
Thanks & Regards,
D.Vineetha.
UDP Receive in Interrupt mode
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: UDP Receive in Interrupt mode
UDP packets aren't received in polling or interrupt mode. What specifically are you talking about?
Re: UDP Receive in Interrupt mode
I have done UDP receiving packets in polling mode by using UDP Server example which is available in ESP-IDF examples.
https://github.com/espressif/esp-idf/bl ... p_server.c
But now I want to receive UDP packets in interrupt mode for that please clarify how to enable interrupt mode for ESP32C3 in
Espressif IDE.
Thanks & Regards,
D. Vineetha.
https://github.com/espressif/esp-idf/bl ... p_server.c
But now I want to receive UDP packets in interrupt mode for that please clarify how to enable interrupt mode for ESP32C3 in
Espressif IDE.
Thanks & Regards,
D. Vineetha.
-
- Posts: 1707
- Joined: Mon Oct 17, 2022 7:38 pm
- Location: Europe, Germany
Re: UDP Receive in Interrupt mode
Your question doesn't make more sense when you just repeat it.
Create a dedicated task while(1) { len = recvfrom(udpsocket, packet,...); onUdpPacket(packet,len); }.
Alternatively, let us know what you believe "interrupt mode" means and how that would relate to receiving UDP packets.
Create a dedicated task while(1) { len = recvfrom(udpsocket, packet,...); onUdpPacket(packet,len); }.
Alternatively, let us know what you believe "interrupt mode" means and how that would relate to receiving UDP packets.
-
- Posts: 9730
- Joined: Thu Nov 26, 2015 4:08 am
Re: UDP Receive in Interrupt mode
That code does not use 'polling', it is 'blocking', that is, it uses FreeRTOS primitives (in the TCP/IP stack) to put your task to sleep until the TCP/IP stack receives an UDP packet. What you want probably is a 'callback' rather than 'interrupt mode'. The sockets API does not have something like that, but the code snippet that MicroController provided would be a good workaround that performs a similar function. (But note that you may be better off trying to explain a bit more about the issue you're having, as faking a callback API may not be the best solution to your problem.)
Who is online
Users browsing this forum: Baidu [Spider] and 106 guests