📄 protocol802_11instanceobject.cpp
字号:
if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject*>(m_pImpl); if (pAPI_Instance) { delete pAPI_Instance; } m_pImpl = NULL; } }}//==============================================================================// ResetStatistics()//==============================================================================bool Intel::Mobile::Network::Protocol802_11Instance::ResetStatistics(){ bool bValue = false; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("ResetStatistics"), IntelMobileText("") ); IntelMobileString wsRtn = infoString; delete []infoString; return wsRtn.compare(IntelMobileText("true")) == 0 ? true : false; } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Network::Protocol802_11Instance"), IntelMobileText("ResetStatistics")); } else THROWNE(IntelMobileText("Intel::Mobile::Network::Protocol802_11Instance"), IntelMobileText("ResetStatistics")); return bValue;}//==============================================================================// ScanAPs()//==============================================================================Intel::Mobile::Network::ApStructVector Intel::Mobile::Network::Protocol802_11Instance::ScanAps(){ vector<ApStruct> ciVector; ApStructVector aiVector; if (m_pImpl) { Intel::Mobile::BaseAPI::InstanceObject *pAPI_Instance = reinterpret_cast<Intel::Mobile::BaseAPI::InstanceObject *>(m_pImpl); if (pAPI_Instance) { TRYBLOCK { IntelMobileChar data[8092]; IntelMobileChar* infoString = pAPI_Instance->InvokeMethod( IntelMobileText("ScanAps"), IntelMobileText("") ); //wcscpy( data, infoString ); strcpy( data, infoString ); delete[] infoString; IntelMobileChar line[256]; IntelMobileChar item[256]; IntelMobileChar itemitem[4]; IntelMobileString wstr; ApStruct sAPInfo; //IntelMobileChar* remain = wcsstr( data, IntelMobileText("<;>") ); IntelMobileChar* remain = strstr( data, IntelMobileText("<;>") ); while ( NULL != remain ) { size_t pos = remain - data + 1; //wcsncpy( line, data, pos - 1 ); strncpy( line, data, pos - 1 ); line[ pos -1 ] = 0; IntelMobileChar* itemremain; size_t itempos; unsigned char nEnumTemp; //itemremain = wcsstr( line, IntelMobileText("<,>" ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; wstr = item; CStringHelper::Str2Param( wstr, nEnumTemp ); sAPInfo.AuthenticationMode = nEnumTemp; strcpy( line, line+itempos+2 ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; //strcpy( sAPInfo.Ssid, item ); strcpy( sAPInfo.Ssid, item ); strcpy( line, line+itempos+2 ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; wstr = item; CStringHelper::Str2Param( wstr, sAPInfo.Rssi ); strcpy( line, line+itempos+2 ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; int j = 0; IntelMobileChar* itemitemremain = strstr( item, IntelMobileText("<:>") ); while ( NULL != itemitemremain ) { size_t itemitempos = itemitemremain - item + 1; strncpy( itemitem, item, itemitempos - 1 ); itemitem[ itemitempos -1 ] = 0; wstr = itemitem; CStringHelper::Str2Param( wstr, sAPInfo.Bssid[ j++ ] ); strcpy( item, item+itemitempos+2 ); itemitemremain = strstr( item, IntelMobileText("<:>") ); } strcpy( line, line+itempos+2 ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; wstr = item; CStringHelper::Str2Param( wstr, nEnumTemp ); sAPInfo.Band = nEnumTemp; strcpy( line, line+itempos+2 ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; wstr = item; CStringHelper::Str2Param( wstr, nEnumTemp ); sAPInfo.OperatingMode = nEnumTemp; strcpy( line, line+itempos+2 ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; wstr = item; CStringHelper::Str2Param( wstr, sAPInfo.Encrypted ); strcpy( line, line+itempos+2 ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; wstr = item; CStringHelper::Str2Param( wstr, sAPInfo.Channel ); strcpy( line, line+itempos+2 ); itemremain = strstr( line, IntelMobileText("<,>") ); itempos = itemremain - line + 1; strncpy( item, line, itempos - 1 ); item[ itempos-1 ] = 0; wstr = item; CStringHelper::Str2Param( wstr, nEnumTemp ); sAPInfo.EncryptionMode = nEnumTemp; strcpy( line, line+itempos+2 ); //ciVector.push_back( sAPInfo ); aiVector.Insert(sAPInfo); strcpy( data, data+pos+2 ); remain = strstr( data, IntelMobileText("<;>") ); } } CATCHBLOCK } else THROWNE(IntelMobileText("Intel::Mobile::Network::Protocol802_11Instance"), IntelMobileText("Scan")); } else THROWNE(IntelMobileText("Intel::Mobile::Network::Protocol802_11Instance"), IntelMobileText("Scan")); //return ApStructVector(ciVector); return aiVector;}// Generate VetorObject template
namespace Intel
{
namespace Mobile
{
namespace Network
{
GENERATE_VECTOROBJECT(ApStruct);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -