Bit de présence internet
This commit is contained in:
parent
32a0f76bf2
commit
1f3a7dd270
@ -3,8 +3,8 @@
|
||||
|
||||
CDeviceDetectionConfig::CDeviceDetectionConfig()
|
||||
{
|
||||
mInternetDetectionCANStatusBit = 31;
|
||||
mMQTTDetectionCANStatusBit = 31;
|
||||
mInternetDetectionCANStatusBit = 32;
|
||||
mMQTTDetectionCANStatusBit = 33;
|
||||
for(int i = 0; i < MAX_NB_LAN_DEVICE_DETECTION; i++)
|
||||
{
|
||||
mLANDeviceDetectConfigList.append(CLANDevicePresenceConfig());
|
||||
|
||||
@ -37,8 +37,10 @@ bool CInternetMonitor::IsInternetActive()
|
||||
return mInternetActive;
|
||||
}
|
||||
|
||||
int CInternetMonitor::Start()
|
||||
int CInternetMonitor::Start(quint64 CANReportingBit)
|
||||
{
|
||||
mCANReportingMask = 1;
|
||||
mCANReportingMask <<= CANReportingBit;
|
||||
CheckInternet();
|
||||
return RET_OK;
|
||||
}
|
||||
@ -101,3 +103,13 @@ void CInternetMonitor::ConnectionTimerExpired()
|
||||
}
|
||||
mInternetActive = false;
|
||||
}
|
||||
|
||||
quint64 CInternetMonitor::GetCANInternetStatusMask()
|
||||
{
|
||||
if(mInternetActive == true)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
return mCANReportingMask;
|
||||
}
|
||||
|
||||
@ -14,13 +14,15 @@ class CInternetMonitor : public QObject
|
||||
public:
|
||||
explicit CInternetMonitor(QObject *parent = 0);
|
||||
~CInternetMonitor();
|
||||
int Start();
|
||||
int Start(quint64 CANReportingBit);
|
||||
bool IsInternetActive();
|
||||
quint64 GetCANInternetStatusMask();
|
||||
|
||||
private:
|
||||
QNetworkAccessManager *mNetMgr;
|
||||
bool mInternetActive;
|
||||
QTimer *mCheckInternetStateTimer, *mConnectionTimer;
|
||||
quint64 mCANReportingMask;
|
||||
|
||||
int CheckInternet();
|
||||
|
||||
|
||||
@ -124,7 +124,7 @@ int COtarcikCan::Start()
|
||||
|
||||
connect(&mInternetMonitor,&CInternetMonitor::InternetStateChanged,mMainWindow.mGeneralStatusPage,&CGeneralStatusPage::InternetStatusChanged);
|
||||
connect(&mInternetMonitor,&CInternetMonitor::InternetStateChanged,mMainWindow.mDataLoggingSettingsPage,&CLoggingSettingsPage::SetInternetPresenceStatus);
|
||||
mInternetMonitor.Start();
|
||||
mInternetMonitor.Start(mSystemConfig.mDeviceDetectionParams.mInternetDetectionCANStatusBit);
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user