wifi test

http://wireless.kernel.org/en/developers/GSoC/2010/wifi-test-nl80211

 

Wifi-test

wifi-test is fully automated test script for linux wireless drivers. It's an open-source project.

Git tree

http://www.intellinuxwireless.org/repos/wifi-test.git

Mailing list and posting patches

This project has its own mailing list.

Wifi test 1.0

wifi-test 1.0 covers following wireless features:

  • BSS: BSS association, fragmentation/RTS/CTS, BSS channels etc
  • IBSS: IBSS association, IBSS fragmentation/RTS/CTS, IBSS channels.
  • Security: WEP (BSS/IBSS), WPA/WPA2, 802.1X.
  • Power management: S3/S4, RFKILL
  • Performance: upload/download speed for different combinations.
  • Others: Wext mode, nl80211 mode
  • 802.11 a/b/g/n: Above features in a/b/g/n band.

Testing environment setup

The minimum testing system requirements are listed below.

  • Two test machines: One as test machine, the other as peer machine in IBSS network testing. If only BSS is tested, one test machine is enough.
  • One server machine: The server machine needs two Ethernet cards, one connects to the Test machine network and the other to the AP network.
  • One AP: Support Cisco AP, Dlink and ASUS AP with CLI (Command Line Interface). For example, Dlink DWL-8200 AP and Cisco1200 series AP.

Here is an example of our test environment:

  --------------
 | Test Machine |
  --------------\
                 \ ---------                    --------
                  | Test    |     -------      |  AP    |   ---
                  | machine |----| Server |----| network|--| AP |
                  | network |     -------      |        |   ---
                 / ---------                    --------
  ------------- /
 | Peer Machine |
  --------------

 

