android - 在 Android Things 上手动配置网络适配器

标签 android networking kotlin raspberry-pi3 android-things

我正在尝试配置在 Raspberry Pi 3b 上运行的 Android Things 客户端,以连接到不同网络上的第三方设备。我进行了数小时的研究,但找不到可行的解决方案。

拓扑结构

拓扑由一个 Raspberry PI、路由器和第三方设备组成。 Raspberry PI 通过 LAN 和 WLAN 连接到路由器以确保故障安全,并且与路由器属于同一网络。

问题

有第三方设备物理连接到同一路由器,但配置了不同的网络。设备的配置无法更改。 请查看下面的拓扑结构。

通过设置静态 IP 并将网络适配器的子网掩码更改为与目标相同的子网掩码,我能够使用 MacOS 或 Windows 连接到第三方设备。

问题:有没有办法配置 Android Things 或修改拓扑来访问此设备? (见拓扑中的红线)

注意:我知道这个连接应该如何工作的困惑方式✌🏻

Topology

最佳答案

我建议您引用来自 android things 的 LoWPAN 包。

这个包有几个类可以帮助你实现你的目标。

如何实现这一目标?”,阅读下文:

  1. 您可以使用 LowpanScanner 创建扫描操作类将为您提供来自 LowpanScanner.Callback 的回调用LowpanBeaconInfo上课.

  2. 现在使用 LowpanIdentitygetLowpanIdentity() 提供的网络信息的类对象LowpanBeaconInfo 类的方法。

  3. 您应该如何连接到此提供的网络中的设备?尝试使用 LowpanProvisioningParams 加入他们如果有帮助,请上课。

引用 com.google.android.things.lowpan

注意:(就我个人而言,我还没有尝试过,但希望这是最适合你的镜头,如果可以,请告诉我是否有效)

我知道这并不多,但希望这对您有所帮助!


More about LoWPAN:

LoWPAN is an acronym of IPv6 over "Low-Power Wireless Personal Area Networks". It was originated from the idea that "the Internet Protocol could and should be applied even to the smallest devices," and that low-power devices with limited processing capabilities should be able to participate in the Internet of Things.

LoWPAN group has defined encapsulation and header compression mechanisms that allow IPv6 packets to be sent and received over IEEE 802.15.4 based networks. IPv4 and IPv6 are the work horses for data delivery for local-area networks, metropolitan area networks, and wide-area networks such as the Internet. Likewise, IEEE 802.15.4 devices provide sensing communication-ability in the wireless domain. The inherent natures of the two networks though, are different. Read More from here.

关于android - 在 Android Things 上手动配置网络适配器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52440959/

相关文章:

android - 结合 CoverFlow 和通用图像加载器

android - 获取android sendevent坐标比例因子

javascript - Java Socket 和 JS WebSocket

networking - "connecting"在“网络”选项卡中的 Chrome 开发者工具中是什么意思,为什么它只显示在某些网站上?

kotlin - 从 java 中调用作为 java 中关键字的 kotlin 函数?

android - android ffmpeg 库是否能够播放位于 assets 文件夹中的视频

linux - shell 脚本: How to calculate the number of bytes transmitted on a network from a single network intense application?

Send 和 Offer 之间的 Kotlin Channels 使用差异

json - 在 Kotlin 中解析 json

java - 数学计算不正确