/** * Function that retrieves SSID of current scaned network * * The SSID is the Information Element with ID = 0 * The SSID can be at most 34 bytes, so the aSSID should have the capacity for 34 bytes * * Returns KErrNone if successful or the type of error ocurred */ TInt GetSSID(CWlanScanInfo *scanInfo, TDes8 &aSSID) { TInt error; TUint8 ie; TUint8 length; TUint8 vdata[40]; const TUint8 *data = &vdata[0]; if(scanInfo == NULL) return KErrNullPointerPassed; if(aSSID.MaxLength() < 34) return KErrNoMemory; if((error = scanInfo->FirstIE(ie, length, &data)) == KErrNone) { if(ie == 0) { aSSID.Copy(data, length); return KErrNone; } } else return error; while((error = scanInfo->NextIE(ie, length, &data)) == KErrNone) { if(ie == 0) { aSSID.Copy(data, length); return KErrNone; } } return error; }
Monday, April 11, 2011
GetSSID
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment