When is the TX_PACKET_EVENT interrupt triggered?
-
Hi,
I am using LORA RAW communication based on a socket: socket.socket(socket.AF_LORA, socket.SOCK_RAW), with an interrupt handler for both TX_PACKET_EVENT and RX_PACKET_EVENT.
I would like to know when is the TX_PACKET_EVENT being triggered?
Is it once the message is transmitted or once it is inside the socket's buffer?- Afaik, the socket has some sort of buffer (fifo?) which stores messages when I call socket.send(msg), and LoRa messages are being transmitted from this buffer.
Another question is, can this buffer be emptied in case I only want the last message to be sent and not in order?
I hope I'm not missing anything with the behaviour I just described.
Regards,
Eran
-
@jcaron thanks! That is clearly a good way of doing that. How come I didn't think of it sooner? :)
Here is what I sent:
24 byte payload (on top of headers, CRC, etc.)
SF12
US915
BW500The time between when I sent it to when I got the interrupt triggered is: ~460 mili seconds
The expected time between when I sent it to when I got the interrupt triggered should be: ~450 mili secondsSo that means that the interrupt is triggered after the entire message has been sent.
Hopes that helps anyone.
Regards,
Eran
-
@eranroll It should be easy to find out by yourself: send a few 50-byte packets at the slowest possible data rate (SF12 in the EU region for instance). Such packets will take over 1 second to send, so logging the events with timestamps should give you a pretty clear answer.
Don't forget to report back your findings.