## configManager.h
#ifndef CONFIGACMUCONTROLLER_H
#define CONFIGACMUCONTROLLER_H
#include <string>
using namespace std;
class ConfigACMUController
{
public:
static ConfigACMUController * getInstance();
inline void setIsSetting(bool flag)
{
m_isSetting = flag;
}
inline bool isSetting()
{
return m_isSetting;
}
inline string getAcmuIP()
{
return m_acmu_ip;
}
inline string getExtIfIP()
{
return m_extif_ip;
}
void startConfig(string acmu_ip,string extif_ip);
static void * OnConfigAcmuThread(void * p);
void onReportStatus(int state,string content);
private:
ConfigACMUController();
bool m_isSetting;
pthread_t m_config_tid;
string m_acmu_ip;
string m_extif_ip;
};
#endif // CONFIGACMUCONTROLLER_H
## configManager.cpp
#include "configacmucontroller.h"
#include <unistd.h>
#include "ping_dev.h"
#include <string>
#include <iostream>
#include <stdarg.h>
#include "csettings.h"
using namespace std;
/**************************************************************************************************
* This Api is Used to Format String for C++.
***************************************************************************************************/
string formatString(const char* fmt, ...)
{
va_list args;
static char buffer[1024];
va_start(args, fmt);
vsnprintf((char *) buffer, 1024, (char *) fmt, args);
va_end(args);
return string(buffer);
}
static ConfigACMUController * gInstance = NULL;
/**************************************************************************************************
* This Api is Used to run the command by