Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sfeakes/AqualinkD
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: d1ca60b0daa17eddbb485e7af1ac6c3d227cecf4
Choose a base ref
..
head repository: sfeakes/AqualinkD
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: d4f60d7b5dbaa244dbf15ad644510e5e5670fc20
Choose a head ref
Showing with 20,841 additions and 4,877 deletions.
  1. +114 −37 Makefile
  2. +175 −349 README.md
  3. +10 −1 aq_mqtt.h
  4. +930 −0 aq_panel.c
  5. +74 −0 aq_panel.h
  6. +1,210 −223 aq_programmer.c
  7. +64 −5 aq_programmer.h
  8. +578 −579 aq_serial.c
  9. +247 −18 aq_serial.h
  10. +2,004 −0 aq_serial.old.c
  11. +114 −25 aqualink.h
  12. +1,184 −553 aqualinkd.c
  13. +139 −0 color_lights.c
  14. +83 −0 color_lights.h
  15. +378 −152 config.c
  16. +57 −13 config.h
  17. +119 −0 debug_timer.c
  18. +25 −0 debug_timer.h
  19. +404 −0 devices_jandy.c
  20. +25 −0 devices_jandy.h
  21. +6 −6 pentair_messages.c → devices_pentair.c
  22. 0 pentair_messages.h → devices_pentair.h
  23. +16 −0 epump.h
  24. +256 −186 extras/HASSIO.Implementation.txt
  25. BIN extras/HomeAssistant2.png
  26. +21 −7 extras/aqua.sh
  27. +52 −0 extras/color-lights.txt
  28. +81 −0 extras/pi_health.sh
  29. BIN extras/web_ui2.png
  30. +908 −0 iaqtouch.c
  31. +1,698 −0 iaqtouch.h
  32. +1,079 −0 iaqtouch_aq_programmer.c
  33. +25 −0 iaqtouch_aq_programmer.h
  34. +0 −150 init_buttons.c
  35. +0 −14 init_buttons.h
  36. +270 −109 json_messages.c
  37. +19 −5 json_messages.h
  38. +69 −5 log_reader.c
  39. +1,452 −667 net_services.c
  40. +1,440 −0 net_services.c.old
  41. +9 −1 net_services.h
  42. +807 −0 onetouch.c
  43. +79 −0 onetouch.h
  44. +919 −0 onetouch_aq_programmer.c
  45. +20 −0 onetouch_aq_programmer.h
  46. +133 −0 packetLogger.c
  47. +22 −0 packetLogger.h
  48. +110 −82 pda.c
  49. +2 −7 pda.h
  50. +430 −213 pda_aq_programmer.c
  51. +2 −0 pda_aq_programmer.h
  52. +81 −38 pda_menu.c
  53. +5 −3 pda_menu.h
  54. BIN release/aqualinkd
  55. +133 −54 release/aqualinkd.conf
  56. BIN release/serial_logger
  57. +161 −0 rs_msg_utils.c
  58. +11 −0 rs_msg_utils.h
  59. +258 −33 serial_logger.c
  60. +1,238 −0 serialadapter.c
  61. +108 −0 serialadapter.h
  62. +247 −49 utils.c
  63. +47 −7 utils.h
  64. +1 −1 version.h
  65. BIN web/._aqualinkd_62.png
  66. +24 −2 web/config.js
  67. +460 −61 web/controller.html
  68. +160 −0 web/debug.html
  69. +1 −0 web/hk/Aux_12-on.png
  70. +1 −0 web/hk/Aux_B1-off.png
  71. +1 −0 web/hk/Aux_B1-on.png
  72. +1 −0 web/hk/Aux_B2-off.png
  73. +1 −0 web/hk/Aux_B2-on.png
  74. +1 −0 web/hk/Aux_B3-off.png
  75. +1 −0 web/hk/Aux_B3-on.png
  76. +1 −0 web/hk/Aux_B4-off.png
  77. +1 −0 web/hk/Aux_B4-on.png
  78. +1 −0 web/hk/Aux_B5-off.png
  79. +1 −0 web/hk/Aux_B5-on.png
  80. +1 −0 web/hk/Aux_B6-off.png
  81. +1 −0 web/hk/Aux_B6-on.png
  82. +1 −0 web/hk/Aux_B7-off.png
  83. +1 −0 web/hk/Aux_B7-on.png
  84. +1 −0 web/hk/Aux_B8-off.png
  85. +1 −0 web/hk/Aux_B8-on.png
  86. +1 −0 web/hk/SWG_Boost-off.png
  87. +1 −0 web/hk/SWG_Boost-on.png
  88. +0 −1,212 web/hk/index.html
  89. +29 −10 web/simple.html
