Added namespace 'TelldusCore' to classes in library telldus-core
This commit is contained in:
parent
df4615f8f8
commit
f1e9f2f9f2
14 changed files with 144 additions and 114 deletions
|
@ -1,11 +1,12 @@
|
|||
#include "Device.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
using namespace TelldusCore;
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
Device::Device(int model)
|
||||
: model(model)
|
||||
Device::Device(int m)
|
||||
: model(m)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@
|
|||
#include <string>
|
||||
//#include <QMutex>
|
||||
|
||||
namespace TelldusCore {
|
||||
|
||||
class Device
|
||||
{
|
||||
public:
|
||||
|
@ -31,3 +33,5 @@ private:
|
|||
int model;
|
||||
// static QMutex deviceMutex;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
#define strcasecmp(x, y) _strcmpi(x, y)
|
||||
#endif
|
||||
|
||||
using namespace TelldusCore;
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "Device.h"
|
||||
#include <string>
|
||||
|
||||
namespace TelldusCore {
|
||||
|
||||
class DeviceIkea : public Device
|
||||
{
|
||||
public:
|
||||
|
@ -22,3 +24,4 @@ protected:
|
|||
std::string getStringCode(unsigned char);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -6,6 +6,8 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using namespace TelldusCore;
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
*/
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "Device.h"
|
||||
#include <string>
|
||||
|
||||
namespace TelldusCore {
|
||||
|
||||
class DeviceNexa : public Device
|
||||
{
|
||||
public:
|
||||
|
@ -21,3 +23,4 @@ protected:
|
|||
std::string getStringCode(int);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#include <algorithm>
|
||||
#include <fstream>
|
||||
|
||||
using namespace std;
|
||||
using namespace TelldusCore;
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
|
@ -70,7 +70,7 @@ int DeviceSartano::methods(int){
|
|||
/*
|
||||
* Convert an integer to byte string where 0 is represented by $k and 1 by k$, reversed and padded with 0's as needed
|
||||
*/
|
||||
string DeviceSartano::getStringCode(void){
|
||||
std::string DeviceSartano::getStringCode(void){
|
||||
|
||||
std::string strReturn = strCode;
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
#include "Device.h"
|
||||
#include <string>
|
||||
|
||||
namespace TelldusCore {
|
||||
|
||||
class DeviceSartano : public Device
|
||||
{
|
||||
|
@ -18,3 +19,5 @@ protected:
|
|||
std::string getStringCode(void);
|
||||
std::string strCode;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
|
||||
using namespace std;
|
||||
using namespace TelldusCore;
|
||||
|
||||
/*
|
||||
* Constructor
|
||||
|
@ -21,8 +21,8 @@ DeviceWaveman::DeviceWaveman(int model, const std::string &strHouse, const std::
|
|||
int DeviceWaveman::turnOff(void){
|
||||
|
||||
try{
|
||||
string strCode = getStringCode(intHouse);
|
||||
string strUnit = getStringCode(intCode);
|
||||
std::string strCode = getStringCode(intHouse);
|
||||
std::string strUnit = getStringCode(intCode);
|
||||
strCode.append(strUnit);
|
||||
|
||||
strCode.insert(0, "S");
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#include "DeviceNexa.h"
|
||||
#include <string>
|
||||
|
||||
namespace TelldusCore {
|
||||
|
||||
class DeviceWaveman : public DeviceNexa
|
||||
{
|
||||
public:
|
||||
|
@ -9,3 +11,5 @@ public:
|
|||
virtual int turnOff(void);
|
||||
virtual int methods(int methodsSupported);
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -25,6 +25,8 @@
|
|||
#define strcasecmp _stricmp
|
||||
#endif
|
||||
|
||||
using namespace TelldusCore;
|
||||
|
||||
Manager *Manager::instance = 0;
|
||||
|
||||
Manager::Manager() {
|
||||
|
|
|
@ -14,6 +14,8 @@
|
|||
|
||||
#include "Settings.h"
|
||||
#include <map>
|
||||
|
||||
namespace TelldusCore {
|
||||
class Device;
|
||||
|
||||
typedef std::map<int, Device *> DeviceMap;
|
||||
|
@ -38,5 +40,6 @@ private:
|
|||
|
||||
static Manager *instance;
|
||||
};
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
|
@ -5,6 +5,8 @@
|
|||
#include <string.h>
|
||||
#include <errno.h>
|
||||
|
||||
using namespace TelldusCore;
|
||||
|
||||
/*
|
||||
* Send message to the USB dongle
|
||||
*/
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
void handleException(std::exception e);
|
||||
using namespace std;
|
||||
using namespace TelldusCore;
|
||||
|
||||
inline char *wrapStdString( const std::string &string);
|
||||
|
||||
|
@ -465,8 +466,8 @@ char * WINAPI tdGetErrorString(int intErrorNo) {
|
|||
//*
|
||||
void handleException(exception e){
|
||||
|
||||
std::string strLogName = "errorlog.txt";
|
||||
//char* strLogName = "";
|
||||
// std::string strLogName = "errorlog.txt";
|
||||
std::string strLogName = "";
|
||||
|
||||
if(strLogName.length() > 0){
|
||||
ofstream errorfile(strLogName.c_str(), ios::app);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue