I’m building a LoRa network where the server and the end-device need to communicate using a protocol which normally transmits data via UDP. Due to the fact that these two protocols act totally different I need to find a way to combine those two.
One solution I found is to create my own socket API which provides send, receive, bind, … functions. But here I’m actually struggling cause of the following questions.
In which scope do I need to write my socket? Is it enough to just edit the functions and rely on the other given parameters such as the address families? Or must I define my own AF and if so where/how is this achieved.
Tried one of you something similar or does one of you has another idea on how to manage this?
I’m looking forward to your answers / ideas.
Without any detail about your use case: I think what you want is not doable. In UDP you’d bind to receive incoming data, but receiving data (downlinks) in LoRaWAN is very limited. And in most cases only Class A is supported, so receiving is only possible after sending. And you cannot send all day just to receive data.
The difference between the classes is known. Since the server only needs to send data as an response to incoming packets, in my view, there won’t be a problem regarding this restriction.
Furthermore I thought about using the bind function to bind a port to the related server so that the packets are only forwarded from LoRaWAN layer to the UDP server when they are addressed to a special port (e.g., port 255).
This is what I was thinking about but maybe I’m overlooking something.