C或Java中的Linux的无线API

时间:2023-01-13 00:01:54

my team and I are working in a project based on the drone Parrot API. We are trying to find an api to write a small program which can scan the wireless network and selects the drone ESSID. Our main language is C but Java is also appreciated.

我和我的团队正在进行一个基于drone API的项目。我们正在寻找一个api来编写一个小程序,它可以扫描无线网络并选择无人机的ESSID。我们的主要语言是C语言,但是Java也很受欢迎。

I tried to look if exist any API for the iwlist/iwconfig command but i did not find anything. Can someone help me plz? Any example (code sample) will also be appreciated.

我试图查找iwlist/iwconfig命令是否存在任何API,但什么也没找到。谁能帮我一下吗?任何示例(代码示例)也将受到赞赏。

Gracias

谢谢

2 个解决方案

#1


8  

With newer kernels the framework for managing wireless cards is called nl80211. It's netlink based, so you can use libnl to issue commands and parse answers. More information:

对于较新的内核,管理无线卡的框架称为nl80211。它是基于netlink的,所以您可以使用libnl发出命令并解析答案。更多信息:

http://wireless.kernel.org/en/developers/Documentation/nl80211

http://wireless.kernel.org/en/developers/Documentation/nl80211

Currently iw is the command line utility that utilizes nl80211, so you can list available hardware, scan, etc:

目前iw是使用nl80211的命令行实用程序,因此您可以列出可用的硬件、扫描等:

http://linuxwireless.org/en/users/Documentation/iw

http://linuxwireless.org/en/users/Documentation/iw

Its source code is easy to study and reuse in your own project, just check out their git repo.

它的源代码很容易在您自己的项目中进行研究和重用,只需检查一下他们的git repo。

#2


1  

No API but you can try: Excecute iwconfig from a java application

没有API,但是您可以尝试:从java应用程序执行iwecute配置

You can also try http://kosmosisland.com/island/david/kosmos-island-wireless.php . They have a Java Applet (with source) that monitors the Wireless Link. You can see how they did it.

您还可以尝试http://kosmosisland.com/island/david/kosmos-island-wireless.php。他们有一个Java Applet(带有源代码)来监视无线连接。你可以看到他们是怎么做到的。

Gustavo

Gustavo

#1


8  

With newer kernels the framework for managing wireless cards is called nl80211. It's netlink based, so you can use libnl to issue commands and parse answers. More information:

对于较新的内核,管理无线卡的框架称为nl80211。它是基于netlink的,所以您可以使用libnl发出命令并解析答案。更多信息:

http://wireless.kernel.org/en/developers/Documentation/nl80211

http://wireless.kernel.org/en/developers/Documentation/nl80211

Currently iw is the command line utility that utilizes nl80211, so you can list available hardware, scan, etc:

目前iw是使用nl80211的命令行实用程序,因此您可以列出可用的硬件、扫描等:

http://linuxwireless.org/en/users/Documentation/iw

http://linuxwireless.org/en/users/Documentation/iw

Its source code is easy to study and reuse in your own project, just check out their git repo.

它的源代码很容易在您自己的项目中进行研究和重用,只需检查一下他们的git repo。

#2


1  

No API but you can try: Excecute iwconfig from a java application

没有API,但是您可以尝试:从java应用程序执行iwecute配置

You can also try http://kosmosisland.com/island/david/kosmos-island-wireless.php . They have a Java Applet (with source) that monitors the Wireless Link. You can see how they did it.

您还可以尝试http://kosmosisland.com/island/david/kosmos-island-wireless.php。他们有一个Java Applet(带有源代码)来监视无线连接。你可以看到他们是怎么做到的。

Gustavo

Gustavo