reference :
http://topic.csdn.net/u/20100326/17/1f0fc5a1-3bd2-4294-aa35-1bcb73357aa3.html
getevent
getevent
add device 1: /dev/input/event0
name: "qwerty2"
/dev/input/event0: 0001 001e 00000001
/dev/input/event0: 0001 001e 00000000
其中/dev/input/event0是device的名字 0001是type, 001e是键码, 最后一个根据type不同而不同
比如上面的倒数第二条就是按下a键的keydown,最后一个是按下a的keyup
具体的type,code,value的定义可以在源码/frameworks/base/core/java/android/view/KeyEvent.java中找到
sendevent发送时间,格式和上面的一样,需要注意的是在get中code显示的是十六进制,而send中需要用十进制,例如
# sendevent /dev/input/event0 1 5 1
这个命令就是发送数字4的keydown消息,所以在屏幕上就会一直打印出很多个4(因为没有发送keyup)
2012年5月30日 星期三
Using iw command to link AP
# enable wifi
# iw dev wlan0 scan | grep SSID
# iw wlan0 connect "SSID"
# iw dev wlan0 link
# netcfg wlan0 dhcp
Turn off power save mode
#iw dev wlan0 set power_save off
# iw dev wlan0 scan | grep SSID
# iw wlan0 connect "SSID"
# iw dev wlan0 link
# netcfg wlan0 dhcp
Turn off power save mode
#iw dev wlan0 set power_save off
wifi basic diagram on Linux
reference http://acx100.erley.org/stable.html
Should be self explanitory... handles sending/receiving wireless packets
Linux Kernel:
The linux kernel contains the driver for the wireless card, the mac80211 subsystem which handles packet generation and scheduling, and the nl80211 subsystem, which handles configuring the wireless interfaces for userspace
libnl:
libnl is the transport layer used to communicate with the kernel via netlink
udev:
udev is the facility the kernel uses to pass events/calls to crda
iw:
iw is a userspace utility that we can use to test that libnl is working correctly, as well as create additional virtual wireless interfaces on the wireless card
crda:
crda is a userspace program that the kernel queries (through udev) to find what channels/frequencies are usable, and at what powers. This moves the information out of static tables maintained in kernel to userspace, which allows them to be updated without reloading drivers/rebooting
Wireless Regulatory Database: database of allowable frequencies and transmit power levels used by crda
hostapd:
This is the daemon that handles generation of beacons and other wireless packets, as wel as wpa-psk, wpa2, etc encryptions.
Basic Diagram of Component Interaction
[Wireless Card] | [Linux Kernel ] | | [udev][libnl]-[iw] | / \ [crda] \ | \ [ Wireless ] | [Regulatory] | [ Database ] | | | [ hostapd ]
Understanding what each part does
Wireless Card:Should be self explanitory... handles sending/receiving wireless packets
Linux Kernel:
The linux kernel contains the driver for the wireless card, the mac80211 subsystem which handles packet generation and scheduling, and the nl80211 subsystem, which handles configuring the wireless interfaces for userspace
libnl:
libnl is the transport layer used to communicate with the kernel via netlink
udev:
udev is the facility the kernel uses to pass events/calls to crda
iw:
iw is a userspace utility that we can use to test that libnl is working correctly, as well as create additional virtual wireless interfaces on the wireless card
crda:
crda is a userspace program that the kernel queries (through udev) to find what channels/frequencies are usable, and at what powers. This moves the information out of static tables maintained in kernel to userspace, which allows them to be updated without reloading drivers/rebooting
Wireless Regulatory Database: database of allowable frequencies and transmit power levels used by crda
hostapd:
This is the daemon that handles generation of beacons and other wireless packets, as wel as wpa-psk, wpa2, etc encryptions.
2012年5月29日 星期二
wifi reference web site
http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WLAN_Station_WPA_Supplicant_Configuration_file
http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WLAN_IW_commands
http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WiFi_Direct_Configuration_Scripts
http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WLAN_Station_Configuration_Scripts
http://omappedia.org/wiki/Mac80211_based_open_source_architecture
http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WLAN_IW_commands
http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WiFi_Direct_Configuration_Scripts
http://processors.wiki.ti.com/index.php/OMAP_Wireless_Connectivity_NLCP_WLAN_Station_Configuration_Scripts
http://omappedia.org/wiki/Mac80211_based_open_source_architecture
android: getevent
getevent : it is android tool in device. it show device capabilities.
#getevent -p
#getevent
#getevnet -i
reference:
http://source.android.com/tech/input/getevent.html
The
The
#getevent -p
#getevent
#getevnet -i
reference:
http://source.android.com/tech/input/getevent.html
The
-i
option shows even more information than -p
, including HID mapping tables
and debugging information.The
-l
option uses textual labels for all event codes, which is handy.2012年5月28日 星期一
android: dumpsys
dumpsys is tool in android device. You can use this tool to dump system information.
The parameters may have below:
SurfaceFlinger, accessibility, account, activity, alarm, appwidget, audio, backup, battery, batteryinfo, bluetooth, bluetooth_a2dp, clipboard, connectivity, content, cpuinfo, device_policy, devicestoragemonitor, diskstats, dropbox, entropy, hardware, hdmi, input_method, iphonesubinfo, isms, location, media.audio_flinger, media.audio_policy, media.camera, media.player, meminfo, mount, netstat, network_management, notification, package, permission, phone, power, search, sensor, simphonebook, statusbar, telephony.registry, throttle, uimode, usagestats, vibrator, wallpaper, wifi, window
- dumpsys meminfo displays memory usage
- dumpsys cpuinfo displays processor usage
- dumpsys account displays information on all accounts
- dumpsys activity displays information about activities
- dumpsys window displays information about keyboards, windows and their z order
- dumpsys wifi shows information about available access points and current connection
The parameters may have below:
SurfaceFlinger, accessibility, account, activity, alarm, appwidget, audio, backup, battery, batteryinfo, bluetooth, bluetooth_a2dp, clipboard, connectivity, content, cpuinfo, device_policy, devicestoragemonitor, diskstats, dropbox, entropy, hardware, hdmi, input_method, iphonesubinfo, isms, location, media.audio_flinger, media.audio_policy, media.camera, media.player, meminfo, mount, netstat, network_management, notification, package, permission, phone, power, search, sensor, simphonebook, statusbar, telephony.registry, throttle, uimode, usagestats, vibrator, wallpaper, wifi, window
git-blame
http://schacon.github.com/git/git-blame.html
http://gitbook.liuhui998.com/5_5.html
#git blame file.c
#git blame -L start_line,end_line file.c
ex:
#git blame -L 160,+20 file.c
http://gitbook.liuhui998.com/5_5.html
#git blame file.c
#git blame -L start_line,end_line file.c
ex:
#git blame -L 160,+20 file.c
wifi calibrator for Tx/RX testing
*********************************************
*Tx
*********************************************
1. Make sure you turn off wifi on UI
2. #insmod /system/lib/modules/wl12xx_sdio.ko
3. #ifconfig wlan0 down
4. #calibrator wlan0 plt power_mode on
5. #calibrator wlan0 plt tx_stop
5. #calibrator wlan0 plt tune_channel
6. #calibrator wlan0 plt tx_cont
7. #calibrator wlan0 plt tx_stop
8. #calibrator wlan0 plt power_mode off
**********************************************
*Rx
**********************************************
1. Make sure you turn off wifi on UI
2. #insmod /system/lib/modules/wl12xx_sdio.ko
3. #ifconfig wlan0 down
4. #calibrator wlan0 plt power_mode on
5. #calibrator wlan0 plt tune_channel
6. #calibrator wlan0 plt stop_rx_statcs
7. #calibrator wlan0 plt reset_rx_statcs
8. #calibrator wlan0 plt start_rx_statcs
9. #calibrator wlan0 plt stop_rx_statcs
10.#calibrator wlan0 plt get_rx_statcs
11.#calibrator wlan0 plt power_mode off
~
*Tx
*********************************************
1. Make sure you turn off wifi on UI
2. #insmod /system/lib/modules/wl12xx_sdio.ko
3. #ifconfig wlan0 down
4. #calibrator wlan0 plt power_mode on
5. #calibrator wlan0 plt tx_stop
5. #calibrator wlan0 plt tune_channel
6. #calibrator wlan0 plt tx_cont
7. #calibrator wlan0 plt tx_stop
8. #calibrator wlan0 plt power_mode off
**********************************************
*Rx
**********************************************
1. Make sure you turn off wifi on UI
2. #insmod /system/lib/modules/wl12xx_sdio.ko
3. #ifconfig wlan0 down
4. #calibrator wlan0 plt power_mode on
5. #calibrator wlan0 plt tune_channel
6. #calibrator wlan0 plt stop_rx_statcs
7. #calibrator wlan0 plt reset_rx_statcs
8. #calibrator wlan0 plt start_rx_statcs
9. #calibrator wlan0 plt stop_rx_statcs
10.#calibrator wlan0 plt get_rx_statcs
11.#calibrator wlan0 plt power_mode off
~
2012年5月23日 星期三
訂閱:
文章 (Atom)