151 changes: 114 additions & 37 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,52 +1,101 @@
#
# Options
# make DEBUG=true // Turn on timing statments
# make EXFLAGS="-D BETA_PDA_AUTOLABEL" // Add compile flags
#
# define the C compiler to use
CC = gcc
# make // standard everything
# make debug // Give standard binary just with debugging
# make aqdebug // Compile with extra aqualink debug information like timings
# make slog // Serial logger
# make <other> // not documenting
#

# Valid flags for AQ_FLAGS
AQ_RS16 = true
AQ_PDA = true
AQ_ONETOUCH = true
AQ_IAQTOUCH = true
#AQ_MEMCMP = true // Not implimented correctly yet.

LIBS := -lpthread -lm
#LIBS := -lpthread -lwebsockets
# Get some system information
PI_OS_VERSION = $(shell cat /etc/os-release | grep VERSION= | cut -d\" -f2)
$(info OS: $(PI_OS_VERSION) )
GLIBC_VERSION = $(shell ldd --version | grep ldd)
$(info GLIBC: $(GLIBC_VERSION) )

# debug of not
#DBG = -g -O0 -fsanitize=address -static-libasan
#DBG = -g
DBG =

# USe below to remove unused functions and global variables.
#LFLAGS = -Wl,--gc-sections,--print-gc-sections
#GCCFLAGS = -Wall -ffunction-sections -fdata-sections
# define the C compiler to use
CC = gcc

#LIBS := -lpthread -lm
LIBS := -l pthread -l m
#LIBS := -l pthread -l m -static # Take out -static, just for dev

# define any compile-time flags
# Standard compile flags
GCCFLAGS = -Wall -O3
#GCCFLAGS = -O3
#GCCFLAGS = -Wall -O3 -Wextra
GCCFLAGS = -Wall -O3 $(EXFLAGS)
#GCCFLAGS = -Wall
#GCCFLAGS = -Wl,--gc-sections,--print-gc-sections
#GCCFLAGS = -Wall -O3 -ffunction-sections -fdata-sections

#CFLAGS = -Wall -g $(LIBS)
#CFLAGS = -Wall -g $(LIBS) -std=gnu11
CFLAGS = $(GCCFLAGS) $(DBG) $(LIBS) -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC
# Standard debug flags
DGCCFLAGS = -Wall -O0 -g

# Aqualink Debug flags
#DBGFLAGS = -g -O0 -Wall -fsanitize=address -D AQ_DEBUG -D AQ_TM_DEBUG
DBGFLAGS = -g -O0 -Wall -D AQ_DEBUG -D AQ_TM_DEBUG

# Mongoose flags
MGFLAGS = -D MG_DISABLE_MD5 -D MG_DISABLE_HTTP_DIGEST_AUTH -D MG_DISABLE_MD5 -D MG_DISABLE_JSON_RPC

# Add inputs and outputs from these tool invocations to the build variables

# define the C source files
SRCS = aqualinkd.c utils.c config.c aq_serial.c init_buttons.c aq_programmer.c net_services.c json_messages.c pda.c pda_menu.c pda_aq_programmer.c pentair_messages.c mongoose.c
DBG_SRC = timespec_subtract.c
#SRCS = aqualinkd.c utils.c config.c aq_serial.c init_buttons.c aq_programmer.c net_services.c json_messages.c pda.c pda_menu.c \
# pda_aq_programmer.c devices_jandy.c onetouch.c onetouch_aq_programmer.c packetLogger.c devices_pentair.c color_lights.c mongoose.c

SRCS = aqualinkd.c utils.c config.c aq_serial.c aq_panel.c aq_programmer.c net_services.c json_messages.c rs_msg_utils.c\
devices_jandy.c packetLogger.c devices_pentair.c color_lights.c serialadapter.c mongoose.c


AQ_FLAGS =
# Add source and flags depending on protocols to support.
ifeq ($(AQ_PDA), true)
SRCS := $(SRCS) pda.c pda_menu.c pda_aq_programmer.c
AQ_FLAGS := $(AQ_FLAGS) -D AQ_PDA
endif

ifeq ($(AQ_ONETOUCH), true)
SRCS := $(SRCS) onetouch.c onetouch_aq_programmer.c
AQ_FLAGS := $(AQ_FLAGS) -D AQ_ONETOUCH
endif

ifeq ($(AQ_IAQTOUCH), true)
SRCS := $(SRCS) iaqtouch.c iaqtouch_aq_programmer.c
AQ_FLAGS := $(AQ_FLAGS) -D AQ_IAQTOUCH
endif

# If run with `make DEBUG=true` add debug files and pass parameter for compile
ifeq ($(DEBUG), true)
SRCS := $(SRCS) $(DBG_SRC)
CFLAGS := $(CFLAGS) -D AQ_DEBUG
ifeq ($(AQ_RS16), true)
AQ_FLAGS := $(AQ_FLAGS) -D AQ_RS16
endif

SL_SRC = serial_logger.c aq_serial.c utils.c
LR_SRC = log_reader.c aq_serial.c utils.c
ifeq ($(AQ_MEMCMP), true)
AQ_FLAGS := $(AQ_FLAGS) -D AQ_MEMCMP
endif

# Put all flags together.
CFLAGS = $(GCCFLAGS) $(AQ_FLAGS) $(MGFLAGS)
DFLAGS = $(DGCCFLAGS) $(AQ_FLAGS) $(MGFLAGS)
DBG_CFLAGS = $(DBGFLAGS) $(AQ_FLAGS) $(MGFLAGS)

# Other sources.
#DBG_SRC = timespec_subtract.c debug_timer.c
DBG_SRC = debug_timer.c
SL_SRC = serial_logger.c aq_serial.c utils.c packetLogger.c rs_msg_utils.c
LR_SRC = log_reader.c aq_serial.c utils.c packetLogger.c
PL_EXSRC = aq_serial.c
PL_EXOBJ = aq_serial_player.o
PL_SRC := $(filter-out aq_serial.c, $(SRCS))

OBJS = $(SRCS:.c=.o)
DBG_OBJS = $(DBG_SRC:.c=.o)

SL_OBJS = $(SL_SRC:.c=.o)
LR_OBJS = $(LR_SRC:.c=.o)
@@ -57,34 +106,62 @@ MAIN = ./release/aqualinkd
SLOG = ./release/serial_logger
LOGR = ./release/log_reader
PLAY = ./release/aqualinkd-player
DEBG = ./release/aqualinkd-debug

all: $(MAIN)
$(info $(MAIN) has been compiled)

all: $(MAIN)
@echo: $(MAIN) have been compiled
# debug, Just change compile flags and call MAIN
debug: CFLAGS = $(DFLAGS)
debug: $(MAIN)
$(info $(MAIN) has been compiled)

$(MAIN): $(OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LFLAGS) $(LIBS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(MAIN) $(OBJS) $(LIBS)
$(info $(MAIN) has been compiled)

slog: $(SLOG)
@echo: $(SLOG) have been compiled
$(info $(SLOG) has been compiled)

$(SLOG): CFLAGS := $(CFLAGS) -D SERIAL_LOGGER
$(SLOG): $(SL_OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(SLOG) $(SL_OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(SLOG) $(SL_OBJS)


#.PHONY: clean_slog_o
#clean_slog_o:
# $(RM) $(SL_OBJS)
#
#.PHONY: test
#test: $(SLOG)
#test: clean_slog_o
#test: $(MAIN)

# Shouldn't need to use any of these options unless you're developing.

aqdebug: $(DEBG)
$(info $(DEBG) has been compiled)

$(DEBG): CFLAGS = $(DBG_CFLAGS)
$(DEBG): $(OBJS) $(DBG_OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(DEBG) $(OBJS) $(DBG_OBJS) $(DBGFLAGS) $(LIBS)

logr: $(LOGR)
@echo: $(LOGR) have been compiled
$(info $(LOGR) has been compiled)

$(LOGR): $(LR_OBJS)
$(CC) $(CFLAGS) $(INCLUDES) -o $(LOGR) $(LR_OBJS)

player: $(PLAY)
@echo: $(PLAY) have been compiled
$(info $(PLAY) has been compiled)

$(PL_EXOBJ): $(PL_EXSRC)
$(CC) $(CFLAGS) -D PLAYBACK_MODE $(INCLUDES) -c $(PL_EXSRC) -o $(PL_EXOBJ)

$(PLAY): $(PL_OBJS) $(PL_EXOBJ)
$(CC) $(CFLAGS) $(INCLUDES) -o $(PLAY) $(PL_OBJS) $(PL_EXOBJ)

# Fof github publishing
.PHONY: git
git: clean $(MAIN) $(SLOG)
./release/git_version.sh
@@ -99,8 +176,8 @@ git: clean $(MAIN) $(SLOG)

.PHONY: clean
clean:
$(RM) *.o *~ $(MAIN) $(MAIN_U) $(PLAY) $(PL_EXOBJ)
$(RM) $(wildcard *.o) $(wildcard *~) $(MAIN) $(MAIN_U) $(PLAY) $(PL_EXOBJ) $(LOGR) $(PLAY)
$(RM) *.o *~ $(MAIN) $(MAIN_U) $(PLAY) $(PL_EXOBJ) $(DEBG)
$(RM) $(wildcard *.o) $(wildcard *~) $(MAIN) $(MAIN_U) $(PLAY) $(PL_EXOBJ) $(LOGR) $(PLAY) $(DEBG)

depend: $(SRCS)
makedepend $(INCLUDES) $^
Loading