wireless_tools在android上的移植
来源:互联网 发布:网络搭建怎么学 编辑:程序博客网 时间:2024/05/17 03:56
硬件平台:mx53_qsb开发板
软件平台:android2.2.1
第一步:网上下载wireless_tools源码包,放在/external目录,并解压,这里使用wireless_tools.29.tar.gz
可从下面的网址下载:
http://bbs.9tripod.com/viewthread.php?tid=126&extra=page%3D1
第二步:解压该文件,在external目录中将会新生成wireless_tools.29目录
第三步:在wireless_tools.29目录下创建Android.mk文件,内容如下:
LOCAL_PATH:= $(call my-dir)
################## build iwlib ###################
include $(CLEAR_VARS)
LOCAL_SRC_FILES := iwlib.c
LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC
LOCAL_MODULE:= libiw
LOCAL_STATIC_LIBRARIES := libcutils libc libm
include $(BUILD_STATIC_LIBRARY)
################## build iwconfig ###################
include $(CLEAR_VARS)
LOCAL_SRC_FILES := iwconfig.c
LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC
LOCAL_MODULE:= iwconfig
LOCAL_STATIC_LIBRARIES := libcutils libc libm libiw
#LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
#LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
#LOCAL_MODULE_TAGS := eng user
include $(BUILD_EXECUTABLE)
################## build iwlist ###################
include $(CLEAR_VARS)
LOCAL_SRC_FILES := iwlist.c iwlib.h
LOCAL_CFLAGS += -Wstrict-prototypes -Wmissing-prototypes -Wshadow -Wpointer-arith -Wcast-qual -Winline -MMD -fPIC
LOCAL_MODULE:= iwlist
LOCAL_STATIC_LIBRARIES := libcutils libc libm libiw
#LOCAL_FORCE_STATIC_EXECUTABLE := true
LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES) # install to system/xbin
#LOCAL_UNSTRIPPED_PATH := $(TARGET_ROOT_OUT_UNSTRIPPED)
#LOCAL_MODULE_TAGS := eng user
include $(BUILD_EXECUTABLE)
第四步:源代码修改
1.将wireless.22.h 更名为wireless.h
2.修改ifrename.c 增加getline的函数,代码可以从external/genext2fs/genext2fs.c中获得
3.修改iwlib.h,将#include <net/ethernet.h>改为#include <net/if_ether.h>
4.在iwlib.h中,将下面的代码移出#ifndef IW_EV_LCP_PK_LEN ...... #endif宏,确保下面的代码生效,否则将提示编译找不到这些宏定义的错误:
struct iw_pk_event
{
__u16len;/* Real lenght of this stuff */
__u16cmd;/* Wireless IOCTL */
union iwreq_datau;/* IOCTL fixed payload */
} __attribute__ ((packed));
structiw_pk_point
{
void __user*pointer;/* Pointer to the data (in user space) */
__u16length;/* number of fields or size in bytes */
__u16flags;/* Optional params */
} __attribute__ ((packed));
#define IW_EV_LCP_PK2_LEN(sizeof(struct iw_pk_event) - sizeof(union iwreq_data))
#define IW_EV_POINT_PK2_LEN(IW_EV_LCP_PK2_LEN + sizeof(struct iw_pk_point) - IW_EV_POINT_OFF)
事实上,我们只用将#endif挪在这段代码的上面即可。
第五步:在android源码包根目录下,分别执行如下代码编译文件:
source build/envsetup.sh
mm bionic/libm PRODUCT-imx53_loco-eng
mm external/wireless_tools.29/ PRODUCT-imx53_loco-eng
编译完成,将会在out/target/product/imx53_loco/system/xbin下生成iwlist,iwconfig等无线工具。
第六步:使用adb push或者重新下载system.img映像文件,就可以正常使用wireless_tools了。
- wireless_tools在android上的移植
- wireless_tools在android上的移植
- wireless_tools的移植
- wireless_tools移植
- Android在新平台上的移植
- LTP在Android上的移植
- Android在新平台上的移植
- systemtap在android、pandaboard上的移植
- ntfs在android平台上的移植
- ffmpeg在android平台上的移植
- speex算法在android上的移植
- speex算法在android上的移植
- PC/SC在android上的移植
- ORB_SLAM2在Android上的移植过程
- ORB_SLAM2在Android上的移植过程
- ORB_SLAM2在Android上的移植过程
- 基于glibc的程序在android上的移植
- 在omap3530上移植成功Android的ALSA声卡驱动
- Android开发过程应该注意的
- 校正的几种模型
- Android核心分析(20)----Android应用程序框架之无边界设计意图
- Android核心分析(21)----Android应用框架之AndroidApplication
- MyQQ
- wireless_tools在android上的移植
- C# 在DOS下执行命令并判断是否执行成功!
- 杂
- core dump 学习
- C#读写文件
- C#实现GET,PUT,POST,DELETE
- 从客户端(ly="<...")中检测到有潜在危险的 Request.Form 值
- 算法导论P99 计数排序
- Android学习笔记__2__Android工程目录结构