Commit e6cb60de authored by Julien Bonjean's avatar Julien Bonjean

[#1671] Updated files

parent 807ae2af
#include <global.h>
#include "networkmanager.h"
#include <iostream>
#include <instance.h>
#include "../manager.h"
#include "sip/sipvoiplink.h"
using namespace std;
//using namespace std;
const string NetworkManager::statesString[5] = {"unknown", "asleep", "connecting", "connected", "disconnected"};
const std::string NetworkManager::statesString[5] = {"unknown", "asleep", "connecting", "connected", "disconnected"};
string NetworkManager::stateAsString(const uint32_t& state)
std::string NetworkManager::stateAsString(const uint32_t& state)
{
return statesString[state];
}
void NetworkManager::StateChanged(const uint32_t& state)
{
std::cout << "state changed: " << stateAsString(state) << std::endl;
_debug("Network state changed: %s", stateAsString(state));
if(state == NM_STATE_CONNECTED)
Manager::instance().restartPJSIP();
}
NetworkManager::NetworkManager(DBus::Connection& connection, const DBus::Path& path, const char* destination): DBus::ObjectProxy (connection, path, destination)
{
}
......
......@@ -16,14 +16,14 @@ public:
void StateChanged(const uint32_t& state);
string stateAsString(const uint32_t& state);
typedef enum NMState
enum NMState
{
NM_STATE_UNKNOWN = 0,
NM_STATE_ASLEEP,
NM_STATE_CONNECTING,
NM_STATE_CONNECTED,
NM_STATE_DISCONNECTED
} NMState;
};
static const string statesString[5];
};
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment