简体   繁体   English

构建自己的套接字API以通过LoRaWAN发送UDP数据包

[英]Building an own socket API to send UDP packets over LoRaWAN

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. 我正在构建一个LoRa网络,服务器和终端设备需要使用通常通过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. 我找到的一个解决方案是创建自己的套接字API,它提供send,receive,bind,...函数。 But here I'm actually struggling. 但在这里,我实际上在苦苦挣扎。

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. 或者我必须定义自己的自动对焦,如果是,那么在何处/如何实现。

I'm looking forward to your answers / ideas. 我期待着你的回答/想法。

According to the LoRaWAN specification and my limited experience, LoRaWAN is not suitable for such situation. 根据LoRaWAN规范和我有限的经验,LoRaWAN不适合这种情况。 If you still wanna use UDP packets over LoRaWAN, here are some tips for your question. 如果你仍然想在LoRaWAN上使用UDP数据包,这里有一些提示你的问题。

  1. In which scope do I need to write my socket? 我需要在哪个范围内编写套接字?

You may use sendUnconfirm function since this function does not need ACK from gateway. 您可以使用sendUnconfirm函数,因为此函数不需要来自网关的ACK。 And port in LoRaWAN could play the role of bind in UDP socket. LoRaWAN中的端口可以在UDP套接字中扮演绑定角色。

  1. Is it enough to just edit the functions and rely on the other given parameters such as the address families? 仅编辑函数并依赖其他给定参数(如地址族)是否足够?

LoRaWAN server has its own features and structure. LoRaWAN服务器有自己的特性和结构。 Usually, a LoRaWAN server is consist of packet_forwarder, LoRaWAN server and LoRaWAN application server. 通常,LoRaWAN服务器由packet_forwarder,LoRaWAN服务器和LoRaWAN应用服务器组成。 You may use these features to build you own application on LoRaWAN applicaiton server. 您可以使用这些功能在LoRaWAN应用服务器上构建自己的应用程序。 It could save your a lot of time. 它可以节省你很多时间。

It is highly recommended to read LoRaWAN specification (Get it here) and TTN LoRaWAN wiki to help you get a better understanding in LoRaWAN. 强烈建议阅读LoRaWAN规范(在此获取)TTN LoRaWAN wiki,以帮助您更好地理解LoRaWAN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM