android移植Linux Wireless Extension Tools以及使用说明

  1. Wireless tools for Linux是一个Linux命令行工具包,用来设置支持Linux Wireless Extension的无线设备。Wireless tools for Linux 和 Linux Wireless Extension 由 Jean Tourrilhes在维护,由Hewlett-Packard(HP惠普)赞助。大多数基于Linux内核的操作系统都包含Wireless tools。在许多GNU/Linux 发行版中,都缺省安装这个工具包,即使是没有自动安装,也能很容易地找到其二进制代码安装包。

    Wireless Extension (WE)是一组通用的API,能在用户空间对通用Wireless LANs进行配置和统计。它的好处在于仅通过一组单一的工具就能对各种各样的Wireless LANs进行管理,不过它们是什么类型,只要其驱动支持Wireless Extension就行;另一个好处就是不用重启驱动或Linux就能改变这些参数。Wireless Tools (WT)就是用来操作Wireless Extensions的工具集,它们使用字符界面,虽然粗糙,但支持所有Wireless Extension。

    虽然还有很多其他管理Wireless Extensions的工具,但Wireless Tools是参考实现,它包括以下工具:
    iwconfig:设置基本无线参数iwlist:扫描、列出频率,比特率,密钥等
    iwspy:获取每个节点链接的质量(只能查阅与之相连的节点)
    iwpriv:操作Wireless Extensions 特定驱动
    ifrename: 基于各种静态标准命名接口
     
  2. Wireless tools在android环境下的编译
       下载原始工程:  https://github.com/kriswebdev/android_wireless_tools
        用以下内容替换Android.mk(以下内容只编译了大多数的tool binary,有几个没有加入编译, 需要的添加对应的部分就可以了~),然后mma编译即可, 编译出来的binary在system/xbin目录
    LOCAL_PATH:= $(call my-dir)
    
    ################## build iwconfig #################
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES := iwconfig.c iwlib.c
    LOCAL_MODULE:= iwconfig
    LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC -Wno-implicit-function-declaration -Wno-self-assign
    LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
    include $(BUILD_EXECUTABLE)
    
    ################## build iwlist ###################
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES := iwlist.c iwlib.c
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE:= iwlist
    LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC -Wno-implicit-function-declaration -Wno-self-assign
    LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
    include $(BUILD_EXECUTABLE)
    ################## build iwpriv ###################
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES := iwpriv.c iwlib.c
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE:= iwpriv
    LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC -Wno-implicit-function-declaration -Wno-self-assign
    LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
    include $(BUILD_EXECUTABLE)
    ################## build iwspy ###################
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES := iwspy.c iwlib.c
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE:= iwspy
    LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC -Wno-implicit-function-declaration -Wno-self-assign
    LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
    include $(BUILD_EXECUTABLE)
    ################## build iwgetid ###################
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES := iwgetid.c iwlib.c
    LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE:= iwgetid
    LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC -Wno-implicit-function-declaration -Wno-self-assign
    LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
    include $(BUILD_EXECUTABLE)
    ################## build iwevent ###################
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES := iwevent.c iwlib.c
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE:= iwevent
    LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC -Wno-implicit-function-declaration -Wno-self-assign
    LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
    include $(BUILD_EXECUTABLE)
    ################## build macaddr ###################
    include $(CLEAR_VARS)
    LOCAL_SRC_FILES := macaddr.c iwlib.c
    LOCAL_MODULE_TAGS := optional
    LOCAL_MODULE:= macaddr
    LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC -Wno-implicit-function-declaration -Wno-self-assign
    LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
    include $(BUILD_EXECUTABLE)
    

     

  3. 工具使用(具体细节可以通过help查找用法)

你可能感兴趣的:(android,wifi,tools)