Include the directory when naming .h files. According to Google style guideline "build/include".

This commit is contained in:
Micke Prag 2012-06-19 11:15:24 +02:00
parent 3101fd0969
commit 5b5be387cd
91 changed files with 302 additions and 300 deletions

View file

@ -24,9 +24,7 @@ SET( telldus-core_PUB_HDRS
FIND_PACKAGE(Threads)
LIST(APPEND telldus-core_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/../common
)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
######## Configurable options for the platform ########

View file

@ -7,7 +7,7 @@
*
*/
#include "CallbackDispatcher.h"
#include "client/CallbackDispatcher.h"
using namespace TelldusCore;

View file

@ -10,11 +10,11 @@
#ifndef CALLBACKDISPATCHER_H
#define CALLBACKDISPATCHER_H
#include "common.h"
#include "Event.h"
#include "Thread.h"
#include "Mutex.h"
#include "telldus-core.h"
#include "common/common.h"
#include "common/Event.h"
#include "common/Thread.h"
#include "common/Mutex.h"
#include "client/telldus-core.h"
namespace TelldusCore {

View file

@ -7,7 +7,7 @@
*
*/
#include "CallbackMainDispatcher.h"
#include "client/CallbackMainDispatcher.h"
#include <list>

View file

@ -10,10 +10,10 @@
#ifndef CALLBACKMAINDISPATCHER_H
#define CALLBACKMAINDISPATCHER_H
#include "CallbackDispatcher.h"
#include "Thread.h"
#include "Event.h"
#include "EventHandler.h"
#include "client/CallbackDispatcher.h"
#include "common/Thread.h"
#include "common/Event.h"
#include "common/EventHandler.h"
namespace TelldusCore {

View file

@ -1,12 +1,13 @@
#include "Client.h"
#include "CallbackDispatcher.h"
#include "CallbackMainDispatcher.h"
#include "Socket.h"
#include "Strings.h"
#include "Mutex.h"
#include "client/Client.h"
#include <list>
#include "client/CallbackDispatcher.h"
#include "client/CallbackMainDispatcher.h"
#include "common/Socket.h"
#include "common/Strings.h"
#include "common/Mutex.h"
using namespace TelldusCore;
class Client::PrivateData {

View file

@ -1,10 +1,10 @@
#ifndef CLIENT_H
#define CLIENT_H
#include "Message.h"
#include "telldus-core.h"
#include "Thread.h"
#include "CallbackDispatcher.h"
#include "client/telldus-core.h"
#include "client/CallbackDispatcher.h"
#include "common/Message.h"
#include "common/Thread.h"
namespace TelldusCore {
class Client : public Thread

View file

@ -4,16 +4,15 @@
* @{
*/
#include "telldus-core.h"
#include "common.h"
#include "Client.h"
#include "Message.h"
#include "Socket.h"
#include <stdlib.h>
#include "client/telldus-core.h"
#include "client/Client.h"
#include "common/common.h"
#include "common/Message.h"
#include "common/Socket.h"
using namespace TelldusCore;
/**
* @name Device method flags
* Flags for the different methods/commands a device can support. Can be used

View file

@ -22,6 +22,8 @@ SET( telldus-common_HDRS
Thread.h
)
INCLUDE_DIRECTORIES( ${CMAKE_SOURCE_DIR} )
######## Configurable options for the platform ########

View file

@ -1,6 +1,6 @@
#include "Event.h"
#include "EventHandler.h"
#include "Mutex.h"
#include "common/Event.h"
#include "common/EventHandler.h"
#include "common/Mutex.h"
#include <list>

View file

@ -11,6 +11,7 @@
#include <tr1/memory>
typedef void* EVENT_T;
#endif
#include "common/Thread.h"
namespace TelldusCore {
class EventHandler;

View file

@ -1,7 +1,7 @@
#ifndef EVENTHANDLER_H
#define EVENTHANDLER_H
#include "Event.h"
#include "common/Event.h"
namespace TelldusCore {

View file

@ -1,10 +1,10 @@
#include "EventHandler.h"
#include "Event.h"
#include "Mutex.h"
#include "Thread.h"
#include <list>
#include <pthread.h>
#include <stdio.h>
#include <list>
#include "common/EventHandler.h"
#include "common/Event.h"
#include "common/Mutex.h"
#include "common/Thread.h"
using namespace TelldusCore;

View file

@ -1,6 +1,6 @@
#include "Event.h"
#include "EventHandler.h"
#include "Thread.h"
#include "common/Event.h"
#include "common/EventHandler.h"
#include "common/Thread.h"
using namespace TelldusCore;

View file

@ -1,9 +1,9 @@
#include "Message.h"
#include "Socket.h"
#include "Strings.h"
#include <sstream>
#include <wctype.h>
#include <stdlib.h>
#include <sstream>
#include "common/Message.h"
#include "common/Socket.h"
#include "common/Strings.h"
using namespace TelldusCore;
@ -63,7 +63,7 @@ void Message::addSpecialArgument(const std::wstring &value){
this->append(st.str());
this->append(L":");
this->append(value);
}
}
@ -77,7 +77,7 @@ void Message::addSpecialArgument(int value){
this->append(L"i");
//this->append(st.str());
this->append(L"s");
}
}
*/
@ -106,7 +106,7 @@ bool Message::nextIsString(const std::wstring &message) {
}
std::wstring Message::takeString(std::wstring *message) {
if (!Message::nextIsString(*message)) {
return L"";
}

View file

@ -10,8 +10,7 @@
//
//
#include "Mutex.h"
#include "common.h"
#include "common/Mutex.h"
using namespace TelldusCore;
@ -23,6 +22,8 @@ using namespace TelldusCore;
typedef pthread_mutex_t MUTEX_T;
#endif
#include "common/common.h"
class Mutex::PrivateData {
public:
MUTEX_T mutex;

View file

@ -1,7 +1,3 @@
#include "Socket.h"
#include "Mutex.h"
#include "Strings.h"
#include <stdio.h>
#include <unistd.h>
@ -9,6 +5,10 @@
#include <sys/un.h>
#include <math.h>
#include "common/Socket.h"
#include "common/Mutex.h"
#include "common/Strings.h"
#define BUFSIZE 512
using namespace TelldusCore;

View file

@ -1,5 +1,4 @@
#include "Strings.h"
#include "common/Strings.h"
#include <algorithm>
#include <sstream>
#include <string>

View file

@ -10,11 +10,11 @@
//
//
#include "Thread.h"
#include "common/Thread.h"
#ifdef _WINDOWS
#include <windows.h>
#endif
#include "EventHandler.h"
#include "common/EventHandler.h"
using namespace TelldusCore;

View file

@ -13,7 +13,7 @@
#define THREAD_H
#include <string>
#include "Mutex.h"
#include "common/Mutex.h"
namespace TelldusCore {
class ThreadPrivate;

View file

@ -22,6 +22,7 @@
#include <string.h>
#include <string>
#include <stdarg.h>
#include "common/Strings.h"
inline void msleep( const int msec) {
#ifdef _WINDOWS

View file

@ -88,9 +88,7 @@ SET( telldus-service_HDRS
FIND_PACKAGE(Threads REQUIRED)
LIST(APPEND telldus-service_LIBRARIES ${CMAKE_THREAD_LIBS_INIT})
INCLUDE_DIRECTORIES(
${CMAKE_CURRENT_SOURCE_DIR}/../common
)
INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR})
######## Configurable options for the platform ########
@ -250,7 +248,7 @@ IF (UNIX AND NOT APPLE)
SET(STATE_INSTALL_DIR "${DEFAULT_STATE_INSTALL_DIR}" CACHE PATH "The directory to store state information of the devices")
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/SettingsConfusePaths.h.in
${CMAKE_CURRENT_BINARY_DIR}/SettingsConfusePaths.h)
${CMAKE_CURRENT_BINARY_DIR}/service/SettingsConfusePaths.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INSTALL(FILES tellstick.conf

View file

@ -1,6 +1,6 @@
#include "ClientCommunicationHandler.h"
#include "Message.h"
#include "Strings.h"
#include "common/Message.h"
#include "common/Strings.h"
#include <stdlib.h>

View file

@ -2,11 +2,11 @@
#define CLIENTCOMMUNICATIONHANDLER_H
#include <string>
#include "Thread.h"
#include "Socket.h"
#include "Event.h"
#include "DeviceManager.h"
#include "ControllerManager.h"
#include "common/Thread.h"
#include "common/Socket.h"
#include "common/Event.h"
#include "service/DeviceManager.h"
#include "service/ControllerManager.h"
class ClientCommunicationHandler : public TelldusCore::Thread
{

View file

@ -2,8 +2,8 @@
#define CONNECTIONLISTENER_H
#include <string>
#include "Thread.h"
#include "Event.h"
#include "common/Thread.h"
#include "common/Event.h"
class Event;
namespace TelldusCore {

View file

@ -1,5 +1,5 @@
#include "ConnectionListener.h"
#include "Socket.h"
#include "service/ConnectionListener.h"
#include "common/Socket.h"
#include <string>
#include <sys/socket.h>

View file

@ -1,7 +1,7 @@
#include "Controller.h"
#include "Protocol.h"
#include "EventUpdateManager.h"
#include "Strings.h"
#include "service/Controller.h"
#include "service/Protocol.h"
#include "service/EventUpdateManager.h"
#include "common/Strings.h"
class Controller::PrivateData {
public:

View file

@ -1,7 +1,7 @@
#ifndef CONTROLLER_H
#define CONTROLLER_H
#include "Event.h"
#include "common/Event.h"
#include <string>
class ControllerEventData : public TelldusCore::EventDataBase {

View file

@ -1,8 +1,8 @@
#ifndef CONTROLLERLISTENER_H
#define CONTROLLERLISTENER_H
#include "Thread.h"
#include "Event.h"
#include "common/Thread.h"
#include "common/Event.h"
class ControllerChangeEventData : public TelldusCore::EventDataBase {
public:

View file

@ -1,13 +1,13 @@
#include "ControllerManager.h"
#include "Controller.h"
#include "Mutex.h"
#include "TellStick.h"
#include "Log.h"
#include "Message.h"
#include "Strings.h"
#include "Settings.h"
#include "EventUpdateManager.h"
#include "../client/telldus-core.h"
#include "service/ControllerManager.h"
#include "service/Controller.h"
#include "common/Mutex.h"
#include "service/TellStick.h"
#include "service/Log.h"
#include "common/Message.h"
#include "common/Strings.h"
#include "service/Settings.h"
#include "service/EventUpdateManager.h"
#include "client/telldus-core.h"
#include <map>
#include <stdio.h>

View file

@ -1,7 +1,7 @@
#ifndef CONTROLLERMANAGER_H
#define CONTROLLERMANAGER_H
#include "Event.h"
#include "common/Event.h"
class Controller;
#include <string>

View file

@ -1,8 +1,8 @@
#include "ControllerMessage.h"
#include "Device.h"
#include "Strings.h"
#include "service/ControllerMessage.h"
#include "service/Device.h"
#include "common/Strings.h"
#include "common.h"
#include "common/common.h"
#include <map>

View file

@ -1,6 +1,6 @@
#include "Device.h"
#include "Settings.h"
#include "TellStick.h"
#include "service/Device.h"
#include "service/Settings.h"
#include "service/TellStick.h"
class Device::PrivateData {
public:

View file

@ -1,9 +1,9 @@
#ifndef DEVICE_H
#define DEVICE_H
#include "Controller.h"
#include "Mutex.h"
#include "Protocol.h"
#include "service/Controller.h"
#include "common/Mutex.h"
#include "service/Protocol.h"
#include <string>
#include <list>
@ -34,7 +34,7 @@ public:
static int maskUnsupportedMethods(int methods, int supportedMethods);
static int methodId( const std::string &methodName );
private:
Protocol *retrieveProtocol() const;

View file

@ -1,11 +1,11 @@
#include "DeviceManager.h"
#include "ControllerMessage.h"
#include "Mutex.h"
#include "Sensor.h"
#include "Settings.h"
#include "Strings.h"
#include "Message.h"
#include "Log.h"
#include "service/DeviceManager.h"
#include "service/ControllerMessage.h"
#include "common/Mutex.h"
#include "service/Sensor.h"
#include "service/Settings.h"
#include "common/Strings.h"
#include "common/Message.h"
#include "service/Log.h"
#include <map>
#include <memory>

View file

@ -1,10 +1,10 @@
#ifndef DEVICEMANAGER_H
#define DEVICEMANAGER_H
#include "Device.h"
#include "ControllerManager.h"
#include "ControllerMessage.h"
#include "EventUpdateManager.h"
#include "service/Device.h"
#include "service/ControllerManager.h"
#include "service/ControllerMessage.h"
#include "service/EventUpdateManager.h"
#include <set>
class Sensor;

View file

@ -1,9 +1,9 @@
#include "EventUpdateManager.h"
#include "service/EventUpdateManager.h"
#include "ConnectionListener.h"
#include "EventHandler.h"
#include "Message.h"
#include "Socket.h"
#include "service/ConnectionListener.h"
#include "common/EventHandler.h"
#include "common/Message.h"
#include "common/Socket.h"
#include <list>
#include <memory>

View file

@ -1,8 +1,8 @@
#ifndef EVENTUPDATEMANAGER_H
#define EVENTUPDATEMANAGER_H
#include "Thread.h"
#include "Event.h"
#include "common/Thread.h"
#include "common/Event.h"
class EventUpdateData : public TelldusCore::EventDataBase {
public:

View file

@ -1,12 +1,12 @@
#include "Log.h"
#include "service/Log.h"
#include <stdarg.h>
#if defined(_LINUX)
#include <syslog.h>
#elif defined(_WINDOWS)
#include <windows.h>
#include "Strings.h"
#include "Messages.h"
#include "service/Strings.h"
#include "service/Messages.h"
#endif
class Log::PrivateData {

View file

@ -1,28 +1,28 @@
#include "Protocol.h"
#include "../client/telldus-core.h"
#include "service/Protocol.h"
#include "client/telldus-core.h"
#include "ControllerMessage.h"
#include "ProtocolBrateck.h"
#include "ProtocolComen.h"
#include "ProtocolEverflourish.h"
#include "ProtocolFineoffset.h"
#include "ProtocolFuhaote.h"
#include "ProtocolGroup.h"
#include "ProtocolHasta.h"
#include "ProtocolIkea.h"
#include "ProtocolMandolyn.h"
#include "ProtocolNexa.h"
#include "ProtocolOregon.h"
#include "ProtocolRisingSun.h"
#include "ProtocolSartano.h"
#include "ProtocolScene.h"
#include "ProtocolSilvanChip.h"
#include "ProtocolUpm.h"
#include "ProtocolWaveman.h"
#include "ProtocolX10.h"
#include "ProtocolYidong.h"
#include "service/ControllerMessage.h"
#include "service/ProtocolBrateck.h"
#include "service/ProtocolComen.h"
#include "service/ProtocolEverflourish.h"
#include "service/ProtocolFineoffset.h"
#include "service/ProtocolFuhaote.h"
#include "service/ProtocolGroup.h"
#include "service/ProtocolHasta.h"
#include "service/ProtocolIkea.h"
#include "service/ProtocolMandolyn.h"
#include "service/ProtocolNexa.h"
#include "service/ProtocolOregon.h"
#include "service/ProtocolRisingSun.h"
#include "service/ProtocolSartano.h"
#include "service/ProtocolScene.h"
#include "service/ProtocolSilvanChip.h"
#include "service/ProtocolUpm.h"
#include "service/ProtocolWaveman.h"
#include "service/ProtocolX10.h"
#include "service/ProtocolYidong.h"
#include "Strings.h"
#include "common/Strings.h"
#include <sstream>
class Protocol::PrivateData {

View file

@ -4,7 +4,7 @@
#include <string>
#include <list>
#include <map>
#include "../client/telldus-core.h"
#include "client/telldus-core.h"
typedef std::map<std::wstring, std::wstring> ParameterMap;

View file

@ -1,4 +1,4 @@
#include "ProtocolBrateck.h"
#include "service/ProtocolBrateck.h"
int ProtocolBrateck::methods() const {
return TELLSTICK_UP | TELLSTICK_DOWN | TELLSTICK_STOP;

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLBRATECK_H
#define PROTOCOLBRATECK_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolBrateck : public Protocol
{

View file

@ -1,4 +1,4 @@
#include "ProtocolComen.h"
#include "service/ProtocolComen.h"
int ProtocolComen::methods() const {
return (TELLSTICK_TURNON | TELLSTICK_TURNOFF);

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLCOMEN_H
#define PROTOCOLCOMEN_H
#include "ProtocolNexa.h"
#include "service/ProtocolNexa.h"
#include <string>
class ProtocolComen : public ProtocolNexa {

View file

@ -1,7 +1,7 @@
#include "ProtocolEverflourish.h"
#include <sstream>
#include <stdio.h>
#include "ControllerMessage.h"
#include "service/ControllerMessage.h"
int ProtocolEverflourish::methods() const {
return TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_LEARN;
@ -21,7 +21,7 @@ std::string ProtocolEverflourish::getStringForMethod(int method, unsigned char,
} else {
return "";
}
const char ssss = 85;
const char sssl = 84; // 0
const char slss = 69; // 1
@ -32,7 +32,7 @@ std::string ProtocolEverflourish::getStringForMethod(int method, unsigned char,
std::string strCode;
deviceCode = (deviceCode << 2) | intCode;
check = calculateChecksum(deviceCode);
char preamble[] = {'R', 5, 'T', 114,60,1,1,105,ssss,ssss,0};
@ -47,7 +47,7 @@ std::string ProtocolEverflourish::getStringForMethod(int method, unsigned char,
for(i=3;i>=0;i--) {
strCode.append(1, bits[(action>>i)&0x01]);
}
strCode.append(1, ssss);
strCode.append(1, '+');
@ -84,7 +84,7 @@ unsigned int ProtocolEverflourish::calculateChecksum(unsigned int x) {
bit = bit << 1;
}
return res;
return res;
}
std::string ProtocolEverflourish::decodeData(ControllerMessage &dataMsg)
@ -94,23 +94,23 @@ std::string ProtocolEverflourish::decodeData(ControllerMessage &dataMsg)
unsigned int house = 0;
unsigned int unit = 0;
unsigned int method = 0;
sscanf(data.c_str(), "%X", &allData);
house = allData & 0xFFFC00;
house >>= 10;
unit = allData & 0x300;
unit >>= 8;
unit++; //unit from 1 to 4
method = allData & 0xF;
if(house < 0 || house > 16383 || unit < 1 || unit > 4){
//not everflourish
return "";
}
std::stringstream retString;
retString << "class:command;protocol:everflourish;model:selflearning;house:" << house << ";unit:" << unit << ";method:";
if(method == 0){
@ -126,6 +126,6 @@ std::string ProtocolEverflourish::decodeData(ControllerMessage &dataMsg)
//not everflourish
return "";
}
return retString.str();
}
}

View file

@ -1,8 +1,8 @@
#ifndef PROTOCOLEVERFLOURISH_H
#define PROTOCOLEVERFLOURISH_H
#include "ControllerMessage.h"
#include "Protocol.h"
#include "service/Protocol.h"
#include "service/ControllerMessage.h"
class ProtocolEverflourish : public Protocol
{

View file

@ -1,5 +1,5 @@
#include "ProtocolFineoffset.h"
#include "Strings.h"
#include "service/ProtocolFineoffset.h"
#include "common/Strings.h"
#include <stdlib.h>
#include <sstream>
#include <iomanip>

View file

@ -1,8 +1,8 @@
#ifndef PROTOCOLFINEOFFSET_H
#define PROTOCOLFINEOFFSET_H
#include "ControllerMessage.h"
#include "Protocol.h"
#include "service/Protocol.h"
#include "service/ControllerMessage.h"
class ProtocolFineoffset : public Protocol
{

View file

@ -1,4 +1,4 @@
#include "ProtocolFuhaote.h"
#include "service/ProtocolFuhaote.h"
int ProtocolFuhaote::methods() const {
return TELLSTICK_TURNON | TELLSTICK_TURNOFF;

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLFUHAOTE_H
#define PROTOCOLFUHAOTE_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolFuhaote : public Protocol
{

View file

@ -1,4 +1,4 @@
#include "ProtocolGroup.h"
#include "service/ProtocolGroup.h"
int ProtocolGroup::methods() const {
return TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_DIM | TELLSTICK_BELL | TELLSTICK_LEARN | TELLSTICK_EXECUTE | TELLSTICK_TOGGLE | TELLSTICK_UP | TELLSTICK_DOWN | TELLSTICK_STOP;

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLGROUP_H
#define PROTOCOLGROUP_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolGroup : public Protocol {
public:

View file

@ -1,4 +1,4 @@
#include "ProtocolHasta.h"
#include "service/ProtocolHasta.h"
#include <sstream>
#include <stdio.h>
@ -63,4 +63,4 @@ std::string ProtocolHasta::convertByte(unsigned char byte) {
byte >>= 1;
}
return retval;
}
}

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLHASTA_H
#define PROTOCOLHASTA_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolHasta : public Protocol
{

View file

@ -1,5 +1,5 @@
#include "ProtocolIkea.h"
#include "Strings.h"
#include "service/ProtocolIkea.h"
#include "common/Strings.h"
#include <stdlib.h>
#include <string.h>

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLIKEA_H
#define PROTOCOLIKEA_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolIkea : public Protocol
{

View file

@ -1,5 +1,5 @@
#include "ProtocolMandolyn.h"
#include "Strings.h"
#include "service/ProtocolMandolyn.h"
#include "common/Strings.h"
#include <stdlib.h>
#include <sstream>
#include <iomanip>

View file

@ -1,8 +1,8 @@
#ifndef PROTOCOLMANDOLYN_H
#define PROTOCOLMANDOLYN_H
#include "ControllerMessage.h"
#include "Protocol.h"
#include "service/Protocol.h"
#include "service/ControllerMessage.h"
class ProtocolMandolyn : public Protocol
{

View file

@ -1,8 +1,8 @@
#include "ProtocolNexa.h"
#include <sstream>
#include "service/ProtocolNexa.h"
#include <stdio.h>
#include "TellStick.h"
#include "Strings.h"
#include <sstream>
#include "service/TellStick.h"
#include "common/Strings.h"
int ProtocolNexa::lastArctecCodeSwitchWasTurnOff=0; //TODO, always removing first turnon now, make more flexible (waveman too)
@ -160,12 +160,12 @@ std::string ProtocolNexa::getStringSelflearningForCode(int intHouse, int intCode
std::string ProtocolNexa::decodeData(ControllerMessage& dataMsg)
{
unsigned long allData = 0;
sscanf(dataMsg.getParameter("data").c_str(), "%lx", &allData);
if(TelldusCore::comparei(dataMsg.model(), L"selflearning")){
//selflearning
return decodeDataSelfLearning(allData);
return decodeDataSelfLearning(allData);
}
else{
//codeswitch
@ -178,24 +178,24 @@ std::string ProtocolNexa::decodeDataSelfLearning(long allData){
unsigned int unit = 0;
unsigned int group = 0;
unsigned int method = 0;
house = allData & 0xFFFFFFC0;
house >>= 6;
group = allData & 0x20;
group >>= 5;
method = allData & 0x10;
method >>= 4;
unit = allData & 0xF;
unit++;
if(house < 1 || house > 67108863 || unit < 1 || unit > 16){
//not arctech selflearning
return "";
}
std::stringstream retString;
retString << "class:command;protocol:arctech;model:selflearning;house:" << house << ";unit:" << unit << ";group:" << group << ";method:";
if(method == 1){
@ -208,45 +208,45 @@ std::string ProtocolNexa::decodeDataSelfLearning(long allData){
//not arctech selflearning
return "";
}
return retString.str();
}
std::string ProtocolNexa::decodeDataCodeSwitch(long allData){
unsigned int house = 0;
unsigned int unit = 0;
unsigned int method = 0;
method = allData & 0xF00;
method >>= 8;
unit = allData & 0xF0;
unit >>= 4;
unit++;
house = allData & 0xF;
if(house < 0 || house > 16 || unit < 1 || unit > 16){
//not arctech codeswitch
return "";
}
house = house + 'A'; //house from A to P
if(method != 6 && lastArctecCodeSwitchWasTurnOff == 1){
lastArctecCodeSwitchWasTurnOff = 0;
return ""; //probably a stray turnon or bell (perhaps: only certain time interval since last, check that it's the same house/unit... Will lose
//one turnon/bell, but it's better than the alternative...
//one turnon/bell, but it's better than the alternative...
}
if(method == 6){
lastArctecCodeSwitchWasTurnOff = 1;
}
std::stringstream retString;
retString << "class:command;protocol:arctech;model:codeswitch;house:" << char(house);
if(method == 6){
retString << ";unit:" << unit << ";method:turnoff;";
}
@ -260,7 +260,7 @@ std::string ProtocolNexa::decodeDataCodeSwitch(long allData){
//not arctech codeswitch
return "";
}
return retString.str();
}

View file

@ -1,8 +1,8 @@
#ifndef PROTOCOLNEXA_H
#define PROTOCOLNEXA_H
#include "ControllerMessage.h"
#include "Device.h"
#include "service/ControllerMessage.h"
#include "service/Device.h"
#include <string>
class ProtocolNexa : public Protocol {

View file

@ -1,5 +1,5 @@
#include "ProtocolOregon.h"
#include "Strings.h"
#include "service/ProtocolOregon.h"
#include "common/Strings.h"
#include <stdlib.h>
#include <sstream>
#include <iomanip>
@ -20,7 +20,7 @@ std::string ProtocolOregon::decodeData(ControllerMessage &dataMsg)
std::string ProtocolOregon::decodeEA4C(const std::string &data) {
uint64_t value = TelldusCore::hexTo64l(data);
uint8_t checksum = 0xE + 0xA + 0x4 + 0xC;
checksum -= (value & 0xF) * 0x10;
checksum -= 0xA;

View file

@ -1,8 +1,8 @@
#ifndef PROTOCOLOREGON_H
#define PROTOCOLOREGON_H
#include "ControllerMessage.h"
#include "Protocol.h"
#include "service/Protocol.h"
#include "service/ControllerMessage.h"
class ProtocolOregon : public Protocol
{

View file

@ -1,5 +1,5 @@
#include "ProtocolRisingSun.h"
#include "Strings.h"
#include "service/ProtocolRisingSun.h"
#include "common/Strings.h"
int ProtocolRisingSun::methods() const {
if (TelldusCore::comparei(model(), L"selflearning")) {

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLRISINGSUN_H
#define PROTOCOLRISINGSUN_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolRisingSun : public Protocol
{

View file

@ -1,4 +1,4 @@
#include "ProtocolSartano.h"
#include "service/ProtocolSartano.h"
#include <sstream>
#include <stdio.h>
@ -44,9 +44,9 @@ std::string ProtocolSartano::decodeData(ControllerMessage &dataMsg)
unsigned int method1 = 0;
unsigned int method2 = 0;
unsigned int method = 0;
sscanf(data.c_str(), "%X", &allDataIn);
unsigned long mask = (1<<11);
for(int i=0;i<12;++i){
allData >>= 1;
@ -55,15 +55,15 @@ std::string ProtocolSartano::decodeData(ControllerMessage &dataMsg)
}
mask >>= 1;
}
code = allData & 0xFFC;
code >>= 2;
method1 = allData & 0x2;
method1 >>= 1;
method2 = allData & 0x1;
if(method1 == 0 && method2 == 1){
method = 0; //off
}
@ -73,12 +73,12 @@ std::string ProtocolSartano::decodeData(ControllerMessage &dataMsg)
else{
return "";
}
if(code < 0 || code > 1023){
//not sartano
return "";
}
std::stringstream retString;
retString << "class:command;protocol:sartano;model:codeswitch;code:";
mask = (1<<9);
@ -92,13 +92,13 @@ std::string ProtocolSartano::decodeData(ControllerMessage &dataMsg)
mask >>= 1;
}
retString << ";method:";
if(method == 0){
retString << "turnoff;";
}
else{
retString << "turnon;";
}
return retString.str();
}

View file

@ -1,8 +1,8 @@
#ifndef PROTOCOLSARTANO_H
#define PROTOCOLSARTANO_H
#include "ControllerMessage.h"
#include "Protocol.h"
#include "service/Protocol.h"
#include "service/ControllerMessage.h"
class ProtocolSartano : public Protocol
{

View file

@ -1,4 +1,4 @@
#include "ProtocolScene.h"
#include "service/ProtocolScene.h"
int ProtocolScene::methods() const {
return TELLSTICK_EXECUTE;

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLSCENE_H
#define PROTOCOLSCENE_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolScene : public Protocol {
public:

View file

@ -1,5 +1,5 @@
#include "ProtocolSilvanChip.h"
#include "Strings.h"
#include "service/ProtocolSilvanChip.h"
#include "common/Strings.h"
int ProtocolSilvanChip::methods() const {
if (TelldusCore::comparei(model(), L"kp100")) {

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLSILVANCHIP_H
#define PROTOCOLSILVANCHIP_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolSilvanChip : public Protocol
{

View file

@ -1,4 +1,4 @@
#include "ProtocolUpm.h"
#include "service/ProtocolUpm.h"
int ProtocolUpm::methods() const {
return TELLSTICK_TURNON | TELLSTICK_TURNOFF | TELLSTICK_LEARN;

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLUPM_H
#define PROTOCOLUPM_H
#include "Protocol.h"
#include "service/Protocol.h"
class ProtocolUpm : public Protocol
{

View file

@ -1,4 +1,4 @@
#include "ProtocolWaveman.h"
#include "service/ProtocolWaveman.h"
#include <sstream>
#include <stdio.h>
@ -22,38 +22,38 @@ std::string ProtocolWaveman::decodeData(ControllerMessage& dataMsg)
unsigned int house = 0;
unsigned int unit = 0;
unsigned int method = 0;
sscanf(dataMsg.getParameter("data").c_str(), "%lx", &allData);
method = allData & 0xF00;
method >>= 8;
unit = allData & 0xF0;
unit >>= 4;
unit++;
house = allData & 0xF;
if(house < 0 || house > 16 || unit < 1 || unit > 16){
//not waveman
return "";
}
house = house + 'A'; //house from A to P
if(method != 6 && lastArctecCodeSwitchWasTurnOff == 1){
lastArctecCodeSwitchWasTurnOff = 0;
return ""; //probably a stray turnon or bell (perhaps: only certain time interval since last, check that it's the same house/unit... Will lose
//one turnon/bell, but it's better than the alternative...
//one turnon/bell, but it's better than the alternative...
}
if(method == 6){
lastArctecCodeSwitchWasTurnOff = 1;
}
std::stringstream retString;
retString << "class:command;protocol:waveman;model:codeswitch;house:" << char(house);
if(method == 0){
retString << ";unit:" << unit << ";method:turnoff;";
}
@ -64,6 +64,6 @@ std::string ProtocolWaveman::decodeData(ControllerMessage& dataMsg)
//not waveman
return "";
}
return retString.str();
}

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLWAVEMAN_H
#define PROTOCOLWAVEMAN_H
#include "ProtocolNexa.h"
#include "service/ProtocolNexa.h"
class ProtocolWaveman : public ProtocolNexa {
public:

View file

@ -1,4 +1,4 @@
#include "ProtocolX10.h"
#include "service/ProtocolX10.h"
#include <stdio.h>
#include <sstream>

View file

@ -1,8 +1,8 @@
#ifndef PROTOCOLX10_H
#define PROTOCOLX10_H
#include "Protocol.h"
#include "ControllerMessage.h"
#include "service/Protocol.h"
#include "service/ControllerMessage.h"
class ProtocolX10 : public Protocol
{

View file

@ -1,4 +1,4 @@
#include "ProtocolYidong.h"
#include "service/ProtocolYidong.h"
std::string ProtocolYidong::getStringForMethod(int method, unsigned char, Controller *) {
int intCode = this->getIntParameter(L"unit", 1, 4);

View file

@ -1,7 +1,7 @@
#ifndef PROTOCOLYIDONG_H
#define PROTOCOLYIDONG_H
#include "ProtocolSartano.h"
#include "service/ProtocolSartano.h"
class ProtocolYidong : public ProtocolSartano
{

View file

@ -1,6 +1,6 @@
#include "Sensor.h"
#include "common.h"
#include "../client/telldus-core.h"
#include "service/Sensor.h"
#include "common/common.h"
#include "client/telldus-core.h"
#include <map>
class Sensor::PrivateData {

View file

@ -1,7 +1,7 @@
#ifndef SENSOR_H
#define SENSOR_H
#include "Mutex.h"
#include "common/Mutex.h"
#include <string>
class Sensor : public TelldusCore::Mutex

View file

@ -1,4 +1,4 @@
#include "Settings.h"
#include "service/Settings.h"
TelldusCore::Mutex Settings::mutex;

View file

@ -2,7 +2,7 @@
#define SETTINGS_H
#include <string>
#include "Mutex.h"
#include "common/Mutex.h"
class Settings {
public:

View file

@ -10,9 +10,11 @@
//
//
#include "Settings.h"
#include "SettingsConfusePaths.h"
#include "../client/telldus-core.h"
#include "Strings.h"
#include "client/telldus-core.h"
#include "service/Settings.h"
#include "service/SettingsConfusePaths.h"
#include "client/telldus-core.h"
#include "common/Strings.h"
#include <confuse.h>
#include <stdlib.h>
#include <string.h>

View file

@ -9,7 +9,7 @@
// Copyright: See COPYING file that comes with this distribution
//
//
#include "TellStick.h"
#include "service/TellStick.h"
#include <map>
#include <stdio.h>

View file

@ -12,9 +12,9 @@
#ifndef TELLSTICK_H
#define TELLSTICK_H
#include "Controller.h"
#include "Thread.h"
#include <list>
#include "service/Controller.h"
#include "common/Thread.h"
class TellStickDescriptor {
public:

View file

@ -9,19 +9,19 @@
// Copyright: See COPYING file that comes with this distribution
//
//
#include "TellStick.h"
#include "../client/telldus-core.h"
#include "service/TellStick.h"
#include "client/telldus-core.h"
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ftdi.h>
#include "Thread.h"
#include "Mutex.h"
#include "Log.h"
#include "Settings.h"
#include "Strings.h"
#include "common.h"
#include "service/Log.h"
#include "service/Settings.h"
#include "common/Thread.h"
#include "common/Mutex.h"
#include "common/Strings.h"
#include "common/common.h"
#include <unistd.h>

View file

@ -1,13 +1,13 @@
#include "TelldusMain.h"
#include "ConnectionListener.h"
#include "EventHandler.h"
#include "ClientCommunicationHandler.h"
#include "DeviceManager.h"
#include "ControllerManager.h"
#include "ControllerListener.h"
#include "EventUpdateManager.h"
#include "Timer.h"
#include "Log.h"
#include "service/TelldusMain.h"
#include "service/ConnectionListener.h"
#include "common/EventHandler.h"
#include "service/ClientCommunicationHandler.h"
#include "service/DeviceManager.h"
#include "service/ControllerManager.h"
#include "service/ControllerListener.h"
#include "service/EventUpdateManager.h"
#include "service/Timer.h"
#include "service/Log.h"
#include <stdio.h>
#include <list>

View file

@ -1,5 +1,5 @@
#include "Timer.h"
#include "Mutex.h"
#include "service/Timer.h"
#include "common/Mutex.h"
#ifdef _WINDOWS
#else
#include <sys/time.h>

View file

@ -1,8 +1,8 @@
#ifndef TIMER_H
#define TIMER_H
#include "Event.h"
#include "Thread.h"
#include "common/Event.h"
#include "common/Thread.h"
class Timer : public TelldusCore::Thread {
public:

View file

@ -1,4 +1,4 @@
#include "TelldusMain.h"
#include "service/TelldusMain.h"
#include <signal.h>
#include <string.h>
#include <stdio.h>
@ -9,9 +9,9 @@
#include <pwd.h>
#include <grp.h>
#include "Settings.h"
#include "Strings.h"
#include "Log.h"
#include "service/Settings.h"
#include "common/Strings.h"
#include "service/Log.h"
#define DAEMON_NAME "telldusd"
#define PID_FILE "/var/run/" DAEMON_NAME ".pid"