内容概要:本文详细介绍了PMSM(永磁同步电机)的仿真研究及其两种关键控制方法:三电平SVPWM矢量控制和双环矢量控制。首先阐述了PMSM在现代电机驱动系统中的重要地位及其广泛的应用领域,如电动汽车、机器人和风力发电等。接着讨论了PMSM仿真的重要性,包括电气特性、机械特性和热特性等方面的考量。然后深入探讨了三电平SVPWM矢量控制技术的工作原理及其对电机性能的提升效果,如提高运行效率和减少谐波失真。随后介绍了PMSM双环矢量控制的具体实现方式,即内环电流控制和外环速度控制相结合的方法,强调了这种方法在提高电机动态性能和稳定性方面的优势。最后对比了传统三电平控制方法和双环矢量控制方法的特点,指出了各自的优势和应用场景。 适合人群:从事电机控制系统研究的技术人员、高校相关专业师生、对电机控制感兴趣的工程技术人员。 使用场景及目标:适用于需要深入了解PMSM控制技术和仿真实现的研究项目和技术开发。目标是帮助读者掌握PMSM的仿真建模方法,理解并应用三电平SVPWM和双环矢量控制技术,以优化电机性能。 其他说明:本文不仅提供了理论分析,还通过MATLAB进行了详细的仿真演示,使读者能够直观地看到不同控制方法的效果。这对于实际工程项目的设计和优化具有重要的指导意义。
``` @echo off :begin echo ***************************************************************************** echo ** ** echo ** 注意:请将设备【WiFi打开】【蓝牙关闭】,写号前将设备通过USB连接至电脑 ** echo ** 注意:请按照蓝牙Mac地址在前,WiFi Mac地址在后的顺序录入 ** echo ** ** echo ***************************************************************************** echo. :: set /p arr=请顺序输入蓝牙Mac地址和WiFi Mac地址,以空格隔开: :: for /f "tokens=1,2,3,4,5,6,7,8,9,10,11,12 delims= " %%a in ("%arr%") do ( :: set num1=%%a :: set num2=%%b :: set num3=%%c :: set num4=%%d :: set num5=%%e :: set num6=%%f :: set num7=%%g :: set num8=%%h :: set num9=%%i :: set num10=%%j :: set num11=%%k :: set num12=%%l :: ) :: 此方案不需要工厂标签二维码有特殊格式,顺序输入即可。eg:112233445566aabbccddeeff set /p arr=请顺序输入蓝牙Mac地址和WiFi Mac地址: set num1=%arr:~0,2% set num2=%arr:~2,2% set num3=%arr:~4,2% set num4=%arr:~6,2% set num5=%arr:~8,2% set num6=%arr:~10,2% set num7=%arr:~12,2% set num8=%arr:~14,2% set num9=%arr:~16,2% set num10=%arr:~18,2% set num11=%arr:~20,2% set num12=%arr:~22,2% echo adb root adb root :: 打开WiFi、关闭BT adb shell svc wifi enable adb shell svc bluetooth disable :: 预留开关响应时间2s timeout /t 2 /nobreak >nul echo ***************************************************************************** echo ** ** echo ** 开始写入蓝牙地址 : %num1% %num2% %num3% %num4% %num5% %num6% ** echo ** ** echo ***************************************************************************** adb shell wifitest -O adb shell wifitest -E 0x138 adb shell wifitest -e 0x138 -v 0x67 adb shell wifitest -e 0x139 -v %num1% adb shell wifitest -e 0x13A -v %num2% adb shell wifitest -e 0x13B -v %num3% adb shell wifitest -e 0x13C -v %num4% adb shell wifitest -e 0x13D -v %num5% adb shell wifitest -e 0x13E -v %num6% :: boots 方案回显有较多的fail,影响产线判断先不用,待产线测试wifitest的稳定性再决定是否启用 :: 目前遇到的问题是单独操作boots可以写成功,但是放在bat顺序执行会概率性执行不下去。 :: adb shell boots -c efuse -r -a 0x138 :: adb shell boots -c efuse -w -a 0x138 -v 0x67 :: adb shell boots -c efuse -w -a 0x139 -v %num1% >nul :: adb shell boots -c efuse -w -a 0x13A -v %num2% >nul :: adb shell boots -c efuse -w -a 0x13B -v %num3% >nul :: adb shell boots -c efuse -w -a 0x13C -v %num4% >nul :: adb shell boots -c efuse -w -a 0x13D -v %num5% >nul :: adb shell boots -c efuse -w -a 0x13E -v %num6% >nul echo ***************************************************************************** echo ** ** echo ** 开始写入WiFi地址 : %num7% %num8% %num9% %num10% %num11% %num12% ** echo ** ** echo ***************************************************************************** :: adb shell wifitest -O adb shell wifitest -e 4 -v %num7% adb shell wifitest -e 5 -v %num8% adb shell wifitest -e 6 -v %num9% adb shell wifitest -e 7 -v %num10% adb shell wifitest -e 8 -v %num11% adb shell wifitest -e 9 -v %num12% echo 设备重启 adb reboot pause goto begin :: adb shell wifitest -e 4 -v 0xec :: adb shell wifitest -e 5 -v 0x20 :: adb shell wifitest -e 6 -v 0x14 :: adb shell wifitest -e 7 -v 0x05 :: adb shell wifitest -e 8 -v 0x11 :: adb shell wifitest -e 9 -v 0x17 :: goto begin```请帮我优化下代码,注意输入的字符在保存到数组的时候需要以0x形式保存
03-20
以下是经过优化后的代码,并解决了将输入字符以`0x`形式保存的问题: ```batch @echo off :begin cls echo ***************************************************************************** echo ** ** echo ** 注意:请将设备【WiFi打开】【蓝牙关闭】,写号前将设备通过USB连接至电脑 ** echo ** 注意:请按照蓝牙Mac地址在前,WiFi Mac地址在后的顺序录入 ** echo ** ** echo ***************************************************************************** set /p input=请输入蓝牙Mac地址和WiFi Mac地址 (共24位十六进制数字): :: 检查用户输入长度是否为24位 if not "%input%"=="%input:~0,24%" ( echo 输入错误!请确保您输入了24位有效的十六进制数字。 pause goto begin ) :: 将输入拆分为12段两字符的值并转换为0x形式存储 for %%i in ("0","2","4","6","8","10","12","14","16","18","20","22") do ( set "index=%%~i" call set "mac[!index!/2]=0x!!input:~%%~i,2!" ) :: 显示结果用于调试验证 echo 蓝牙MAC地址: echo !mac[0]! !mac[1]! !mac[2]! !mac[3]! !mac[4]! !mac[5]! echo WiFi MAC地址: echo !mac[6]! !mac[7]! !mac[8]! !mac[9]! !mac[10]! !mac[11]! :: ADB命令部分 adb root adb shell svc wifi enable adb shell svc bluetooth disable timeout /t 2 /nobreak >nul :: 写入蓝牙地址 echo ***************************************************************************** echo ** ** echo ** 开始写入蓝牙地址 : !mac[0]! !mac[1]! !mac[2]! !mac[3]! !mac[4]! !mac[5]! ** echo ** ** echo ***************************************************************************** adb shell wifitest -O adb shell wifitest -E 0x138 adb shell wifitest -e 0x138 -v 0x67 adb shell wifitest -e 0x139 -v !mac[0]! adb shell wifitest -e 0x13A -v !mac[1]! adb shell wifitest -e 0x13B -v !mac[2]! adb shell wifitest -e 0x13C -v !mac[3]! adb shell wifitest -e 0x13D -v !mac[4]! adb shell wifitest -e 0x13E -v !mac[5]! :: 写入WiFi地址 echo ***************************************************************************** echo ** ** echo ** 开始写入WiFi地址 : !mac[6]! !mac[7]! !mac[8]! !mac[9]! !mac[10]! !mac[11]! ** echo ** ** echo ***************************************************************************** adb shell wifitest -e 4 -v !mac[6]! adb shell wifitest -e 5 -v !mac[7]! adb shell wifitest -e 6 -v !mac[8]! adb shell wifitest -e 7 -v !mac[9]! adb shell wifitest -e 8 -v !mac[10]! adb shell wifitest -e 9 -v !mac[11]! :: 设备重启 echo 设备重启... adb reboot pause goto begin ``` ### 主要改动点说明: 1. 用户输入检查:增加了对输入字符串长度的校验,避免无效数据导致脚本运行失败。 2. 使用数组存储MAC地址片段:用变量 `mac[i]` 存储每个两位十六进制数,并自动加上 `0x` 前缀。 3. 动态索引赋值:利用循环处理输入字符串,简化重复代码。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值