This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
powersync-app/libnymea-app/connection/networkreachabilitymonitor.h
2022-09-06 11:34:17 +02:00

35 lines
1.0 KiB
C++

#ifndef NETWORKREACHABILITYMONITOR_H
#define NETWORKREACHABILITYMONITOR_H
#include <QObject>
#include <QNetworkConfigurationManager>
#include "nymeaconnection.h"
class NetworkReachabilityMonitor : public QObject
{
Q_OBJECT
Q_PROPERTY(NymeaConnection::BearerTypes availableBearerTypes READ availableBearerTypes NOTIFY availableBearerTypesChanged)
public:
explicit NetworkReachabilityMonitor(QObject *parent = nullptr);
NymeaConnection::BearerTypes availableBearerTypes() const;
signals:
void availableBearerTypesChanged();
void availableBearerTypesUpdated(); // Does not necessarily mean they changed, but they're reasonably up to date now.
private slots:
void updateActiveBearers();
private:
NymeaConnection::BearerType qBearerTypeToNymeaBearerType(QNetworkConfiguration::BearerType type) const;
private:
QNetworkConfigurationManager *m_networkConfigManager = nullptr;
NymeaConnection::BearerTypes m_availableBearerTypes = NymeaConnection::BearerTypeNone;
};
#endif // NETWORKREACHABILITYMONITOR_H