📄 instance_bandwidth.cpp
字号:
this->SetValueImpl( pSystemRxRate /1000); } catch(ServerException se) { if (se.IfServerBaseObjectException()) { ServerException nse(IntelMobileText("80043286")); nse.SetParent( &se ); throw nse; } throw se; } catch(...) { //THROWIMEXCEPTION(80043286); }}void BandwidthFastestProtocolClass::GetValueImpl(){ try { /* ServerNetworkAdapterInstanceObject *pNetworkAdapterInstance; long iChangedIndex = 0; // to act like client int iEnumIndex = 0; unsigned __int64 pFastestTxRate = 0; IntelMobileString sFastestProtocolKey; ServerInstanceCollection* pNetworkAdapterInstanceCollection = NULL; if (pNetworkAdapterInstanceCollection = ((ServerNetworkAdapterClassObject&)(GetLayer()->GetLayerClassObject(IntelMobileText("NetworkAdapter"))).GetInstances()) { pNetworkAdapterInstanceCollection->Reset(&iChangedIndex); bool bHasNext; if ( bHasNext = pNetworkAdapterInstanceCollection->HasNext(iEnumIndex, iChangedIndex )) { while ( bHasNext ) { if ( !pNetworkAdapterInstanceCollection->Next( (ServerInstanceObject**)&pNetworkAdapterInstance, &iEnumIndex, iChangedIndex ) ) break; else { for (unsigned int i =0; i < pNetworkAdapterInstance->Protocols.GetSize();i++) { if (pFastestTxRate < ((BandwidthInstanceObject*)(this->_pThis))->GetTxRateByProtocol(pNetworkAdapterInstance->Protocols.GetValue(i))) { pFastestTxRate = ((BandwidthInstanceObject*)(this->_pThis))->GetTxRateByProtocol(pNetworkAdapterInstance->Protocols.GetValue(i)); sFastestProtocolKey = pNetworkAdapterInstance->Protocols.GetValue(i); } } } if (!(bHasNext = pNetworkAdapterInstanceCollection->HasNext( iEnumIndex, iChangedIndex ))) break; } } this->SetValue(sFastestProtocolKey); } else this->SetNull(true); */ ServerLinkProtocolInstanceObject *pLinkProtocolInstance; long iChangedIndex = 0; // to act like client int iEnumIndex = 0; unsigned __int64 pFastestTxRate = 0; IntelMobileString sFastestProtocolKey; //SCR Id 964 //Title: FastestProtocol return "" when there is no linkprotocol bool bFound = false; ServerInstanceCollection* pLinkProtocolInstanceCollection = NULL; if (pLinkProtocolInstanceCollection = ((ServerLinkProtocolClassObject&)(GetLayer()->GetLayerClassObject(IntelMobileText("LinkProtocol")))).GetInstances()) { pLinkProtocolInstanceCollection->Reset(&iChangedIndex); bool bHasNext; if ( bHasNext = pLinkProtocolInstanceCollection->HasNext(iEnumIndex, iChangedIndex )) { while ( bHasNext ) { if ( !pLinkProtocolInstanceCollection->Next( (ServerInstanceObject**)&pLinkProtocolInstance, &iEnumIndex, iChangedIndex ) ) break; else { //if (pFastestTxRate < ((BandwidthInstanceObject*)(this->_pThis))->GetTxRateByProtocol(pLinkProtocolInstance->GetKey())) if (pFastestTxRate < (GetTxRateByProtocol(pLinkProtocolInstance->GetKey()))) { //pFastestTxRate = ((BandwidthInstanceObject*)(this->_pThis))->GetTxRateByProtocol(pLinkProtocolInstance->GetKey()); pFastestTxRate = GetTxRateByProtocol(pLinkProtocolInstance->GetKey()); sFastestProtocolKey = pLinkProtocolInstance->GetKey(); bFound = true; } //else if (pFastestTxRate == ((BandwidthInstanceObject*)(this->_pThis))->GetTxRateByProtocol(pLinkProtocolInstance->GetKey())) else if ( (GetTxRateByProtocol(pLinkProtocolInstance->GetKey())) != 0 && pFastestTxRate == (GetTxRateByProtocol(pLinkProtocolInstance->GetKey()))) { if(pLinkProtocolInstance->GetType() == IntelMobileText("Protocol802_3")) { if (((GetLayer()->GetLayerClassObject(IntelMobileText("LinkProtocol"))).GetInstance(sFastestProtocolKey))->GetType() == IntelMobileText("Protocol802_11")) { sFastestProtocolKey = pLinkProtocolInstance->GetKey(); bFound = true; } } else if (pLinkProtocolInstance->GetType() == IntelMobileText("Protocol802_11")) { if (((GetLayer()->GetLayerClassObject(IntelMobileText("LinkProtocol"))).GetInstance(sFastestProtocolKey))->GetType() == IntelMobileText("Protocol802_11")) { ServerProtocol802_11InstanceObject *temp = (ServerProtocol802_11InstanceObject *)((GetLayer()->GetLayerClassObject(IntelMobileText("Protocol802_11"))).GetInstance(pLinkProtocolInstance->GetKey())); if ((temp->Rssi.GetValue()) > (((ServerProtocol802_11InstanceObject *)(GetLayer()->GetLayerClassObject(IntelMobileText("Protocol802_11"))).GetInstance(sFastestProtocolKey))->Rssi.GetValue())) { sFastestProtocolKey = pLinkProtocolInstance->GetKey(); bFound = true; } } } } } if (!(bHasNext = pLinkProtocolInstanceCollection->HasNext( iEnumIndex, iChangedIndex ))) break; } } } if(bFound) this->SetValueImpl(sFastestProtocolKey); else this->SetNull(true); } catch(ServerException se) { if (se.IfServerBaseObjectException()) { ServerException nse(IntelMobileText("80043287")); nse.SetParent( &se ); throw nse; } throw se; } catch(...) { //THROWIMEXCEPTION(80043287); }}void BandwidthLimitTxClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); unsigned __int32 ret; float processTxLimit = 0; ret = ::GetProcLimitTx(processId, &processTxLimit); if (ret >BW_RET_FALSE) this->SetNull(true); else if (ret == BW_RET_OK || ret == BW_RET_FALSE) this->SetValueImpl(processTxLimit); } catch(...) { //THROWIMEXCEPTION(80043299); }}bool BandwidthLimitTxClass::SetValueImplOnDevice ( IntelMobileFloat value){ try { unsigned __int32 processId = ::GetCurrentProcessId(); if ((::SetProcLimitTx(processId,value)) == BW_RET_OK) return true; else return false; } catch(...) { //THROWIMEXCEPTION(800432A6); }}void BandwidthLimitRxClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); float processRxLimit = 0; if ((::GetProcLimitRx(processId, &processRxLimit)) == BW_RET_OK || (::GetProcLimitRx(processId, &processRxLimit)) == BW_RET_FALSE) this->SetValueImpl(processRxLimit); else this->SetNull(true); } catch(...) { //THROWIMEXCEPTION(8004329A); }}bool BandwidthLimitRxClass::SetValueImplOnDevice ( IntelMobileFloat value ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); if ((::SetProcLimitRx(processId,value)) == BW_RET_OK) return true; else return false; } catch(...) { //THROWIMEXCEPTION(800432A7); }}void BandwidthPercentTxClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); float processTxPercent = 0; if((::GetProcPercentTx(processId,&processTxPercent)) == BW_RET_OK) this->SetValueImpl(processTxPercent*100); else this->SetNull( true ); } catch(...) { //THROWIMEXCEPTION(8004329B); }}bool BandwidthPercentTxClass::SetValueImplOnDevice ( IntelMobileFloat value ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); if ((::SetProcPercentTx(processId,value/100)) == BW_RET_OK) return true; else return false; } catch(...) { //THROWIMEXCEPTION(800432A8); }}void BandwidthPercentRxClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); float processRxPercent = 0; if((::GetProcPercentRx(processId,&processRxPercent)) == BW_RET_OK) this->SetValueImpl(processRxPercent*100); else this->SetNull( true ); } catch(...) { //THROWIMEXCEPTION(8004329C); }}bool BandwidthPercentRxClass::SetValueImplOnDevice ( IntelMobileFloat value ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); if ((::SetProcPercentRx(processId,value/100)) == BW_RET_OK) return true; else return false; } catch(...) { //THROWIMEXCEPTION(800432A9); }}void BandwidthRateTxClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); float processTxRate = 0; if ((::GetProcMeasuredRateTx(processId,&processTxRate)) == BW_RET_OK) this->SetValueImpl(processTxRate); else this->SetNull( true ); } catch(...) { //THROWIMEXCEPTION(8004329D); }}void BandwidthRateRxClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); float processRxRate = 0; if ((::GetProcMeasuredRateRx(processId,&processRxRate)) == BW_RET_OK) this->SetValueImpl(processRxRate); else this->SetNull( true ); } catch(...) { //THROWIMEXCEPTION(8004329E); }}void BandwidthLimitedTxClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); ProcEntry processEntry; if ((::GetProc(processId, &processEntry)) == BW_RET_OK) this->SetValueImpl(processEntry.Stats.Tx.Limited); else this->SetNull( true ); } catch(...) { //THROWIMEXCEPTION(8004329F); }}bool BandwidthLimitedTxClass::SetValueImplOnDevice ( IntelMobileBool value ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); if (value) { if ((::EnableProcLimitTx(processId, false)) == BW_RET_OK) return true; else return false; } else { if((::DisableProcLimitTx(processId,false)) == BW_RET_OK) return true; else return false; } } catch(...) { //THROWIMEXCEPTION(800432AA); }}void BandwidthLimitedRxClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); ProcEntry processEntry; if ((::GetProc(processId, &processEntry)) == BW_RET_OK) this->SetValueImpl(processEntry.Stats.Rx.Limited); else this->SetNull( true ); } catch(...) { //THROWIMEXCEPTION(800432A0); }}bool BandwidthLimitedRxClass::SetValueImplOnDevice ( IntelMobileBool value){ try { unsigned __int32 processId = ::GetCurrentProcessId(); if (value) { if ((::EnableProcLimitRx(processId, false)) == BW_RET_OK) return true; else return false; } else { if((::DisableProcLimitRx(processId,false)) == BW_RET_OK) return true; else return false; } } catch(...) { //THROWIMEXCEPTION(800432AB); }}void BandwidthAdaptiveClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); ProcEntry processEntry; if ((::GetProc(processId, &processEntry)) == BW_RET_OK) this->SetValueImpl(processEntry.Stats.Adaptive); else this->SetNull( true ); } catch(...) { //THROWIMEXCEPTION(800432A3); }}bool BandwidthAdaptiveClass::SetValueImplOnDevice ( IntelMobileBool value){ try { unsigned __int32 processId = ::GetCurrentProcessId(); if (value) { if ((::EnableProcAdaptive(processId, false)) == BW_RET_OK) return true; else return false; } else { if((::DisableProcAdaptive(processId,false)) == BW_RET_OK) return true; else return false; } } catch(...) { //THROWIMEXCEPTION(800432AC); }}void BandwidthAdaptivelyLimitableClass::GetValueImpl( ){ try { unsigned __int32 processId = ::GetCurrentProcessId(); ProcEntry processEntry; if ((::GetProc(processId, &processEntry)) == BW_RET_OK) this->SetValueImpl(processEntry.Stats.AdaptivelyLimitable); else this->SetNull( true ); } catch(...) { //THROWIMEXCEPTION(800432A4); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -