wifi driver設定
(阿安, coolansean@yahoo.com.tw, 2012-02-14 10:41)
1樓
想請問關於wifi無線網卡設定
CST char CmdFormat[] =
{
"iwpriv ra0 set NetworkType=Infra;\n"
"iwpriv ra0 set AuthMode=%s;\n"
"iwpriv ra0 set EncrypType=%s;\n"
"iwpriv ra0 set DefaultKeyID=1;\n"
"iwpriv ra0 set Key1=\"%s\";\n"
"iwpriv ra0 set SSID=\"%s\";\n"
};
s8 wificmd[256];
// 產生 wificmd
snprintf (&wificmd[0], sizeof(wificmd), CmdFormat,
strAuth[pAP->AuthMode],
strEncType[pAP->EncrypType],
pAP->Key,
pAP->SSID
);
//TRACE(wificmd);
ret = system(wificmd);
if( 0 == ret )
{
system("udhcpc -i ra0 -qn");
}
透過iwpriv和ioctl(sgSockFD, SIOCGIFCONF, (char*)&ifconf ),取得網卡IP和MAC address
為何還需要用udhcpc??
用意何在??
(joseph, 2012-02-14 19:21)
2樓
SIOCGIFCONF 這個command只是抓有那些網卡界面,
(阿安, coolansean@yahoo.com.tw, 2012-02-15 09:59)
3樓
GOT IT !!!
Thanks a lot !!!