public:
+ enum ConnectionType {WLAN, GPRS};
+ enum NetworkMode {NETWORK_UNKNOWN, NETWORK_2G, NETWORK_2_5G, NETWORK_3G, NETWORK_3_5G};
+ enum Error {NO_ERROR, NO_AVAILABLE_CONNECTIONS, INVALID_IAP, UNKNOWN_ERROR};
+
struct Connection
{
- QString serviceType;
- unsigned int serviceAttributes;
- QString serviceID;
- QString networkName;
- QString networkType;
- unsigned int networkAttributes;
- QByteArray networkID;
+ ConnectionType type;
+ QString id;
+ QString name;
+ int strength;
};
ConnectionManager(QObject* parent = 0);
void setBlocking(bool value);
bool connect();
bool connect(Connection const& connection);
+ bool connect(QString const& id);
+ bool getBestConnection(Connection& connection);
+ bool autoConnect();
bool disconnect(bool force = false);
bool isConnected();
bool scanConnections(QList<Connection>& connections);
- static unsigned int const TIMEOUT = 25000;
+ NetworkMode getNetworkMode();
+ Error error() const;
+ static unsigned int const TIMEOUT = 20000;
signals:
void connectReply(bool connected);
int numberOfConnections_;
int scannedConnections_;
int timer_;
+ Error error_;
QList<Connection>* connections_;
QDBusInterface* icd2interface_;
};