2008-04-17
WifiInfo for HTC
Googleで情報の海をさまよっていたらいわゆる普通のデバイスでのWiFiのコントロールの仕方を見つけたのでなんとなーく対応させてみた。
for HTC とか謳っているけど、正式に対応しているのはHermes と Kaiserのみ。国内で販売されてるしね。
AdvantageとP3600は使えないかも。HT1100も同じく。
HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Power\State
以下のGUIDから始まるそれっぽーい文字列を教えてくれれば対応できるかもしれません。
for X01T に同じく、問題あれば連絡ください。
Download: WifiInfo_HTC.1.24.2.CAB
以下追加部分のコード
#include <Pm.h> static VOID SetWLan() { // 電源管理用デバイス名 static wchar_t pvDeviceHermes[] = L"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\TIACXWLN1"; static wchar_t pvDeviceKaiser[] = L"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\TNETW12511"; // Wizerdをサポートするときはここを有効にしてね // static wchar_t pvDeviceWizerd[] = L"{98C5250D-C29A-4985-AE5F-AFE5367E5006}\\TNETWLN1"; wchar_t* pvDeviceList[] = {pvDeviceHermes, pvDeviceKaiser}; wchar_t* pvDevice = NULL; // WLANの電源状態、どれが使える? CEDEVICE_POWER_STATE state = PwrDeviceUnspecified; for (int i = 2; i != 0; --i) { pvDevice = pvDeviceList[i]; if (GetDevicePower((PVOID)pvDevice, POWER_NAME, &state) == ERROR_SUCCESS) { break; } pvDevice = NULL; } if (pvDevice == NULL) { // 使えるのが見つからなかった g_bWlanPowerOn = FALSE; return; } // D0 でON // D4 でOFF // らしいです。 if (GetWifiState() & SN_WIFISTATEPOWERON_BITMASK) { DevicePowerNotify((PVOID)pvDevice, D4, POWER_NAME); SetDevicePower((PVOID)pvDevice, POWER_NAME, D4); g_bWlanPowerOn = FALSE; } else { DevicePowerNotify((PVOID)pvDevice, D0, POWER_NAME); SetDevicePower((PVOID)pvDevice, POWER_NAME, D0); g_bWlanPowerOn = TRUE; } }
トラックバック - http://d.hatena.ne.jp/tmyt/20080417/1208448363
リンク元
- 376 http://solamame.blog.so-net.ne.jp/2008-05-10
- 326 http://www.taiwanweb.net/blog/?p=562
- 306 http://kikuz0u.x0.com/x01t/soft:home
- 237 http://d.hatena.ne.jp/itokoichi/20080418/p3
- 180 http://d.hatena.ne.jp/itokoichi/
- 133 http://tachibana.in/blog/?p=778
- 120 http://d.hatena.ne.jp/wiitomo/
- 116 http://nmsworxbox.blog.shinobi.jp/Category/9/
- 93 http://d.hatena.ne.jp/wiitomo/20080417/1208442505
- 70 http://d.hatena.ne.jp/solipt/20080419/1208715609