diff --git a/src/prog/domod/builders/cmake/CMakeLists.txt b/src/prog/domod/builders/cmake/CMakeLists.txt index c3065dc5..b063a1d9 100644 --- a/src/prog/domod/builders/cmake/CMakeLists.txt +++ b/src/prog/domod/builders/cmake/CMakeLists.txt @@ -8,6 +8,7 @@ set (CMAKE_CXX_STANDARD 11) include (br) include_directories(${workspaceRoot}/src/prog/domod/src) +include_directories(${workspaceRoot}/src/prog/domod/include) #set(CMAKE_CXX_FLAGS "-Wall -Wextra -pedantic -Werror=strict-aliasing") diff --git a/src/prog/domod/include/domo.h b/src/prog/domod/include/domo.h new file mode 100644 index 00000000..da142b85 --- /dev/null +++ b/src/prog/domod/include/domo.h @@ -0,0 +1,58 @@ +/*! + * domo.h + * + * Copyright (c) 2016-2018, NADAL Jean-Baptiste. All rights reserved. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301 USA + * + * @Author: NADAL Jean-Baptiste + * @Date: 10/04/2018 + * + */ + +#ifndef _DOMO_H +#define _DOMO_H + +/*------------------------------- DEFINES ----------------------------------*/ + +/* Device */ + +/* Device type. */ +#define kLightEntry "Lights" +#define kShutterEntry "Shutters" +#define kSprinklerEntry "Sprinklers" + +#define k_entry_data "data" + +/* common */ +#define k_entry_id "id" +#define k_entry_name "name" +#define k_entry_speach_name "speach_name" +#define k_entry_zone "zone" +#define k_entry_state "state" +#define k_entry_sender "sender" +#define k_entry_interruptor "interruptor" + + +/* shutter */ +#define k_entry_speed_up "speed_up" +#define k_entry_speed_down "speed_down" + + +/* Timer */ + + +#endif /* _DOMO_H */ \ No newline at end of file diff --git a/src/prog/domod/src/devices/device.cpp b/src/prog/domod/src/devices/device.cpp index c91f2042..63ba3586 100644 --- a/src/prog/domod/src/devices/device.cpp +++ b/src/prog/domod/src/devices/device.cpp @@ -29,6 +29,8 @@ #include +#include "domo.h" + #include "devices/device.h" /*! ---------------------------------------------------------------------------- diff --git a/src/prog/domod/src/devices/device.h b/src/prog/domod/src/devices/device.h index 73800e47..05b798f7 100644 --- a/src/prog/domod/src/devices/device.h +++ b/src/prog/domod/src/devices/device.h @@ -34,10 +34,6 @@ struct json_object; -/*------------------------------- DEFINES ----------------------------------*/ - -#define k_entry_speach_name "speach_name" -#define k_entry_data "data" /*--------------------------------- CLASS ----------------------------------*/ diff --git a/src/prog/domod/src/devices/devices-manager.cpp b/src/prog/domod/src/devices/devices-manager.cpp index f2e5fac4..15d0a586 100644 --- a/src/prog/domod/src/devices/devices-manager.cpp +++ b/src/prog/domod/src/devices/devices-manager.cpp @@ -26,11 +26,12 @@ /*------------------------------- INCLUDES ----------------------------------*/ #include -#include #include #include +#include "domo.h" + #include "devices/devices-manager.h" /*! ---------------------------------------------------------------------------- diff --git a/src/prog/domod/src/devices/devices-manager.h b/src/prog/domod/src/devices/devices-manager.h index 223371bb..66a8fd5c 100644 --- a/src/prog/domod/src/devices/devices-manager.h +++ b/src/prog/domod/src/devices/devices-manager.h @@ -36,12 +36,6 @@ #include "devices/device.h" -/*------------------------------- DEFINES ----------------------------------*/ - -#define kLightEntry "Lights" -#define kShutterEntry "Shutters" -#define kSprinklerEntry "Sprinklers" - /*---------------------------------- Deps -----------------------------------*/ /*--------------------------------- CLASS ----------------------------------*/ diff --git a/src/prog/domod/src/devices/light-device.cpp b/src/prog/domod/src/devices/light-device.cpp index 621d328b..add7e7eb 100644 --- a/src/prog/domod/src/devices/light-device.cpp +++ b/src/prog/domod/src/devices/light-device.cpp @@ -29,7 +29,7 @@ #include -#include "devices/light.h" +#include "domo.h" #include "devices/light-device.h" diff --git a/src/prog/domod/src/devices/light-device.h b/src/prog/domod/src/devices/light-device.h index a7a9e7a8..d0aaba2b 100644 --- a/src/prog/domod/src/devices/light-device.h +++ b/src/prog/domod/src/devices/light-device.h @@ -33,8 +33,6 @@ #include "devices/light.h" #include "devices/device.h" -/*---------------------------------- Deps -----------------------------------*/ - /*--------------------------------- CLASS ----------------------------------*/ class LightDevice : public Device diff --git a/src/prog/domod/src/devices/light.cpp b/src/prog/domod/src/devices/light.cpp index e9e33690..d46fc342 100644 --- a/src/prog/domod/src/devices/light.cpp +++ b/src/prog/domod/src/devices/light.cpp @@ -31,6 +31,8 @@ #include +#include "domo.h" + #include "devices/light.h" diff --git a/src/prog/domod/src/devices/light.h b/src/prog/domod/src/devices/light.h index fdda6047..dd1e5afa 100644 --- a/src/prog/domod/src/devices/light.h +++ b/src/prog/domod/src/devices/light.h @@ -32,16 +32,6 @@ #include -/*------------------------------- DEFINES ----------------------------------*/ - -#define k_entry_id "id" -#define k_entry_name "name" -#define k_entry_speach_name "speach_name" -#define k_entry_zone "zone" -#define k_entry_state "state" -#define k_entry_sender "sender" -#define k_entry_interruptor "interruptor" - /*---------------------------------- Deps -----------------------------------*/ struct json_object; diff --git a/src/prog/domod/src/devices/shutter-device.cpp b/src/prog/domod/src/devices/shutter-device.cpp index 75b73814..6c68f188 100644 --- a/src/prog/domod/src/devices/shutter-device.cpp +++ b/src/prog/domod/src/devices/shutter-device.cpp @@ -29,6 +29,8 @@ #include +#include "domo.h" + #include "devices/shutter-device.h" /*! ---------------------------------------------------------------------------- diff --git a/src/prog/domod/src/devices/shutter-device.h b/src/prog/domod/src/devices/shutter-device.h index 90552326..0dd9f2fb 100644 --- a/src/prog/domod/src/devices/shutter-device.h +++ b/src/prog/domod/src/devices/shutter-device.h @@ -33,8 +33,6 @@ #include "devices/shutter.h" #include "devices/device.h" -/*---------------------------------- Deps -----------------------------------*/ - /*--------------------------------- CLASS ----------------------------------*/ class ShutterDevice : public Device diff --git a/src/prog/domod/src/devices/shutter.cpp b/src/prog/domod/src/devices/shutter.cpp index 4061a00c..3fda2986 100644 --- a/src/prog/domod/src/devices/shutter.cpp +++ b/src/prog/domod/src/devices/shutter.cpp @@ -31,6 +31,8 @@ #include +#include "domo.h" + #include "devices/shutter.h" diff --git a/src/prog/domod/src/devices/shutter.h b/src/prog/domod/src/devices/shutter.h index 52e42e5f..8e24f3bc 100644 --- a/src/prog/domod/src/devices/shutter.h +++ b/src/prog/domod/src/devices/shutter.h @@ -32,18 +32,6 @@ #include -/*------------------------------- DEFINES ----------------------------------*/ - -#define k_entry_id "id" -#define k_entry_name "name" -#define k_entry_speach_name "speach_name" -#define k_entry_zone "zone" -#define k_entry_state "state" -#define k_entry_sender "sender" -#define k_entry_interruptor "interruptor" -#define k_entry_speed_up "speed_up" -#define k_entry_speed_down "speed_down" - /*---------------------------------- Deps -----------------------------------*/ struct json_object; diff --git a/src/prog/domod/src/devices/sprinkler-device.cpp b/src/prog/domod/src/devices/sprinkler-device.cpp index 829940b5..86684ad5 100644 --- a/src/prog/domod/src/devices/sprinkler-device.cpp +++ b/src/prog/domod/src/devices/sprinkler-device.cpp @@ -29,6 +29,8 @@ #include +#include "domo.h" + #include "devices/sprinkler-device.h" /*! ---------------------------------------------------------------------------- diff --git a/src/prog/domod/src/devices/sprinkler-device.h b/src/prog/domod/src/devices/sprinkler-device.h index d0b973a8..0148b702 100644 --- a/src/prog/domod/src/devices/sprinkler-device.h +++ b/src/prog/domod/src/devices/sprinkler-device.h @@ -33,8 +33,6 @@ #include "devices/sprinkler.h" #include "devices/device.h" -/*---------------------------------- Deps -----------------------------------*/ - /*--------------------------------- CLASS ----------------------------------*/ class SprinklerDevice : public Device diff --git a/src/prog/domod/src/devices/sprinkler.cpp b/src/prog/domod/src/devices/sprinkler.cpp index 5d9de596..6bac354e 100644 --- a/src/prog/domod/src/devices/sprinkler.cpp +++ b/src/prog/domod/src/devices/sprinkler.cpp @@ -31,8 +31,11 @@ #include +#include "domo.h" + #include "devices/sprinkler.h" +/*------------------------------- DEFINES ----------------------------------*/ #define k_entry_station "station" diff --git a/src/prog/domod/src/devices/sprinkler.h b/src/prog/domod/src/devices/sprinkler.h index 6219b6cb..dc3d32ce 100644 --- a/src/prog/domod/src/devices/sprinkler.h +++ b/src/prog/domod/src/devices/sprinkler.h @@ -32,13 +32,6 @@ #include -/*------------------------------- DEFINES ----------------------------------*/ - -#define k_entry_id "id" -#define k_entry_name "name" -#define k_entry_speach_name "speach_name" -#define k_entry_state "state" - /*---------------------------------- Deps -----------------------------------*/ struct json_object; diff --git a/src/prog/domod/src/timers/event.cpp b/src/prog/domod/src/timers/event.cpp index 77e6756b..e799f593 100644 --- a/src/prog/domod/src/timers/event.cpp +++ b/src/prog/domod/src/timers/event.cpp @@ -29,6 +29,8 @@ #include "devices/devices-manager.h" +#include "domo.h" + #include "timers/event.h" /*------------------------------- DEFINES ----------------------------------*/ diff --git a/src/prog/domod/src/ubus/capabilities_lights.cpp b/src/prog/domod/src/ubus/capabilities_lights.cpp index 83efa682..102e2c25 100644 --- a/src/prog/domod/src/ubus/capabilities_lights.cpp +++ b/src/prog/domod/src/ubus/capabilities_lights.cpp @@ -33,6 +33,8 @@ extern "C" { #include "devices/devices-manager.h" +#include "domo.h" + #include "capabilities_lights.h" namespace diff --git a/src/prog/domod/src/ubus/capabilities_shutters.cpp b/src/prog/domod/src/ubus/capabilities_shutters.cpp index 75fad2af..8d0c18ce 100644 --- a/src/prog/domod/src/ubus/capabilities_shutters.cpp +++ b/src/prog/domod/src/ubus/capabilities_shutters.cpp @@ -33,6 +33,8 @@ extern "C" { #include "devices/devices-manager.h" +#include "domo.h" + #include "capabilities_shutters.h" namespace diff --git a/src/prog/domod/src/ubus/capabilities_sprinklers.cpp b/src/prog/domod/src/ubus/capabilities_sprinklers.cpp index cdef3ee4..d0e59eaf 100644 --- a/src/prog/domod/src/ubus/capabilities_sprinklers.cpp +++ b/src/prog/domod/src/ubus/capabilities_sprinklers.cpp @@ -35,6 +35,8 @@ extern "C" { #include "devices/devices-manager.h" +#include "domo.h" + #include "capabilities_sprinklers.h" namespace