mirror of https://github.com/sfeakes/AqualinkD.git
Updates for 2.3.7
parent
0520aee4a0
commit
b09bd63b83
44
Makefile
44
Makefile
|
@ -146,8 +146,10 @@ SL_OBJ_DIR := $(OBJ_DIR)/slog
|
|||
|
||||
OBJ_DIR_ARMHF := $(OBJ_DIR)/armhf
|
||||
OBJ_DIR_ARM64 := $(OBJ_DIR)/arm64
|
||||
OBJ_DIR_AMD64 := $(OBJ_DIR)/amd64
|
||||
SL_OBJ_DIR_ARMHF := $(OBJ_DIR_ARMHF)/slog
|
||||
SL_OBJ_DIR_ARM64 := $(OBJ_DIR_ARM64)/slog
|
||||
SL_OBJ_DIR_AMD64 := $(OBJ_DIR_AMD64)/slog
|
||||
|
||||
# Object files
|
||||
OBJ_FILES := $(patsubst %.c,$(OBJ_DIR)/%.o,$(SRCS))
|
||||
|
@ -156,8 +158,11 @@ SL_OBJ_FILES := $(patsubst %.c,$(SL_OBJ_DIR)/%.o,$(SL_SRC))
|
|||
|
||||
OBJ_FILES_ARMHF := $(patsubst %.c,$(OBJ_DIR_ARMHF)/%.o,$(SRCS))
|
||||
OBJ_FILES_ARM64 := $(patsubst %.c,$(OBJ_DIR_ARM64)/%.o,$(SRCS))
|
||||
OBJ_FILES_AMD64 := $(patsubst %.c,$(OBJ_DIR_AMD64)/%.o,$(SRCS))
|
||||
|
||||
SL_OBJ_FILES_ARMHF := $(patsubst %.c,$(SL_OBJ_DIR_ARMHF)/%.o,$(SL_SRC))
|
||||
SL_OBJ_FILES_ARM64 := $(patsubst %.c,$(SL_OBJ_DIR_ARM64)/%.o,$(SL_SRC))
|
||||
SL_OBJ_FILES_AMD64 := $(patsubst %.c,$(SL_OBJ_DIR_AMD64)/%.o,$(SL_SRC))
|
||||
#MG_OBJ_FILES := $(patsubst %.c,$(OBJ_DIR)/%.o,$(MG_SRC))
|
||||
|
||||
# define the executable file
|
||||
|
@ -167,21 +172,30 @@ DEBG = ./release/aqualinkd-debug
|
|||
|
||||
MAIN_ARM64 = ./release/aqualinkd-arm64
|
||||
MAIN_ARMHF = ./release/aqualinkd-armhf
|
||||
MAIN_AMD64 = ./release/aqualinkd-amd64
|
||||
|
||||
SLOG_ARM64 = ./release/serial_logger-arm64
|
||||
SLOG_ARMHF = ./release/serial_logger-armhf
|
||||
SLOG_AMD64 = ./release/serial_logger-amd64
|
||||
|
||||
#LOGR = ./release/log_reader
|
||||
#PLAY = ./release/aqualinkd-player
|
||||
|
||||
|
||||
# Rules with no targets
|
||||
.PHONY: clean clean-buildfiles buildrelease release install
|
||||
|
||||
# Default target
|
||||
.DEFAULT_GOAL := all
|
||||
|
||||
# Before the below works, you need to build the aqualinkd-releasebin docker for compiling.
|
||||
# sudo docker build -f Dockerfile.releaseBinaries -t aqualinkd-releasebin .
|
||||
release:
|
||||
sudo docker run -it --mount type=bind,source=./,target=/build aqualinkd-releasebin make buildrelease
|
||||
$(info Binaries for release have been built)
|
||||
|
||||
# This is run inside container Dockerfile.releaseBinariies
|
||||
buildrelease: clean armhf arm64
|
||||
# This is run inside container Dockerfile.releaseBinariies (aqualinkd-releasebin)
|
||||
buildrelease: clean armhf arm64
|
||||
$(shell cd release && ln -s ./aqualinkd-armhf ./aqualinkd && ln -s ./serial_logger-armhf ./serial_logger)
|
||||
|
||||
|
||||
|
@ -220,6 +234,12 @@ arm64: $(MAIN_ARM64) $(SLOG_ARM64)
|
|||
$(info $(MAIN_ARM64) has been compiled)
|
||||
$(info $(SLOG_ARM64) has been compiled)
|
||||
|
||||
# amd64
|
||||
amd64: CC := $(CC_AMD64)
|
||||
amd64: $(MAIN_AMD64) $(SLOG_AMD64)
|
||||
$(info $(MAIN_AMD64) has been compiled)
|
||||
$(info $(SLOG_AMD64) has been compiled)
|
||||
|
||||
#debug, Just change compile flags and call MAIN
|
||||
debug: CFLAGS = $(DFLAGS)
|
||||
debug: $(MAIN) $(SLOG)
|
||||
|
@ -253,6 +273,11 @@ $(OBJ_DIR_ARM64)/%.o: %.c | $(OBJ_DIR_ARM64)
|
|||
$(SL_OBJ_DIR_ARM64)/%.o: %.c | $(SL_OBJ_DIR_ARM64)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
|
||||
|
||||
$(OBJ_DIR_AMD64)/%.o: %.c | $(OBJ_DIR_AMD64)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
|
||||
|
||||
$(SL_OBJ_DIR_AMD64)/%.o: %.c | $(SL_OBJ_DIR_AMD64)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
|
||||
|
||||
# Rules to link
|
||||
$(MAIN): $(OBJ_FILES)
|
||||
|
@ -262,6 +287,9 @@ $(MAIN_ARM64): $(OBJ_FILES_ARM64)
|
|||
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LIBS)
|
||||
|
||||
$(MAIN_ARMHF): $(OBJ_FILES_ARMHF)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LIBS)
|
||||
|
||||
$(MAIN_AMD64): $(OBJ_FILES_AMD64)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LIBS)
|
||||
|
||||
$(DEBG): $(DBG_OBJ_FILES)
|
||||
|
@ -279,6 +307,9 @@ $(SLOG_ARM64): CFLAGS := $(CFLAGS) -D SERIAL_LOGGER
|
|||
$(SLOG_ARM64): $(SL_OBJ_FILES_ARM64)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LIBS)
|
||||
|
||||
$(SLOG_AMD64): CFLAGS := $(CFLAGS) -D SERIAL_LOGGER
|
||||
$(SLOG_AMD64): $(SL_OBJ_FILES_AMD64)
|
||||
$(CC) $(CFLAGS) $(INCLUDES) -o $@ $^ $(LIBS)
|
||||
|
||||
# Rules to make object directories.
|
||||
$(OBJ_DIR):
|
||||
|
@ -302,14 +333,19 @@ $(OBJ_DIR_ARM64):
|
|||
$(SL_OBJ_DIR_ARM64):
|
||||
$(MKDIR) $(call FixPath,$@)
|
||||
|
||||
$(OBJ_DIR_AMD64):
|
||||
$(MKDIR) $(call FixPath,$@)
|
||||
|
||||
$(SL_OBJ_DIR_AMD64):
|
||||
$(MKDIR) $(call FixPath,$@)
|
||||
|
||||
# Clean rules
|
||||
|
||||
clean: clean-buildfiles
|
||||
$(RM) *.o *~ $(MAIN) $(MAIN_U) $(PLAY) $(PL_EXOBJ) $(DEBG)
|
||||
$(RM) $(wildcard *.o) $(wildcard *~) $(MAIN) $(MAIN_ARM64) $(MAIN_ARMHF) $(SLOG) $(SLOG_ARM64) $(SLOG_ARMHF) $(MAIN_U) $(PLAY) $(PL_EXOBJ) $(LOGR) $(PLAY) $(DEBG)
|
||||
$(RM) $(wildcard *.o) $(wildcard *~) $(MAIN) $(MAIN_ARM64) $(MAIN_ARMHF) $(MAIN_AMD64) $(SLOG) $(SLOG_ARM64) $(SLOG_ARMHF) $(SLOG_AMD64) $(MAIN_U) $(PLAY) $(PL_EXOBJ) $(LOGR) $(PLAY) $(DEBG)
|
||||
|
||||
clean-buildfiles:
|
||||
$(RM) $(wildcard *.o) $(wildcard *~) $(OBJ_FILES) $(DBG_OBJ_FILES) $(SL_OBJ_FILES) $(OBJ_FILES_ARMHF) $(OBJ_FILES_ARM64) $(SL_OBJ_FILES_ARMHF) $(SL_OBJ_FILES_ARM64)
|
||||
$(RM) $(wildcard *.o) $(wildcard *~) $(OBJ_FILES) $(DBG_OBJ_FILES) $(SL_OBJ_FILES) $(OBJ_FILES_ARMHF) $(OBJ_FILES_ARM64) $(OBJ_FILES_AMD64) $(SL_OBJ_FILES_ARMHF) $(SL_OBJ_FILES_ARM64) $(SL_OBJ_FILES_AMD64)
|
||||
|
||||
|
||||
|
|
|
@ -110,6 +110,15 @@ Designed to mimic AqualinkRS devices, used to fully configure the master control
|
|||
# Call for Help.
|
||||
* The only Jandy devices I have not decoded yet are LX heater & Chemical Feeder. If you have either of these devices and are willing to post some logs, please let me know, or post in the [Discussions area](https://github.com/sfeakes/AqualinkD/discussions)
|
||||
|
||||
# (Comming) Updates in Release 2.3.7
|
||||
* Fix for Pentair VSP losing connection & bouncing SWG to 0 and back.
|
||||
* Added more VSP data (Mode, Status, Pressure Curve, both RPM & GPM) for all Pentair Pumps (VS/VF/VSF).
|
||||
* Few updates to HomeAssistant integration.
|
||||
* Updates to serial_logger.
|
||||
* Few updates to AQmanager UI.
|
||||
* Will display both RPM & GPM for VSP (space providing)
|
||||
* Fix freeze protect button in UI not showing enabled.
|
||||
|
||||
# Update in Release 2.3.6
|
||||
* No functionality changes
|
||||
* Build & Docker changes
|
||||
|
|
|
@ -50,6 +50,9 @@
|
|||
#define PUMP_RPM_TOPIC "/RPM"
|
||||
#define PUMP_GPM_TOPIC "/GPM"
|
||||
#define PUMP_WATTS_TOPIC "/Watts"
|
||||
#define PUMP_MODE_TOPIC "/Mode"
|
||||
#define PUMP_STATUS_TOPIC "/Status"
|
||||
#define PUMP_PPC_TOPIC "/PPC"
|
||||
/*
|
||||
#define AIR_TEMPERATURE "Air"
|
||||
#define POOL_TEMPERATURE "Pool_Water"
|
||||
|
|
117
aq_panel.c
117
aq_panel.c
|
@ -52,7 +52,7 @@ void changePanelToMode_Only() {
|
|||
|
||||
void changePanelToExtendedIDProgramming() {
|
||||
_aqconfig_.paneltype_mask |= RSP_EXT_PROG;
|
||||
LOG(AQUA_LOG,LOG_NOTICE, "AqualinkD is using use %s mode for programming (where supported)\n",isONET_ENABLED?"ONETOUCH":"IAQ TOUCH");
|
||||
LOG(PANL_LOG,LOG_NOTICE, "AqualinkD is using use %s mode for programming (where supported)\n",isONET_ENABLED?"ONETOUCH":"IAQ TOUCH");
|
||||
}
|
||||
|
||||
void addPanelRSserialAdapterInterface() {
|
||||
|
@ -83,7 +83,7 @@ int PANEL_SIZE() {
|
|||
else if ((_aqconfig_.paneltype_mask & RSP_16) == RSP_16)
|
||||
return 16;
|
||||
|
||||
LOG(AQUA_LOG,LOG_ERR, "Internal error, panel size not set, using 8\n");
|
||||
LOG(PANL_LOG,LOG_ERR, "Internal error, panel size not set, using 8\n");
|
||||
return 8;
|
||||
}
|
||||
//bool setPanel(const char *str);
|
||||
|
@ -133,7 +133,7 @@ int setSizeMask(int size)
|
|||
int rtn_size = 0;
|
||||
|
||||
if ( size > TOTAL_BUTTONS) {
|
||||
LOG(AQUA_LOG,LOG_ERR, "Panel size is either invalid or too large for compiled parameters, ignoring %d using %d\n",size, TOTAL_BUTTONS);
|
||||
LOG(PANL_LOG,LOG_ERR, "Panel size is either invalid or too large for compiled parameters, ignoring %d using %d\n",size, TOTAL_BUTTONS);
|
||||
rtn_size = TOTAL_BUTTONS;
|
||||
}
|
||||
|
||||
|
@ -160,7 +160,7 @@ int setSizeMask(int size)
|
|||
_aqconfig_.paneltype_mask |= RSP_16;
|
||||
break;
|
||||
default:
|
||||
LOG(AQUA_LOG,LOG_ERR, "Didn't understand panel size, '%d' setting to size to 8\n",size);
|
||||
LOG(PANL_LOG,LOG_ERR, "Didn't understand panel size, '%d' setting to size to 8\n",size);
|
||||
_aqconfig_.paneltype_mask |= RSP_8;
|
||||
rtn_size = 8;
|
||||
break;
|
||||
|
@ -176,7 +176,7 @@ void setPanel(struct aqualinkdata *aqdata, bool rs, int size, bool combo, bool d
|
|||
{
|
||||
#ifndef AQ_PDA
|
||||
if (!rs) {
|
||||
LOG(AQUA_LOG,LOG_ERR, "Can't use PDA mode, AqualinkD has not been compiled with PDA Enabled\n");
|
||||
LOG(PANL_LOG,LOG_ERR, "Can't use PDA mode, AqualinkD has not been compiled with PDA Enabled\n");
|
||||
rs = true;
|
||||
}
|
||||
#endif
|
||||
|
@ -228,7 +228,7 @@ void setPanelByName(struct aqualinkdata *aqdata, const char *str)
|
|||
else // Account for PDA-8
|
||||
size = atoi(&str[4]);
|
||||
} else {
|
||||
LOG(AQUA_LOG,LOG_ERR, "Didn't understand panel type, '%.2s' from '%s' setting to size to RS-8\n",str,str);
|
||||
LOG(PANL_LOG,LOG_ERR, "Didn't understand panel type, '%.2s' from '%s' setting to size to RS-8\n",str,str);
|
||||
rs = true;
|
||||
size = 8;
|
||||
}
|
||||
|
@ -245,7 +245,7 @@ void setPanelByName(struct aqualinkdata *aqdata, const char *str)
|
|||
} else if (str[i+1] == 'D' || str[i+1] == 'd') {
|
||||
dual = true;
|
||||
} else {
|
||||
LOG(AQUA_LOG,LOG_ERR, "Didn't understand panel type, '%s' from '%s' setting to Combo\n",&str[i+1],str);
|
||||
LOG(PANL_LOG,LOG_ERR, "Didn't understand panel type, '%s' from '%s' setting to Combo\n",&str[i+1],str);
|
||||
combo = true;
|
||||
}
|
||||
|
||||
|
@ -503,8 +503,83 @@ void initPanelButtons(struct aqualinkdata *aqdata, bool rs, int size, bool combo
|
|||
#endif
|
||||
}
|
||||
|
||||
const char* getRequestName(request_source source)
|
||||
{
|
||||
switch(source) {
|
||||
case NET_MQTT:
|
||||
return "MQTT";
|
||||
break;
|
||||
case NET_API:
|
||||
return "API";
|
||||
break;
|
||||
case NET_WS:
|
||||
return "WebSocket";
|
||||
break;
|
||||
case NET_DZMQTT:
|
||||
return "Domoticz";
|
||||
break;
|
||||
case NET_TIMER:
|
||||
return "Timer";
|
||||
break;
|
||||
}
|
||||
|
||||
static char buf[25];
|
||||
sprintf(buf, "Unknown %d", source);
|
||||
return buf;
|
||||
}
|
||||
const char* getActionName(action_type type)
|
||||
{
|
||||
|
||||
|
||||
switch (type) {
|
||||
case ON_OFF:
|
||||
return "OnOff";
|
||||
break;
|
||||
case NO_ACTION:
|
||||
return "No Action";
|
||||
break;
|
||||
case POOL_HTR_SETOINT:
|
||||
return "Pool Heater Setpoint";
|
||||
break;
|
||||
case SPA_HTR_SETOINT:
|
||||
return "Spa Heater Setpoint";
|
||||
break;
|
||||
case FREEZE_SETPOINT:
|
||||
return "Freeze Protect Setpoint";
|
||||
break;
|
||||
case SWG_SETPOINT:
|
||||
return "SWG Percent";
|
||||
break;
|
||||
case SWG_BOOST:
|
||||
return "SWG Boost";
|
||||
break;
|
||||
case PUMP_RPM:
|
||||
return "VSP RPM/GPM";
|
||||
break;
|
||||
case PUMP_VSPROGRAM:
|
||||
return "VSP Program";
|
||||
break;
|
||||
case POOL_HTR_INCREMENT:
|
||||
return "Pool Heater Increment";
|
||||
break;
|
||||
case SPA_HTR_INCREMENT:
|
||||
return "Spa Heater Increment";
|
||||
break;
|
||||
case TIMER:
|
||||
return "Timer";
|
||||
break;
|
||||
case LIGHT_MODE:
|
||||
return "Light Mode";
|
||||
break;
|
||||
case DATE_TIME:
|
||||
return "Date Time";
|
||||
break;
|
||||
}
|
||||
|
||||
static char buf[25];
|
||||
sprintf(buf, "Unknown %d", type);
|
||||
return buf;
|
||||
}
|
||||
|
||||
//void create_PDA_on_off_request(aqkey *button, bool isON);
|
||||
//bool create_panel_request(struct aqualinkdata *aqdata, netRequest requester, int buttonIndex, int value, bool timer);
|
||||
|
@ -519,10 +594,10 @@ bool setDeviceState(struct aqualinkdata *aqdata, int deviceIndex, bool isON)
|
|||
if ((button->led->state == OFF && isON == false) ||
|
||||
(isON > 0 && (button->led->state == ON || button->led->state == FLASH ||
|
||||
button->led->state == ENABLE))) {
|
||||
LOG(AQUA_LOG, LOG_INFO, "received '%s' for '%s', already '%s', Ignoring\n", (isON == false ? "OFF" : "ON"), button->name, (isON == false ? "OFF" : "ON"));
|
||||
LOG(PANL_LOG, LOG_INFO, "received '%s' for '%s', already '%s', Ignoring\n", (isON == false ? "OFF" : "ON"), button->name, (isON == false ? "OFF" : "ON"));
|
||||
//return false;
|
||||
} else {
|
||||
LOG(AQUA_LOG, LOG_INFO, "received '%s' for '%s', turning '%s'\n", (isON == false ? "OFF" : "ON"), button->name, (isON == false ? "OFF" : "ON"));
|
||||
LOG(PANL_LOG, LOG_INFO, "received '%s' for '%s', turning '%s'\n", (isON == false ? "OFF" : "ON"), button->name, (isON == false ? "OFF" : "ON"));
|
||||
#ifdef AQ_PDA
|
||||
if (isPDA_PANEL) {
|
||||
if (button->special_mask & PROGRAM_LIGHT && isPDA_IAQT) {
|
||||
|
@ -570,16 +645,16 @@ bool setDeviceState(struct aqualinkdata *aqdata, int deviceIndex, bool isON)
|
|||
bool programDeviceValue(struct aqualinkdata *aqdata, action_type type, int value, int id, bool expectMultiple) // id is only valid for PUMP RPM
|
||||
{
|
||||
if (aqdata->unactioned.type != NO_ACTION && type != aqdata->unactioned.type)
|
||||
LOG(AQUA_LOG,LOG_ERR, "about to overwrite unactioned panel program\n");
|
||||
LOG(PANL_LOG,LOG_ERR, "about to overwrite unactioned panel program\n");
|
||||
|
||||
if (type == POOL_HTR_SETOINT || type == SPA_HTR_SETOINT || type == FREEZE_SETPOINT || type == SWG_SETPOINT ) {
|
||||
aqdata->unactioned.value = setpoint_check(type, value, aqdata);
|
||||
if (value != aqdata->unactioned.value)
|
||||
LOG(AQUA_LOG,LOG_NOTICE, "requested setpoint value %d is invalid, change to %d\n", value, aqdata->unactioned.value);
|
||||
LOG(PANL_LOG,LOG_NOTICE, "requested setpoint value %d is invalid, change to %d\n", value, aqdata->unactioned.value);
|
||||
} else if (type == PUMP_RPM) {
|
||||
aqdata->unactioned.value = value;
|
||||
} else if (type == PUMP_VSPROGRAM) {
|
||||
LOG(AQUA_LOG,LOG_ERR, "requested Pump vsp program is not implimented yet\n", value, aqdata->unactioned.value);
|
||||
LOG(PANL_LOG,LOG_ERR, "requested Pump vsp program is not implimented yet\n", value, aqdata->unactioned.value);
|
||||
} else {
|
||||
// SWG_BOOST & PUMP_RPM & SETPOINT incrment
|
||||
aqdata->unactioned.value = value;
|
||||
|
@ -604,7 +679,7 @@ void programDeviceLightMode(struct aqualinkdata *aqdata, int value, int button)
|
|||
clight_detail *light = NULL;
|
||||
#ifdef AQ_PDA
|
||||
if (isPDA_PANEL && !isPDA_IAQT) {
|
||||
LOG(AQUA_LOG,LOG_ERR, "Light mode control not supported in PDA mode\n");
|
||||
LOG(PANL_LOG,LOG_ERR, "Light mode control not supported in PDA mode\n");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
@ -617,7 +692,7 @@ void programDeviceLightMode(struct aqualinkdata *aqdata, int value, int button)
|
|||
}
|
||||
|
||||
if (light == NULL) {
|
||||
LOG(AQUA_LOG,LOG_ERR, "Light mode control not configured for button %d\n",button);
|
||||
LOG(PANL_LOG,LOG_ERR, "Light mode control not configured for button %d\n",button);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -647,20 +722,26 @@ void programDeviceLightMode(struct aqualinkdata *aqdata, int value, int button)
|
|||
//bool panel_device_request(struct aqualinkdata *aqdata, action_type type, int deviceIndex, int value, int subIndex, bool fromMQTT)
|
||||
bool panel_device_request(struct aqualinkdata *aqdata, action_type type, int deviceIndex, int value, request_source source)
|
||||
{
|
||||
LOG(AQUA_LOG,LOG_INFO, "Device request type %d for deviceindex %d of value %d from %d\n",type,deviceIndex, value, source);
|
||||
LOG(PANL_LOG,LOG_INFO, "Device request type '%s' for deviceindex %d '%s' of value %d from '%s'\n",
|
||||
getActionName(type),
|
||||
deviceIndex,aqdata->aqbuttons[deviceIndex].label,
|
||||
value,
|
||||
getRequestName(source));
|
||||
switch (type) {
|
||||
case ON_OFF:
|
||||
//setDeviceState(&aqdata->aqbuttons[deviceIndex], value<=0?false:true, deviceIndex );
|
||||
setDeviceState(aqdata, deviceIndex, value<=0?false:true );
|
||||
// Clear timer if off request and timer is active
|
||||
if (value<=0 && (aqdata->aqbuttons[deviceIndex].special_mask & TIMER_ACTIVE) == TIMER_ACTIVE ) {
|
||||
clear_timer(aqdata, &aqdata->aqbuttons[deviceIndex]);
|
||||
//clear_timer(aqdata, &aqdata->aqbuttons[deviceIndex]);
|
||||
clear_timer(aqdata, deviceIndex);
|
||||
}
|
||||
break;
|
||||
case TIMER:
|
||||
//setDeviceState(&aqdata->aqbuttons[deviceIndex], true);
|
||||
setDeviceState(aqdata, deviceIndex, true);
|
||||
start_timer(aqdata, &aqdata->aqbuttons[deviceIndex], value);
|
||||
//start_timer(aqdata, &aqdata->aqbuttons[deviceIndex], deviceIndex, value);
|
||||
start_timer(aqdata, deviceIndex, value);
|
||||
break;
|
||||
case LIGHT_MODE:
|
||||
programDeviceLightMode(aqdata, value, deviceIndex);
|
||||
|
@ -680,7 +761,7 @@ bool panel_device_request(struct aqualinkdata *aqdata, action_type type, int dev
|
|||
aq_programmer(AQ_SET_TIME, NULL, aqdata);
|
||||
break;
|
||||
default:
|
||||
LOG(AQUA_LOG,LOG_ERR, "Unknown device request type %d for deviceindex %d\n",type,deviceIndex);
|
||||
LOG(PANL_LOG,LOG_ERR, "Unknown device request type %d for deviceindex %d\n",type,deviceIndex);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
309
aq_programmer.c
309
aq_programmer.c
|
@ -502,46 +502,21 @@ bool in_swg_programming_mode(struct aqualinkdata *aq_data)
|
|||
|
||||
bool in_ot_programming_mode(struct aqualinkdata *aq_data)
|
||||
{
|
||||
//( type != AQ_SET_PUMP_RPM || type != AQ_SET_OT_MACRO )) {
|
||||
|
||||
if ( ( aq_data->active_thread.thread_id != 0 ) &&
|
||||
( aq_data->active_thread.ptype == AQ_SET_ONETOUCH_PUMP_RPM ||
|
||||
aq_data->active_thread.ptype == AQ_SET_ONETOUCH_MACRO ||
|
||||
aq_data->active_thread.ptype == AQ_GET_ONETOUCH_SETPOINTS ||
|
||||
aq_data->active_thread.ptype == AQ_SET_ONETOUCH_TIME ||
|
||||
aq_data->active_thread.ptype == AQ_SET_ONETOUCH_SWG_PERCENT ||
|
||||
aq_data->active_thread.ptype == AQ_SET_ONETOUCH_BOOST ||
|
||||
aq_data->active_thread.ptype == AQ_SET_ONETOUCH_POOL_HEATER_TEMP ||
|
||||
aq_data->active_thread.ptype == AQ_SET_ONETOUCH_SPA_HEATER_TEMP ||
|
||||
aq_data->active_thread.ptype == AQ_SET_ONETOUCH_FREEZEPROTECT)
|
||||
) {
|
||||
return true;
|
||||
if ( aq_data->active_thread.thread_id != 0 &&
|
||||
aq_data->active_thread.ptype >= AQP_ONETOUCH_MIN &&
|
||||
aq_data->active_thread.ptype <= AQP_ONETOUCH_MAX) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool in_iaqt_programming_mode(struct aqualinkdata *aq_data)
|
||||
{
|
||||
//( type != AQ_SET_PUMP_RPM || type != AQ_SET_OT_MACRO )) {
|
||||
|
||||
if ( ( aq_data->active_thread.thread_id != 0 ) &&
|
||||
( aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_PUMP_RPM ||
|
||||
aq_data->active_thread.ptype == AQ_GET_IAQTOUCH_VSP_ASSIGNMENT ||
|
||||
aq_data->active_thread.ptype == AQ_GET_IAQTOUCH_SETPOINTS ||
|
||||
aq_data->active_thread.ptype == AQ_GET_IAQTOUCH_AUX_LABELS ||
|
||||
aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_SWG_PERCENT ||
|
||||
aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_SWG_BOOST ||
|
||||
aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_POOL_HEATER_TEMP ||
|
||||
aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_SPA_HEATER_TEMP ||
|
||||
aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_SET_TIME ||
|
||||
aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_PUMP_VS_PROGRAM ||
|
||||
aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_DEVICE_ON_OFF ||
|
||||
aq_data->active_thread.ptype == AQ_SET_IAQTOUCH_LIGHTCOLOR_MODE)
|
||||
) {
|
||||
return true;
|
||||
if ( aq_data->active_thread.thread_id != 0 &&
|
||||
aq_data->active_thread.ptype >= AQP_IAQTOUCH_MIN &&
|
||||
aq_data->active_thread.ptype <= AQP_IAQTOUCH_MAX) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -1193,7 +1168,7 @@ bool setAqualinkNumericField(struct aqualinkdata *aq_data, char *value_label, in
|
|||
}
|
||||
bool setAqualinkNumericField_new(struct aqualinkdata *aq_data, char *value_label, int value, int increment)
|
||||
{
|
||||
LOG(PROG_LOG, LOG_DEBUG,"Setting menu item '%s' to %d\n",value_label, value);
|
||||
LOG(ALLB_LOG, LOG_DEBUG,"Setting menu item '%s' to %d\n",value_label, value);
|
||||
//char leading[10]; // description of the field (POOL, SPA, FRZ)
|
||||
int current_val=-1; // integer value of the current set point
|
||||
//char trailing[10]; // the degrees and scale
|
||||
|
@ -1205,15 +1180,15 @@ bool setAqualinkNumericField_new(struct aqualinkdata *aq_data, char *value_label
|
|||
do
|
||||
{
|
||||
if (waitForMessage(aq_data, searchBuf, 4) != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "AQ_Programmer Could not set numeric input '%s', not found\n",value_label);
|
||||
LOG(ALLB_LOG, LOG_WARNING, "AQ_Programmer Could not set numeric input '%s', not found\n",value_label);
|
||||
cancel_menu();
|
||||
return false;
|
||||
}
|
||||
//LOG(PROG_LOG, LOG_DEBUG,"WAITING for kick value=%d\n",current_val);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG,"WAITING for kick value=%d\n",current_val);
|
||||
//sscanf(aq_data->last_message, "%s %d%s", leading, ¤t_val, trailing);
|
||||
//sscanf(aq_data->last_message, "%*[^0123456789]%d", ¤t_val);
|
||||
sscanf(&aq_data->last_message[val_len], "%*[^0123456789]%d", ¤t_val);
|
||||
LOG(PROG_LOG, LOG_DEBUG, "%s set to %d, looking for %d\n",value_label,current_val,value);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "%s set to %d, looking for %d\n",value_label,current_val,value);
|
||||
|
||||
if(value > current_val) {
|
||||
// Increment the field.
|
||||
|
@ -1232,7 +1207,7 @@ bool setAqualinkNumericField_new(struct aqualinkdata *aq_data, char *value_label
|
|||
}
|
||||
|
||||
if (i++ >= 100) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "AQ_Programmer Could not set numeric input '%s', to '%d'\n",value_label,value);
|
||||
LOG(ALLB_LOG, LOG_WARNING, "AQ_Programmer Could not set numeric input '%s', to '%d'\n",value_label,value);
|
||||
send_cmd(KEY_ENTER);
|
||||
break;
|
||||
}
|
||||
|
@ -1245,7 +1220,7 @@ bool setAqualinkNumericField_new(struct aqualinkdata *aq_data, char *value_label
|
|||
|
||||
bool OLD_setAqualinkNumericField_OLD(struct aqualinkdata *aq_data, char *value_label, int value)
|
||||
{ // Works for everything but not SWG
|
||||
LOG(PROG_LOG, LOG_DEBUG,"Setting menu item '%s' to %d\n",value_label, value);
|
||||
LOG(ALLB_LOG, LOG_DEBUG,"Setting menu item '%s' to %d\n",value_label, value);
|
||||
char leading[10]; // description of the field (POOL, SPA, FRZ)
|
||||
int current_val; // integer value of the current set point
|
||||
char trailing[10]; // the degrees and scale
|
||||
|
@ -1256,13 +1231,13 @@ bool OLD_setAqualinkNumericField_OLD(struct aqualinkdata *aq_data, char *value_l
|
|||
do
|
||||
{
|
||||
if (waitForMessage(aq_data, searchBuf, 3) != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "AQ_Programmer Could not set numeric input '%s', not found\n",value_label);
|
||||
LOG(ALLB_LOG, LOG_WARNING, "AQ_Programmer Could not set numeric input '%s', not found\n",value_label);
|
||||
cancel_menu();
|
||||
return false;
|
||||
}
|
||||
//LOG(PROG_LOG, LOG_DEBUG,"WAITING for kick value=%d\n",current_val);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG,"WAITING for kick value=%d\n",current_val);
|
||||
sscanf(aq_data->last_message, "%s %d%s", leading, ¤t_val, trailing);
|
||||
LOG(PROG_LOG, LOG_DEBUG, "%s set to %d, looking for %d\n",value_label,current_val,value);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "%s set to %d, looking for %d\n",value_label,current_val,value);
|
||||
|
||||
if(value > current_val) {
|
||||
// Increment the field.
|
||||
|
@ -1337,10 +1312,10 @@ STOP BOOST POOL
|
|||
}
|
||||
#endif
|
||||
|
||||
LOG(PROG_LOG, LOG_DEBUG, "programming BOOST to %s\n", val==true?"On":"Off");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "programming BOOST to %s\n", val==true?"On":"Off");
|
||||
|
||||
if ( select_menu_item(aq_data, "BOOST POOL") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select BOOST POOL menu\n");
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select BOOST POOL menu\n");
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1360,16 +1335,16 @@ STOP BOOST POOL
|
|||
// This is a really bad hack, message sequence is out for boost for some reason, so as soon as we see stop message, force enter key.
|
||||
//_pgm_command = KEY_ENTER;
|
||||
send_cmd(KEY_ENTER);
|
||||
LOG(PROG_LOG, LOG_DEBUG, "**** FOUND STOP BOOST POOL ****\n");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "**** FOUND STOP BOOST POOL ****\n");
|
||||
//waitfor_queue2empty();
|
||||
break;
|
||||
} else {
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Find item in Menu: loop %d of %d looking for 'STOP BOOST POOL' received message '%s'\n",i,wait_messages,aq_data->last_message);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Find item in Menu: loop %d of %d looking for 'STOP BOOST POOL' received message '%s'\n",i,wait_messages,aq_data->last_message);
|
||||
delay(200);
|
||||
if (stristr(aq_data->last_message, "STOP BOOST POOL") != NULL) {
|
||||
//_pgm_command = KEY_ENTER;
|
||||
send_cmd(KEY_ENTER);
|
||||
LOG(PROG_LOG, LOG_DEBUG, "**** FOUND STOP BOOST POOL ****\n");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "**** FOUND STOP BOOST POOL ****\n");
|
||||
break;
|
||||
}
|
||||
send_cmd(KEY_RIGHT);
|
||||
|
@ -1389,7 +1364,7 @@ STOP BOOST POOL
|
|||
send_cmd(KEY_RIGHT);
|
||||
waitfor_queue2empty();
|
||||
if ( select_sub_menu_item(aq_data, "STOP BOOST POOL") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select STOP BOOST POOL menu\n");
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select STOP BOOST POOL menu\n");
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1425,11 +1400,11 @@ void *set_aqualink_SWG( void *ptr )
|
|||
}
|
||||
#endif
|
||||
|
||||
//LOG(PROG_LOG, LOG_NOTICE, "programming SWG percent to %d\n", val);
|
||||
//LOG(ALLB_LOG, LOG_NOTICE, "programming SWG percent to %d\n", val);
|
||||
|
||||
if ( select_menu_item(aq_data, "SET AQUAPURE") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SET AQUAPURE menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SET AQUAPURE menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1438,8 +1413,8 @@ void *set_aqualink_SWG( void *ptr )
|
|||
// If spa is on, set SWG for spa, if not set SWG for pool
|
||||
if (aq_data->aqbuttons[SPA_INDEX].led->state != OFF) {
|
||||
if (select_sub_menu_item(aq_data, "SET SPA SP") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SWG setpoint menu for SPA\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SWG setpoint menu for SPA\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1447,8 +1422,8 @@ void *set_aqualink_SWG( void *ptr )
|
|||
setAqualinkNumericField_new(aq_data, "SPA SP", val, 5);
|
||||
} else {
|
||||
if (select_sub_menu_item(aq_data, "SET POOL SP") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SWG setpoint menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SWG setpoint menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1461,7 +1436,7 @@ void *set_aqualink_SWG( void *ptr )
|
|||
|
||||
/*
|
||||
if (select_sub_menu_item(aq_data, "SET POOL SP") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SWG setpoint menu\n");
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SWG setpoint menu\n");
|
||||
cancel_menu(aq_data);
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1505,16 +1480,16 @@ void *get_aqualink_aux_labels( void *ptr )
|
|||
#endif
|
||||
|
||||
if ( select_menu_item(aq_data, "REVIEW") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select REVIEW menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select REVIEW menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
if (select_sub_menu_item(aq_data, "AUX LABELS") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select AUX LABELS menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select AUX LABELS menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1545,7 +1520,7 @@ void *set_aqualink_light_colormode( void *ptr )
|
|||
bool use_current_mode = false;
|
||||
|
||||
if (btn < 0 || btn >= aq_data->total_buttons ) {
|
||||
LOG(PROG_LOG, LOG_ERR, "Can't program light mode on button %d\n", btn);
|
||||
LOG(ALLB_LOG, LOG_ERR, "Can't program light mode on button %d\n", btn);
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
@ -1553,20 +1528,20 @@ void *set_aqualink_light_colormode( void *ptr )
|
|||
aqkey *button = &aq_data->aqbuttons[btn];
|
||||
unsigned char code = button->code;
|
||||
|
||||
//LOG(PROG_LOG, LOG_NOTICE, "Light Programming #: %d, on button: %s, color light type: %d\n", val, button->label, typ);
|
||||
//LOG(ALLB_LOG, LOG_NOTICE, "Light Programming #: %d, on button: %s, color light type: %d\n", val, button->label, typ);
|
||||
|
||||
if (val <= 0) {
|
||||
use_current_mode = true;
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming #: %d, on button: %s, color light type: %d, using current mode\n", val, button->label, typ);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming #: %d, on button: %s, color light type: %d, using current mode\n", val, button->label, typ);
|
||||
} else {
|
||||
mode_name = light_mode_name(typ, val-1, ALLBUTTON);
|
||||
use_current_mode = false;
|
||||
if (mode_name == NULL) {
|
||||
LOG(PROG_LOG, LOG_ERR, "Light Programming #: %d, on button: %s, color light type: %d, couldn't find mode name '%s'\n", val, button->label, typ, mode_name);
|
||||
LOG(ALLB_LOG, LOG_ERR, "Light Programming #: %d, on button: %s, color light type: %d, couldn't find mode name '%s'\n", val, button->label, typ, mode_name);
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
} else {
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming #: %d, on button: %s, color light type: %d, name '%s'\n", val, button->label, typ, mode_name);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming #: %d, on button: %s, color light type: %d, name '%s'\n", val, button->label, typ, mode_name);
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
@ -1581,11 +1556,11 @@ void *set_aqualink_light_colormode( void *ptr )
|
|||
*/
|
||||
// Needs to start programming sequence with light off
|
||||
if ( button->led->state == ON ) {
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming Initial state on, turning off\n");
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming Initial state on, turning off\n");
|
||||
send_cmd(code);
|
||||
waitfor_queue2empty();
|
||||
if ( !waitForMessage(threadCtrl->aq_data, "OFF", 5)) // Message like 'Aux3 Off'
|
||||
LOG(PROG_LOG, LOG_ERR, "Light Programming didn't receive OFF message\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "Light Programming didn't receive OFF message\n");
|
||||
}
|
||||
|
||||
// Now turn on and wait for the message "color mode name<>*"
|
||||
|
@ -1595,20 +1570,20 @@ void *set_aqualink_light_colormode( void *ptr )
|
|||
int waitCounter=12;
|
||||
|
||||
do{
|
||||
LOG(PROG_LOG, LOG_INFO,"Light program wait for message\n");
|
||||
LOG(ALLB_LOG, LOG_INFO,"Light program wait for message\n");
|
||||
if ( !waitForMessage(threadCtrl->aq_data, "~*", waitCounter))
|
||||
LOG(PROG_LOG, LOG_ERR, "Light Programming didn't receive color light mode message\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "Light Programming didn't receive color light mode message\n");
|
||||
|
||||
// Wait for less messages after first try. We get a lot of repeat messages before the one we need.
|
||||
waitCounter = 3;
|
||||
|
||||
if (use_current_mode) {
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming using color mode %s\n",aq_data->last_message);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming using color mode %s\n",aq_data->last_message);
|
||||
send_cmd(KEY_ENTER);
|
||||
waitfor_queue2empty();
|
||||
break;
|
||||
} else if (strncasecmp(aq_data->last_message, mode_name, strlen(mode_name)) == 0) {
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming found color mode %s\n",mode_name);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming found color mode %s\n",mode_name);
|
||||
send_cmd(KEY_ENTER);
|
||||
waitfor_queue2empty();
|
||||
break;
|
||||
|
@ -1624,7 +1599,7 @@ void *set_aqualink_light_colormode( void *ptr )
|
|||
} while (i <= LIGHT_COLOR_OPTIONS);
|
||||
|
||||
if (i == LIGHT_COLOR_OPTIONS) {
|
||||
LOG(PROG_LOG, LOG_ERR, "Light Programming didn't receive color light mode message for '%s'\n",use_current_mode?"light program":mode_name);
|
||||
LOG(ALLB_LOG, LOG_ERR, "Light Programming didn't receive color light mode message for '%s'\n",use_current_mode?"light program":mode_name);
|
||||
}
|
||||
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
|
@ -1651,7 +1626,7 @@ void *set_aqualink_light_programmode( void *ptr )
|
|||
float pmode = atof(&buf[20]);
|
||||
|
||||
if (btn < 0 || btn >= aq_data->total_buttons ) {
|
||||
LOG(PROG_LOG, LOG_ERR, "Can't program light mode on button %d\n", btn);
|
||||
LOG(ALLB_LOG, LOG_ERR, "Can't program light mode on button %d\n", btn);
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
@ -1659,7 +1634,7 @@ void *set_aqualink_light_programmode( void *ptr )
|
|||
aqkey *button = &aq_data->aqbuttons[btn];
|
||||
unsigned char code = button->code;
|
||||
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming #: %d, on button: %s, with pause mode: %f (initial on=%d, initial off=%d)\n", val, button->label, pmode, iOn, iOff);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming #: %d, on button: %s, with pause mode: %f (initial on=%d, initial off=%d)\n", val, button->label, pmode, iOn, iOff);
|
||||
|
||||
// Simply turn the light off if value is 0
|
||||
if (val <= 0) {
|
||||
|
@ -1674,23 +1649,23 @@ void *set_aqualink_light_programmode( void *ptr )
|
|||
// Needs to start programming sequence with light on, if off we need to turn on for 15 seconds
|
||||
// before we can send the next off.
|
||||
if ( button->led->state != ON ) {
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming Initial state off, turning on for %d seconds\n",iOn);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming Initial state off, turning on for %d seconds\n",iOn);
|
||||
send_cmd(code);
|
||||
delay(iOn * seconds);
|
||||
}
|
||||
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming turn off for %d seconds\n",iOff);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming turn off for %d seconds\n",iOff);
|
||||
// Now need to turn off for between 11 and 14 seconds to reset light.
|
||||
send_cmd(code);
|
||||
delay(iOff * seconds);
|
||||
|
||||
// Now light is reset, pulse the appropiate number of times to advance program.
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming button pulsing on/off %d times\n", val);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming button pulsing on/off %d times\n", val);
|
||||
|
||||
// Program light in safe mode (slowley), or quick mode
|
||||
if (pmode > 0) {
|
||||
for (i = 1; i < (val * 2); i++) {
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming button press number %d - %s of %d\n", i, i % 2 == 0 ? "Off" : "On", val);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming button press number %d - %s of %d\n", i, i % 2 == 0 ? "Off" : "On", val);
|
||||
send_cmd(code);
|
||||
waitfor_queue2empty();
|
||||
delay(pmode * seconds); // 0.3 works, but using 0.4 to be safe
|
||||
|
@ -1698,16 +1673,16 @@ void *set_aqualink_light_programmode( void *ptr )
|
|||
} else {
|
||||
for (i = 1; i < val; i++) {
|
||||
const int dt = 0.5; // Time to wait after receiving conformation of light on/off
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming button press number %d - %s of %d\n", i, "ON", val);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming button press number %d - %s of %d\n", i, "ON", val);
|
||||
send_cmd(code);
|
||||
waitForButtonState(aq_data, button, ON, 2);
|
||||
delay(dt * seconds);
|
||||
LOG(PROG_LOG, LOG_INFO, "Light Programming button press number %d - %s of %d\n", i, "OFF", val);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Light Programming button press number %d - %s of %d\n", i, "OFF", val);
|
||||
send_cmd(code);
|
||||
waitForButtonState(aq_data, button, OFF, 2);
|
||||
delay(dt * seconds);
|
||||
}
|
||||
LOG(PROG_LOG, LOG_INFO, "Finished - Light Programming button press number %d - %s of %d\n", i, "ON", val);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Finished - Light Programming button press number %d - %s of %d\n", i, "ON", val);
|
||||
send_cmd(code);
|
||||
waitfor_queue2empty();
|
||||
}
|
||||
|
@ -1754,12 +1729,12 @@ void *set_aqualink_pool_heater_temps( void *ptr )
|
|||
menu_name = "SET POOL TEMP";
|
||||
}
|
||||
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Setting pool heater setpoint to %d\n", val);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Setting pool heater setpoint to %d\n", val);
|
||||
//setAqualinkTemp(aq_data, "SET TEMP", "SET POOL TEMP", NULL, "POOL", val);
|
||||
|
||||
if ( select_menu_item(aq_data, "SET TEMP") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SET TEMP menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SET TEMP menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1767,8 +1742,8 @@ void *set_aqualink_pool_heater_temps( void *ptr )
|
|||
|
||||
//if (select_sub_menu_item(aq_data, "SET POOL TEMP") != true) {
|
||||
if (select_sub_menu_item(aq_data, menu_name) != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SET POOL TEMP menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SET POOL TEMP menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1831,12 +1806,12 @@ void *set_aqualink_spa_heater_temps( void *ptr )
|
|||
menu_name = "SET SPA TEMP";
|
||||
}
|
||||
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Setting spa heater setpoint to %d\n", val);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Setting spa heater setpoint to %d\n", val);
|
||||
|
||||
//setAqualinkTemp(aq_data, "SET TEMP", "SET SPA TEMP", NULL, "SPA", val);
|
||||
if ( select_menu_item(aq_data, "SET TEMP") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SET TEMP menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SET TEMP menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1844,8 +1819,8 @@ void *set_aqualink_spa_heater_temps( void *ptr )
|
|||
|
||||
//if (select_sub_menu_item(aq_data, "SET SPA TEMP") != true) {
|
||||
if (select_sub_menu_item(aq_data, menu_name) != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SET SPA TEMP menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SET SPA TEMP menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1891,7 +1866,7 @@ void *set_aqualink_freeze_heater_temps( void *ptr )
|
|||
*/
|
||||
val = setpoint_check(FREEZE_SETPOINT, val, aq_data);
|
||||
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Setting sfreeze protection to %d\n", val);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Setting sfreeze protection to %d\n", val);
|
||||
|
||||
#ifdef AQ_PDA
|
||||
if (isPDA_PANEL) {
|
||||
|
@ -1902,24 +1877,24 @@ void *set_aqualink_freeze_heater_temps( void *ptr )
|
|||
#endif
|
||||
//setAqualinkTemp(aq_data, "SYSTEM SETUP", "FRZ PROTECT", "TEMP SETTING", "FRZ", val);
|
||||
if ( select_menu_item(aq_data, "SYSTEM SETUP") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SYSTEM SETUP menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SYSTEM SETUP menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
if (select_sub_menu_item(aq_data, "FRZ PROTECT") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select FRZ PROTECT menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select FRZ PROTECT menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
if (select_sub_menu_item(aq_data, "TEMP SETTING") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select TEMP SETTING menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select TEMP SETTING menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -1941,7 +1916,7 @@ void *set_aqualink_time( void *ptr )
|
|||
struct aqualinkdata *aq_data = threadCtrl->aq_data;
|
||||
|
||||
waitForSingleThreadOrTerminate(threadCtrl, AQ_SET_TIME);
|
||||
//LOG(PROG_LOG, LOG_NOTICE, "Setting time on aqualink\n");
|
||||
//LOG(ALLB_LOG, LOG_NOTICE, "Setting time on aqualink\n");
|
||||
|
||||
#ifdef AQ_PDA
|
||||
if (isPDA_PANEL) {
|
||||
|
@ -1971,11 +1946,11 @@ void *set_aqualink_time( void *ptr )
|
|||
sprintf(hour, "HOUR %d PM", result->tm_hour - 12);
|
||||
|
||||
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Setting time to %d/%d/%d %d:%d\n", result->tm_mon + 1, result->tm_mday, result->tm_year + 1900, result->tm_hour + 1, result->tm_min);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Setting time to %d/%d/%d %d:%d\n", result->tm_mon + 1, result->tm_mday, result->tm_year + 1900, result->tm_hour + 1, result->tm_min);
|
||||
|
||||
if ( select_menu_item(aq_data, "SET TIME") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select SET TIME menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select SET TIME menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -2005,16 +1980,16 @@ void *get_aqualink_diag_model( void *ptr )
|
|||
waitForSingleThreadOrTerminate(threadCtrl, AQ_GET_DIAGNOSTICS_MODEL);
|
||||
|
||||
if ( select_menu_item(aq_data, "SYSTEM SETUP") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select HELP menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select HELP menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
if (select_sub_menu_item(aq_data, "DIAGNOSTICS") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select DIAGNOSTICS menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select DIAGNOSTICS menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "%s failed\n", ptypeName( aq_data->active_thread.ptype ) );
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -2030,18 +2005,18 @@ void *get_aqualink_diag_model( void *ptr )
|
|||
|
||||
void *get_aqualink_pool_spa_heater_temps( void *ptr )
|
||||
{
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "Could not select TEMP SET menu\n");
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "Could not select TEMP SET menu\n");
|
||||
struct programmingThreadCtrl *threadCtrl;
|
||||
threadCtrl = (struct programmingThreadCtrl *) ptr;
|
||||
struct aqualinkdata *aq_data = threadCtrl->aq_data;
|
||||
|
||||
waitForSingleThreadOrTerminate(threadCtrl, AQ_GET_POOL_SPA_HEATER_TEMPS);
|
||||
//LOG(PROG_LOG, LOG_NOTICE, "Getting pool & spa heat setpoints from aqualink\n");
|
||||
//LOG(ALLB_LOG, LOG_NOTICE, "Getting pool & spa heat setpoints from aqualink\n");
|
||||
|
||||
#ifdef AQ_PDA
|
||||
if (isPDA_PANEL) {
|
||||
if (!get_PDA_aqualink_pool_spa_heater_temps(aq_data)) {
|
||||
LOG(PROG_LOG, LOG_ERR, "Error Getting PDA pool & spa heater setpoints\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "Error Getting PDA pool & spa heater setpoints\n");
|
||||
}
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -2049,16 +2024,16 @@ void *get_aqualink_pool_spa_heater_temps( void *ptr )
|
|||
#endif
|
||||
|
||||
if ( select_menu_item(aq_data, "REVIEW") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select REVIEW menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "Can't get heater setpoints from Control Panel\n");
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select REVIEW menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "Can't get heater setpoints from Control Panel\n");
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
if (select_sub_menu_item(aq_data, "TEMP SET") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select TEMP SET menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "Can't get heater setpoints from Control Panel\n");
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select TEMP SET menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "Can't get heater setpoints from Control Panel\n");
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -2082,12 +2057,12 @@ void *get_freeze_protect_temp( void *ptr )
|
|||
struct aqualinkdata *aq_data = threadCtrl->aq_data;
|
||||
|
||||
waitForSingleThreadOrTerminate(threadCtrl, AQ_GET_FREEZE_PROTECT_TEMP);
|
||||
//LOG(PROG_LOG, LOG_NOTICE, "Getting freeze protection setpoints\n");
|
||||
//LOG(ALLB_LOG, LOG_NOTICE, "Getting freeze protection setpoints\n");
|
||||
|
||||
#ifdef AQ_PDA
|
||||
if (isPDA_PANEL) {
|
||||
if (! get_PDA_freeze_protect_temp(aq_data)) {
|
||||
LOG(PROG_LOG, LOG_ERR, "Error Getting PDA freeze protection setpoints\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "Error Getting PDA freeze protection setpoints\n");
|
||||
}
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -2095,16 +2070,16 @@ void *get_freeze_protect_temp( void *ptr )
|
|||
#endif
|
||||
|
||||
if ( select_menu_item(aq_data, "REVIEW") != true ) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select REVIEW menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "Can't get freeze setpoints from Control Panel\n");
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select REVIEW menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "Can't get freeze setpoints from Control Panel\n");
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
if (select_sub_menu_item(aq_data, "FRZ PROTECT") != true) {
|
||||
LOG(PROG_LOG, LOG_WARNING, "Could not select FRZ PROTECT menu\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "Can't get freeze setpoints from Control Panel\n");
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Could not select FRZ PROTECT menu\n");
|
||||
LOG(ALLB_LOG, LOG_ERR, "Can't get freeze setpoints from Control Panel\n");
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -2125,7 +2100,7 @@ bool get_aqualink_program_for_button(struct aqualinkdata *aq_data, unsigned char
|
|||
if (! waitForMessage(aq_data, "SELECT DEVICE TO REVIEW or PRESS ENTER TO END", rtnStringsWait))
|
||||
return false;
|
||||
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Send key '%d'\n",cmd);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Send key '%d'\n",cmd);
|
||||
send_cmd(cmd);
|
||||
return waitForEitherMessage(aq_data, "NOT SET", "TURNS ON", rtnStringsWait);
|
||||
}
|
||||
|
@ -2140,14 +2115,14 @@ void *get_aqualink_programs( void *ptr )
|
|||
waitForSingleThreadOrTerminate(threadCtrl, AQ_GET_PROGRAMS);
|
||||
|
||||
if ( select_menu_item(aq_data, "REVIEW") != true ) {
|
||||
//LOG(PROG_LOG, LOG_WARNING, "Could not select REVIEW menu\n");
|
||||
//LOG(ALLB_LOG, LOG_WARNING, "Could not select REVIEW menu\n");
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
|
||||
if (select_sub_menu_item(aq_data, "PROGRAMS") != true) {
|
||||
//LOG(PROG_LOG, LOG_WARNING, "Could not select PROGRAMS menu\n");
|
||||
//LOG(ALLB_LOG, LOG_WARNING, "Could not select PROGRAMS menu\n");
|
||||
cancel_menu();
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
|
@ -2156,22 +2131,22 @@ void *get_aqualink_programs( void *ptr )
|
|||
unsigned int i;
|
||||
|
||||
for (i=0; i < strlen(keys); i++) {
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "**** START program for key in loop %d\n",i);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "**** START program for key in loop %d\n",i);
|
||||
if (! get_aqualink_program_for_button(aq_data, keys[i])) {
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "**** Didn't find program for key in loop %d\n",i);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "**** Didn't find program for key in loop %d\n",i);
|
||||
//cancel_menu(aq_data);
|
||||
cleanAndTerminateThread(threadCtrl);
|
||||
return ptr;
|
||||
}
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "**** Found program for key in loop %d\n",i);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "**** Found program for key in loop %d\n",i);
|
||||
}
|
||||
|
||||
|
||||
if (waitForMessage(aq_data, "SELECT DEVICE TO REVIEW or PRESS ENTER TO END", 6)) {
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "Send key ENTER\n");
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "Send key ENTER\n");
|
||||
send_cmd(KEY_ENTER);
|
||||
} else {
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "Send CANCEL\n");
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "Send CANCEL\n");
|
||||
cancel_menu();
|
||||
}
|
||||
|
||||
|
@ -2186,7 +2161,7 @@ void *get_aqualink_programs( void *ptr )
|
|||
void send_cmd(unsigned char cmd, struct aqualinkdata *aq_data)
|
||||
{
|
||||
push_aq_cmd(cmd);
|
||||
LOG(PROG_LOG, LOG_INFO, "Queue send '0x%02hhx' to controller\n", cmd);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Queue send '0x%02hhx' to controller\n", cmd);
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -2197,9 +2172,9 @@ void _waitfor_queue2empty(bool longwait)
|
|||
int i=0;
|
||||
|
||||
if (_pgm_command != NUL) {
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Waiting for queue to empty\n");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Waiting for queue to empty\n");
|
||||
} else {
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Queue empty!\n");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Queue empty!\n");
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -2211,7 +2186,7 @@ void _waitfor_queue2empty(bool longwait)
|
|||
//while ( (_pgm_command != NUL) && ( i++ < (30*(longwait?2:1) ) ) ) {
|
||||
while ( (_pgm_command != NUL) && ( i++ < (50*(longwait?2:1) ) ) ) {
|
||||
//sleep(1); // NSF Change to smaller time.
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "******** QUEUE IS FULL ******** delay\n");
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "******** QUEUE IS FULL ******** delay\n");
|
||||
delay(50);
|
||||
}
|
||||
*/
|
||||
|
@ -2224,9 +2199,9 @@ void _waitfor_queue2empty(bool longwait)
|
|||
}
|
||||
}
|
||||
#endif
|
||||
LOG(PROG_LOG, LOG_WARNING, "Send command Queue did not empty, timeout\n");
|
||||
LOG(ALLB_LOG, LOG_WARNING, "Send command Queue did not empty, timeout\n");
|
||||
} else {
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Queue now empty!\n");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Queue now empty!\n");
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -2247,12 +2222,12 @@ void send_cmd(unsigned char cmd)
|
|||
_pgm_command = cmd;
|
||||
//delay(200);
|
||||
|
||||
LOG(PROG_LOG, LOG_INFO, "Queue send '0x%02hhx' to controller (programming)\n", _pgm_command);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Queue send '0x%02hhx' to controller (programming)\n", _pgm_command);
|
||||
}
|
||||
void force_queue_delete()
|
||||
{
|
||||
if (_pgm_command != NUL)
|
||||
LOG(PROG_LOG, LOG_INFO, "Really bad coding, don't use this in release\n");
|
||||
LOG(ALLB_LOG, LOG_INFO, "Really bad coding, don't use this in release\n");
|
||||
|
||||
_pgm_command = NUL;
|
||||
}
|
||||
|
@ -2270,7 +2245,7 @@ void send_cmd(unsigned char cmd, struct aqualinkdata *aq_data)
|
|||
aq_data->aq_command = cmd;
|
||||
//delay(200);
|
||||
|
||||
LOG(PROG_LOG, LOG_INFO, "Queue send '0x%02hhx' to controller\n", aq_data->aq_command);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Queue send '0x%02hhx' to controller\n", aq_data->aq_command);
|
||||
}
|
||||
*/
|
||||
|
||||
|
@ -2285,7 +2260,7 @@ void cancel_menu()
|
|||
|
||||
bool waitForEitherMessage(struct aqualinkdata *aq_data, char* message1, char* message2, int numMessageReceived)
|
||||
{
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "waitForMessage %s %d %d\n",message,numMessageReceived,cmd);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "waitForMessage %s %d %d\n",message,numMessageReceived,cmd);
|
||||
waitfor_queue2empty(); // MAke sure the last command was sent
|
||||
int i=0;
|
||||
pthread_mutex_lock(&aq_data->active_thread.thread_mutex);
|
||||
|
@ -2309,12 +2284,12 @@ bool waitForEitherMessage(struct aqualinkdata *aq_data, char* message1, char* me
|
|||
|
||||
while( ++i <= numMessageReceived)
|
||||
{
|
||||
LOG(PROG_LOG, LOG_DEBUG, "loop %d of %d looking for '%s' OR '%s' received message1 '%s'\n",i,numMessageReceived,message1,message2,aq_data->last_message);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "loop %d of %d looking for '%s' OR '%s' received message1 '%s'\n",i,numMessageReceived,message1,message2,aq_data->last_message);
|
||||
|
||||
if (message1 != NULL) {
|
||||
ptr = stristr(aq_data->last_message, msgS1);
|
||||
if (ptr != NULL) { // match
|
||||
LOG(PROG_LOG, LOG_DEBUG, "String MATCH '%s'\n", msgS1);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "String MATCH '%s'\n", msgS1);
|
||||
if (msgS1 == message1) // match & don't care if first char
|
||||
break;
|
||||
else if (ptr == aq_data->last_message) // match & do care if first char
|
||||
|
@ -2324,7 +2299,7 @@ bool waitForEitherMessage(struct aqualinkdata *aq_data, char* message1, char* me
|
|||
if (message2 != NULL) {
|
||||
ptr = stristr(aq_data->last_message, msgS2);
|
||||
if (ptr != NULL) { // match
|
||||
LOG(PROG_LOG, LOG_DEBUG, "String MATCH '%s'\n", msgS2);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "String MATCH '%s'\n", msgS2);
|
||||
if (msgS2 == message2) // match & don't care if first char
|
||||
break;
|
||||
else if (ptr == aq_data->last_message) // match & do care if first char
|
||||
|
@ -2332,19 +2307,19 @@ bool waitForEitherMessage(struct aqualinkdata *aq_data, char* message1, char* me
|
|||
}
|
||||
}
|
||||
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "looking for '%s' received message1 '%s'\n",message1,aq_data->last_message);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "looking for '%s' received message1 '%s'\n",message1,aq_data->last_message);
|
||||
pthread_cond_wait(&aq_data->active_thread.thread_cond, &aq_data->active_thread.thread_mutex);
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "loop %d of %d looking for '%s' received message1 '%s'\n",i,numMessageReceived,message1,aq_data->last_message);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "loop %d of %d looking for '%s' received message1 '%s'\n",i,numMessageReceived,message1,aq_data->last_message);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&aq_data->active_thread.thread_mutex);
|
||||
|
||||
if (message1 != NULL && message2 != NULL && ptr == NULL) {
|
||||
//logmessage1(LOG_ERR, "Could not select MENU of Aqualink control panel\n");
|
||||
LOG(PROG_LOG, LOG_ERR, "Did not find '%s'\n",message1);
|
||||
LOG(ALLB_LOG, LOG_ERR, "Did not find '%s'\n",message1);
|
||||
return false;
|
||||
}
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Found message1 '%s' or '%s' in '%s'\n",message1,message2,aq_data->last_message);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Found message1 '%s' or '%s' in '%s'\n",message1,message2,aq_data->last_message);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2353,7 +2328,7 @@ bool waitForEitherMessage(struct aqualinkdata *aq_data, char* message1, char* me
|
|||
|
||||
bool waitForMessage(struct aqualinkdata *aq_data, char* message, int numMessageReceived)
|
||||
{
|
||||
LOG(PROG_LOG, LOG_DEBUG, "waitForMessage %s %d\n",message,numMessageReceived);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "waitForMessage %s %d\n",message,numMessageReceived);
|
||||
// NSF Need to come back to this, as it stops on test enviornment but not real panel, so must be speed related.
|
||||
//waitfor_queue2empty(); // MAke sure the last command was sent
|
||||
|
||||
|
@ -2372,14 +2347,14 @@ bool waitForMessage(struct aqualinkdata *aq_data, char* message, int numMessageR
|
|||
while( ++i <= numMessageReceived)
|
||||
{
|
||||
if (message != NULL)
|
||||
LOG(PROG_LOG, LOG_DEBUG, "loop %d of %d looking for '%s', last message received '%s'\n",i,numMessageReceived,message,aq_data->last_message);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "loop %d of %d looking for '%s', last message received '%s'\n",i,numMessageReceived,message,aq_data->last_message);
|
||||
else
|
||||
LOG(PROG_LOG, LOG_DEBUG, "loop %d of %d waiting for next message, last message received '%s'\n",i,numMessageReceived,aq_data->last_message);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "loop %d of %d waiting for next message, last message received '%s'\n",i,numMessageReceived,aq_data->last_message);
|
||||
|
||||
if (message != NULL) {
|
||||
ptr = stristr(aq_data->last_message, msgS);
|
||||
if (ptr != NULL) { // match
|
||||
LOG(PROG_LOG, LOG_DEBUG, "String MATCH\n");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "String MATCH\n");
|
||||
if (msgS == message) // match & don't care if first char
|
||||
break;
|
||||
else if (ptr == aq_data->last_message) // match & do care if first char
|
||||
|
@ -2387,23 +2362,23 @@ bool waitForMessage(struct aqualinkdata *aq_data, char* message, int numMessageR
|
|||
}
|
||||
}
|
||||
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "looking for '%s' received message '%s'\n",message,aq_data->last_message);
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "*** pthread_cond_wait() sleep\n");
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "looking for '%s' received message '%s'\n",message,aq_data->last_message);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "*** pthread_cond_wait() sleep\n");
|
||||
pthread_cond_wait(&aq_data->active_thread.thread_cond, &aq_data->active_thread.thread_mutex);
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "*** pthread_cond_wait() wake\n");
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "loop %d of %d looking for '%s' received message '%s'\n",i,numMessageReceived,message,aq_data->last_message);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "*** pthread_cond_wait() wake\n");
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "loop %d of %d looking for '%s' received message '%s'\n",i,numMessageReceived,message,aq_data->last_message);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&aq_data->active_thread.thread_mutex);
|
||||
|
||||
if (message != NULL && ptr == NULL) {
|
||||
//LOG(PROG_LOG, LOG_ERR, "Could not select MENU of Aqualink control panel\n");
|
||||
LOG(PROG_LOG, LOG_DEBUG, "did not find '%s'\n",message);
|
||||
//LOG(ALLB_LOG, LOG_ERR, "Could not select MENU of Aqualink control panel\n");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "did not find '%s'\n",message);
|
||||
return false;
|
||||
} else if (message != NULL)
|
||||
LOG(PROG_LOG, LOG_DEBUG, "found message '%s' in '%s'\n",message,aq_data->last_message);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "found message '%s' in '%s'\n",message,aq_data->last_message);
|
||||
else
|
||||
LOG(PROG_LOG, LOG_DEBUG, "waited for %d message(s)\n",numMessageReceived);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "waited for %d message(s)\n",numMessageReceived);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -2467,7 +2442,7 @@ bool select_sub_menu_item(struct aqualinkdata *aq_data, char* item_string)
|
|||
|
||||
while( (stristr(aq_data->last_message, item_string) == NULL) && ( i++ < wait_messages) )
|
||||
{
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Find item in Menu: loop %d of %d looking for '%s' received message '%s'\n",i,wait_messages,item_string,aq_data->last_message);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Find item in Menu: loop %d of %d looking for '%s' received message '%s'\n",i,wait_messages,item_string,aq_data->last_message);
|
||||
send_cmd(KEY_RIGHT);
|
||||
waitfor_queue2empty(); // ADDED BACK MAY 2023 setting time warked better
|
||||
//waitForMessage(aq_data, NULL, 1);
|
||||
|
@ -2475,11 +2450,11 @@ bool select_sub_menu_item(struct aqualinkdata *aq_data, char* item_string)
|
|||
}
|
||||
|
||||
if (stristr(aq_data->last_message, item_string) == NULL) {
|
||||
LOG(PROG_LOG, LOG_ERR, "Could not find menu item '%s'\n",item_string);
|
||||
LOG(ALLB_LOG, LOG_ERR, "Could not find menu item '%s'\n",item_string);
|
||||
return false;
|
||||
}
|
||||
|
||||
LOG(PROG_LOG, LOG_DEBUG, "Find item in Menu: loop %d of %d FOUND menu item '%s', sending ENTER command\n",i,wait_messages, item_string);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "Find item in Menu: loop %d of %d FOUND menu item '%s', sending ENTER command\n",i,wait_messages, item_string);
|
||||
// Enter the mode specified by the argument.
|
||||
|
||||
|
||||
|
@ -2499,32 +2474,32 @@ bool select_sub_menu_item(struct aqualinkdata *aq_data, char* item_string)
|
|||
|
||||
bool waitForButtonState(struct aqualinkdata *aq_data, aqkey* button, aqledstate state, int numMessageReceived)
|
||||
{
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "waitForMessage %s %d %d\n",message,numMessageReceived,cmd);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "waitForMessage %s %d %d\n",message,numMessageReceived,cmd);
|
||||
int i=0;
|
||||
pthread_mutex_lock(&aq_data->active_thread.thread_mutex);
|
||||
|
||||
while( ++i <= numMessageReceived)
|
||||
{
|
||||
LOG(PROG_LOG, LOG_DEBUG, "loop %d of %d looking for state change to '%d' for '%s' \n",i,numMessageReceived,button->led->state,button->name);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "loop %d of %d looking for state change to '%d' for '%s' \n",i,numMessageReceived,button->led->state,button->name);
|
||||
|
||||
if (button->led->state == state) {
|
||||
LOG(PROG_LOG, LOG_INFO, "Button State =%d for %s\n",state,button->name);
|
||||
LOG(ALLB_LOG, LOG_INFO, "Button State =%d for %s\n",state,button->name);
|
||||
break;
|
||||
}
|
||||
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "looking for '%s' received message '%s'\n",message,aq_data->last_message);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "looking for '%s' received message '%s'\n",message,aq_data->last_message);
|
||||
pthread_cond_wait(&aq_data->active_thread.thread_cond, &aq_data->active_thread.thread_mutex);
|
||||
//LOG(PROG_LOG, LOG_DEBUG, "loop %d of %d looking for '%s' received message '%s'\n",i,numMessageReceived,message,aq_data->last_message);
|
||||
//LOG(ALLB_LOG, LOG_DEBUG, "loop %d of %d looking for '%s' received message '%s'\n",i,numMessageReceived,message,aq_data->last_message);
|
||||
}
|
||||
|
||||
pthread_mutex_unlock(&aq_data->active_thread.thread_mutex);
|
||||
|
||||
if (numMessageReceived >= i) {
|
||||
//LOG(PROG_LOG, LOG_ERR, "Could not select MENU of Aqualink control panel\n");
|
||||
LOG(PROG_LOG, LOG_DEBUG, "did not find state '%d' for '%s'\n",button->led->state,button->name);
|
||||
//LOG(ALLB_LOG, LOG_ERR, "Could not select MENU of Aqualink control panel\n");
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "did not find state '%d' for '%s'\n",button->led->state,button->name);
|
||||
return false;
|
||||
}
|
||||
LOG(PROG_LOG, LOG_DEBUG, "found state '%d' for '%s'\n",button->led->state,button->name);
|
||||
LOG(ALLB_LOG, LOG_DEBUG, "found state '%d' for '%s'\n",button->led->state,button->name);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -52,15 +52,20 @@ typedef enum {
|
|||
AQ_GET_PROGRAMS,
|
||||
AQ_SET_LIGHTPROGRAM_MODE,
|
||||
AQ_SET_LIGHTCOLOR_MODE,
|
||||
AQ_PDA_INIT,
|
||||
AQ_SET_SWG_PERCENT,
|
||||
AQ_PDA_DEVICE_STATUS,
|
||||
AQ_PDA_DEVICE_ON_OFF,
|
||||
AQ_GET_AUX_LABELS,
|
||||
AQ_PDA_WAKE_INIT,
|
||||
AQ_SET_BOOST,
|
||||
AQ_SET_PUMP_RPM,
|
||||
AQ_SET_PUMP_VS_PROGRAM,
|
||||
// ******** Delimiter make sure to change MAX/MIN below
|
||||
// NSF Need to add Specific ALL Button ones here
|
||||
// ******** Delimiter make sure to change MAX/MIN below
|
||||
// NSF Need to add ALL Specific PDA ones here
|
||||
AQ_PDA_INIT,
|
||||
AQ_PDA_WAKE_INIT,
|
||||
// ******** Delimiter make sure to change MAX/MIN below
|
||||
AQ_SET_ONETOUCH_PUMP_RPM,
|
||||
AQ_SET_ONETOUCH_MACRO,
|
||||
AQ_GET_ONETOUCH_SETPOINTS,
|
||||
|
@ -71,6 +76,7 @@ typedef enum {
|
|||
AQ_SET_ONETOUCH_TIME,
|
||||
AQ_SET_ONETOUCH_BOOST,
|
||||
AQ_SET_ONETOUCH_SWG_PERCENT,
|
||||
// ******** Delimiter make sure to change MAX/MIN below
|
||||
AQ_SET_IAQTOUCH_PUMP_RPM,
|
||||
AQ_SET_IAQTOUCH_PUMP_VS_PROGRAM,
|
||||
AQ_GET_IAQTOUCH_VSP_ASSIGNMENT,
|
||||
|
@ -85,13 +91,33 @@ typedef enum {
|
|||
AQ_SET_IAQTOUCH_SET_TIME,
|
||||
AQ_SET_IAQTOUCH_DEVICE_ON_OFF,
|
||||
AQ_SET_IAQTOUCH_LIGHTCOLOR_MODE,
|
||||
// ******** Delimiter make sure to change MAX/MIN below
|
||||
AQ_GET_RSSADAPTER_SETPOINTS,
|
||||
AQ_SET_RSSADAPTER_POOL_HEATER_TEMP,
|
||||
AQ_SET_RSSADAPTER_SPA_HEATER_TEMP,
|
||||
AQ_ADD_RSSADAPTER_POOL_HEATER_TEMP,
|
||||
AQ_ADD_RSSADAPTER_SPA_HEATER_TEMP
|
||||
AQ_ADD_RSSADAPTER_SPA_HEATER_TEMP,
|
||||
// ******** Delimiter make sure to change MAX/MIN below
|
||||
} program_type;
|
||||
|
||||
#define AQP_GENERIC_MIN AQ_GET_POOL_SPA_HEATER_TEMPS
|
||||
#define AQP_GENERIC_MAX AQ_SET_PUMP_VS_PROGRAM
|
||||
|
||||
#define AQP_ALLBUTTON_MIN AQP_NULL
|
||||
#define AQP_ALLBUTTONL_MAX AQP_NULL
|
||||
|
||||
#define AQP_PDA_MIN AQ_PDA_INIT
|
||||
#define AQP_PDA_MAX AQ_PDA_WAKE_INIT
|
||||
|
||||
#define AQP_ONETOUCH_MIN AQ_SET_ONETOUCH_PUMP_RPM
|
||||
#define AQP_ONETOUCH_MAX AQ_SET_ONETOUCH_SWG_PERCENT
|
||||
|
||||
#define AQP_IAQTOUCH_MIN AQ_SET_IAQTOUCH_PUMP_RPM
|
||||
#define AQP_IAQTOUCH_MAX AQ_SET_IAQTOUCH_LIGHTCOLOR_MODE
|
||||
|
||||
#define AQP_RSSADAPTER_MIN AQ_GET_RSSADAPTER_SETPOINTS
|
||||
#define AQP_RSSADAPTER_MAX AQ_ADD_RSSADAPTER_SPA_HEATER_TEMP
|
||||
|
||||
|
||||
struct programmingThreadCtrl {
|
||||
pthread_t thread_id;
|
||||
|
|
209
aq_serial.c
209
aq_serial.c
|
@ -46,6 +46,9 @@ ioctl(fd, TIOCSSERIAL, &serial);
|
|||
|
||||
*/
|
||||
|
||||
// Default to send command with leading NUL, this changes that
|
||||
//#define SEND_CMD_WITH_TRAILING_NUL
|
||||
|
||||
//#define BLOCKING_MODE
|
||||
|
||||
static bool _blocking_mode = false;
|
||||
|
@ -60,7 +63,45 @@ void send_packet(int fd, unsigned char *packet, int length);
|
|||
|
||||
|
||||
|
||||
const char* get_packet_type(unsigned char* packet , int length)
|
||||
const char* get_pentair_packet_type(unsigned char* packet , int length)
|
||||
{
|
||||
static char buf[15];
|
||||
|
||||
if (length <= 0 )
|
||||
return "";
|
||||
|
||||
switch (packet[PEN_PKT_CMD]) {
|
||||
case PEN_CMD_SPEED:
|
||||
if (packet[PEN_PKT_DEST]== PEN_DEV_MASTER)
|
||||
return "VSP SetSpeed rtn";
|
||||
else
|
||||
return "VSP SetSpeed";
|
||||
break;
|
||||
case PEN_CMD_REMOTECTL:
|
||||
if (packet[PEN_PKT_DEST]== PEN_DEV_MASTER)
|
||||
return "VSP RemoteCtl rtn";
|
||||
else
|
||||
return "VSP RemoteCtl";
|
||||
break;
|
||||
case PEN_CMD_POWER:
|
||||
if (packet[PEN_PKT_DEST]== PEN_DEV_MASTER)
|
||||
return "VSP SetPower rtn";
|
||||
else
|
||||
return "VSP SetPower";
|
||||
break;
|
||||
case PEN_CMD_STATUS:
|
||||
if (packet[PEN_PKT_DEST]== PEN_DEV_MASTER)
|
||||
return "VSP Status";
|
||||
else
|
||||
return "VSP GetStatus";
|
||||
break;
|
||||
default:
|
||||
sprintf(buf, "Unknown '0x%02hhx'", packet[PEN_PKT_CMD]);
|
||||
return buf;
|
||||
break;
|
||||
}
|
||||
}
|
||||
const char* get_jandy_packet_type(unsigned char* packet , int length)
|
||||
{
|
||||
static char buf[15];
|
||||
|
||||
|
@ -191,6 +232,16 @@ const char* get_packet_type(unsigned char* packet , int length)
|
|||
}
|
||||
}
|
||||
|
||||
const char* get_packet_type(unsigned char* packet , int length)
|
||||
{
|
||||
if (getProtocolType(packet)==PENTAIR) {
|
||||
return get_pentair_packet_type(packet, length);
|
||||
}
|
||||
|
||||
return get_jandy_packet_type(packet, length);
|
||||
}
|
||||
|
||||
|
||||
// Generate and return checksum of packet.
|
||||
int generate_checksum(unsigned char* packet, int length)
|
||||
{
|
||||
|
@ -424,9 +475,6 @@ int unlock_port(int fd)
|
|||
|
||||
// https://www.cmrr.umn.edu/~strupp/serial.html#2_5_2
|
||||
// http://unixwiz.net/techtips/termios-vmin-vtime.html
|
||||
//#define OLD_SERIAL_INIT
|
||||
#ifndef OLD_SERIAL_INIT
|
||||
|
||||
|
||||
// Unless AQ_RS_EXTRA_OPTS is defined, blocking will always be true
|
||||
int _init_serial_port(const char* tty, bool blocking, bool readahead)
|
||||
|
@ -513,60 +561,7 @@ int _init_serial_port(const char* tty, bool blocking, bool readahead)
|
|||
|
||||
return fd;
|
||||
}
|
||||
#else //OLD_SERIAL_INIT
|
||||
int _init_serial_port(const char* tty, bool blocking, bool readahead) // readahead ignored in this implimentation
|
||||
{
|
||||
|
||||
long BAUD = B9600;
|
||||
long DATABITS = CS8;
|
||||
long STOPBITS = 0;
|
||||
long PARITYON = 0;
|
||||
long PARITY = 0;
|
||||
|
||||
struct termios newtio; //place for old and new port settings for serial port
|
||||
|
||||
_blocking_mode = blocking;
|
||||
|
||||
//int fd = open(tty, O_RDWR | O_NOCTTY | O_NONBLOCK);
|
||||
int fd = open(tty, O_RDWR | O_NOCTTY | O_NONBLOCK | O_NDELAY);
|
||||
if (fd < 0) {
|
||||
LOG(RSSD_LOG,LOG_ERR, "Unable to open port: %s\n", tty);
|
||||
return -1;
|
||||
}
|
||||
|
||||
LOG(RSSD_LOG,LOG_DEBUG, "Openeded serial port %s\n",tty);
|
||||
|
||||
if (_blocking_mode) {
|
||||
// http://unixwiz.net/techtips/termios-vmin-vtime.html
|
||||
// Not designed behaviour, but it's what we need.
|
||||
fcntl(fd, F_SETFL, 0);
|
||||
newtio.c_cc[VMIN]= 1;
|
||||
//newtio.c_cc[VTIME]= 0; // This will wait indefinatly. (not the best if panel / rs485 adapter is down)
|
||||
newtio.c_cc[VTIME]= 50; // (1 to 255) 1 = 0.1 sec, 255 = 25.5 sec
|
||||
LOG(RSSD_LOG,LOG_INFO, "Set serial port %s to blocking mode\n",tty);
|
||||
} else {
|
||||
int flags = fcntl(fd, F_GETFL, 0);
|
||||
fcntl(fd, F_SETFL, flags | O_NONBLOCK | O_NDELAY);
|
||||
newtio.c_cc[VMIN]= 0;
|
||||
newtio.c_cc[VTIME]= 1; // This should be 0 if we have readahead before write
|
||||
LOG(RSSD_LOG,LOG_INFO, "Set serial port %s to non blocking mode\n",tty);
|
||||
}
|
||||
|
||||
tcgetattr(fd, &_oldtio); // save current port settings
|
||||
// set new port settings for canonical input processing
|
||||
newtio.c_cflag = BAUD | DATABITS | STOPBITS | PARITYON | PARITY | CLOCAL | CREAD;
|
||||
newtio.c_iflag = IGNPAR;
|
||||
newtio.c_lflag = 0; // ICANON;
|
||||
newtio.c_oflag = 0;
|
||||
|
||||
tcflush(fd, TCIFLUSH);
|
||||
tcsetattr(fd, TCSANOW, &newtio);
|
||||
|
||||
LOG(RSSD_LOG,LOG_DEBUG, "Set serial port %s io attributes\n",tty);
|
||||
|
||||
return fd;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
void close_blocking_serial_port()
|
||||
|
@ -656,13 +651,15 @@ void send_pentair_command(int fd, unsigned char *packet_buffer, int size)
|
|||
packet[++i] = NUL; // Checksum
|
||||
packet[++i] = NUL; // Checksum
|
||||
generate_pentair_checksum(&packet[1], i);
|
||||
packet[++i] = NUL;
|
||||
//packet[++i] = NUL;
|
||||
|
||||
|
||||
//logPacket(packet, i);
|
||||
send_packet(fd,packet,i);
|
||||
send_packet(fd,packet,++i);
|
||||
}
|
||||
|
||||
#ifndef SEND_CMD_WITH_TRAILING_NUL
|
||||
|
||||
void send_jandy_command(int fd, unsigned char *packet_buffer, int size)
|
||||
{
|
||||
unsigned char packet[AQ_MAXPKTLEN];
|
||||
|
@ -677,6 +674,26 @@ void send_jandy_command(int fd, unsigned char *packet_buffer, int size)
|
|||
packet[i] = packet_buffer[i-3];
|
||||
}
|
||||
|
||||
packet[++i] = DLE;
|
||||
packet[++i] = ETX;
|
||||
|
||||
packet[i-2] = generate_checksum(packet, i+1);
|
||||
|
||||
send_packet(fd,packet,++i);
|
||||
}
|
||||
#else
|
||||
void send_jandy_command(int fd, unsigned char *packet_buffer, int size)
|
||||
{
|
||||
unsigned char packet[AQ_MAXPKTLEN];
|
||||
int i=0;
|
||||
|
||||
packet[0] = DLE;
|
||||
packet[1] = STX;
|
||||
|
||||
for (i=2; i-2 < size; i++) {
|
||||
packet[i] = packet_buffer[i-2];
|
||||
}
|
||||
|
||||
packet[++i] = DLE;
|
||||
packet[++i] = ETX;
|
||||
packet[++i] = NUL;
|
||||
|
@ -685,7 +702,7 @@ void send_jandy_command(int fd, unsigned char *packet_buffer, int size)
|
|||
|
||||
send_packet(fd,packet,++i);
|
||||
}
|
||||
|
||||
#endif
|
||||
/*
|
||||
unsigned char tp[] = {PCOL_PENTAIR, 0x07, 0x0F, 0x10, 0x08, 0x0D, 0x55, 0x55, 0x5B, 0x2A, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x64, 0x00, 0x00, 0x00};
|
||||
send_command(0, tp, 19);
|
||||
|
@ -793,7 +810,8 @@ void send_packet(int fd, unsigned char *packet, int length)
|
|||
// MAYBE Change this back to debug serial
|
||||
LOG(RSSD_LOG,LOG_DEBUG_SERIAL, "Serial write %d bytes\n",length-2);
|
||||
//LOG(RSSD_LOG,LOG_DEBUG, "Serial write %d bytes, type 0x%02hhx cmd 0x%02hhx\n",length-2,packet[5],packet[6]);
|
||||
logPacketWrite(&packet[1], length-2);
|
||||
if (_aqconfig_.log_protocol_packets || getLogLevel(RSSD_LOG) >= LOG_DEBUG_SERIAL)
|
||||
logPacketWrite(&packet[1], length-2);
|
||||
/*
|
||||
if (getLogLevel(PDA_LOG) == LOG_DEBUG) {
|
||||
char buff[1024];
|
||||
|
@ -814,39 +832,74 @@ void send_packet(int fd, unsigned char *packet, int length)
|
|||
|
||||
tcdrain(fd); // Make sure buffer has been sent.
|
||||
//if (_aqconfig_.frame_delay > 0) {
|
||||
#ifndef SERIAL_LOGGER
|
||||
if (_aqconfig_.frame_delay > 0) {
|
||||
timespec_subtract(&elapsed_time, &now, &last_serial_read_time);
|
||||
LOG(RSSD_LOG, LOG_DEBUG, "Time from recv to %s send is %ld.%09ld sec\n",
|
||||
(_blocking_mode?"blocking":"non-blocking"), elapsed_time.tv_sec,
|
||||
elapsed_time.tv_nsec);
|
||||
LOG(RSTM_LOG, LOG_DEBUG, "Time from recv to %s send is %.3f sec\n",
|
||||
(_blocking_mode?"blocking":"non-blocking"),
|
||||
roundf3(timespec2float(&elapsed_time)));
|
||||
}
|
||||
#endif
|
||||
//}
|
||||
|
||||
}
|
||||
|
||||
#ifndef SEND_CMD_WITH_TRAILING_NUL
|
||||
void _send_ack(int fd, unsigned char ack_type, unsigned char command)
|
||||
{
|
||||
const int length = 11;
|
||||
//const int length = 11;
|
||||
int length = 10;
|
||||
// Default null ack with checksum generated, don't mess with it, just over right
|
||||
unsigned char ackPacket[] = { NUL, DLE, STX, DEV_MASTER, CMD_ACK, NUL, NUL, 0x13, DLE, ETX, NUL };
|
||||
//unsigned char ackPacket[] = { NUL, DLE, STX, DEV_MASTER, CMD_ACK, NUL, NUL, 0x13, DLE, ETX };
|
||||
|
||||
// To overcome Pentair VSP bug in Jandy control panel, we need to NOT send trailing NUL on
|
||||
// a normal ACK, but sent the trailing NUL on in ack with command.
|
||||
// Always send trailing NUL causes VSP to loose connection
|
||||
// Never sending trailing NUL causes come commands to be missed.
|
||||
|
||||
// Update the packet and checksum if command argument is not NUL.
|
||||
if(command != NUL || ack_type != NUL) {
|
||||
//ackPacket[5] = 0x00 normal, 0x03 some pause, 0x01 some pause ending (0x01 = Screen Busy (also return from logn message))
|
||||
ackPacket[5] = ack_type;
|
||||
ackPacket[6] = command;
|
||||
ackPacket[7] = generate_checksum(ackPacket, length-1);
|
||||
ackPacket[7] = generate_checksum(ackPacket, length);
|
||||
if (command == DLE) { // We shuld probably also check the ack type as well, just for future proofing.
|
||||
// 0x10(DLE) that's not part of the headder or footer needs to be escaped AFTER with NUL, so shif everyting uo one
|
||||
ackPacket[8] = ackPacket[7]; // move the caculated checksum
|
||||
ackPacket[7] = NUL; // escape the DLE
|
||||
ackPacket[9] = DLE; // add new end sequence
|
||||
ackPacket[10] = ETX; // add new end sequence
|
||||
ackPacket[10] = ETX; // add new end sequence
|
||||
length = 11;
|
||||
}
|
||||
}
|
||||
|
||||
//printf("***Send ACK (%s) ***\n",(ack_type==ACK_NORMAL?"Normal":(ack_type==ACK_SCREEN_BUSY?"ScreenBusy":"ScreenBusyDisplay")) );
|
||||
|
||||
send_packet(fd, ackPacket, length);
|
||||
}
|
||||
#else
|
||||
void _send_ack(int fd, unsigned char ack_type, unsigned char command)
|
||||
{
|
||||
//const int length = 11;
|
||||
int length = 9;
|
||||
// Default null ack with checksum generated, don't mess with it, just over right
|
||||
unsigned char ackPacket[] = { DLE, STX, DEV_MASTER, CMD_ACK, NUL, NUL, 0x13, DLE, ETX, NUL };
|
||||
|
||||
if(command != NUL || ack_type != NUL) {
|
||||
//ackPacket[5] = 0x00 normal, 0x03 some pause, 0x01 some pause ending (0x01 = Screen Busy (also return from logn message))
|
||||
ackPacket[4] = ack_type;
|
||||
ackPacket[5] = command;
|
||||
ackPacket[6] = generate_checksum(ackPacket, length);
|
||||
if (command == DLE) { // We shuld probably also check the ack type as well, just for future proofing.
|
||||
// 0x10(DLE) that's not part of the headder or footer needs to be escaped AFTER with NUL, so shif everyting uo one
|
||||
ackPacket[7] = ackPacket[7]; // move the caculated checksum
|
||||
ackPacket[6] = NUL; // escape the DLE
|
||||
ackPacket[8] = DLE; // add new end sequence
|
||||
ackPacket[9] = ETX; // add new end sequence
|
||||
length = 10;
|
||||
}
|
||||
}
|
||||
send_packet(fd, ackPacket, length);
|
||||
}
|
||||
#endif // SEND_CMD_WITH_TRAILING_NUL
|
||||
|
||||
void send_ack(int fd, unsigned char command)
|
||||
{
|
||||
|
@ -885,6 +938,8 @@ int get_packet(int fd, unsigned char* packet)
|
|||
//bool lastByteDLE = false;
|
||||
int PentairPreCnt = 0;
|
||||
int PentairDataCnt = -1;
|
||||
struct timespec packet_elapsed;
|
||||
struct timespec packet_end_time;
|
||||
|
||||
memset(packet, 0, AQ_MAXPKTLEN);
|
||||
|
||||
|
@ -1053,7 +1108,19 @@ int get_packet(int fd, unsigned char* packet)
|
|||
}
|
||||
|
||||
//if (_aqconfig_.frame_delay > 0) {
|
||||
clock_gettime(CLOCK_REALTIME, &last_serial_read_time);
|
||||
|
||||
if (_aqconfig_.frame_delay > 0 || getLogLevel(RSTM_LOG) >= LOG_DEBUG) {
|
||||
clock_gettime(CLOCK_REALTIME, &packet_end_time);
|
||||
if (getLogLevel(RSTM_LOG) >= LOG_DEBUG) {
|
||||
timespec_subtract(&packet_elapsed, &packet_end_time, &last_serial_read_time);
|
||||
LOG(RSTM_LOG, LOG_DEBUG, "Time between packets (%.3f sec)\n", roundf3(timespec2float(&packet_elapsed)) );
|
||||
}
|
||||
if (_aqconfig_.frame_delay > 0) {
|
||||
memcpy(&last_serial_read_time, &packet_end_time, sizeof(struct timespec));
|
||||
}
|
||||
}
|
||||
|
||||
//clock_gettime(CLOCK_REALTIME, &last_serial_read_time);
|
||||
//}
|
||||
LOG(RSSD_LOG,LOG_DEBUG_SERIAL, "Serial read %d bytes\n",index);
|
||||
if (_aqconfig_.log_protocol_packets || getLogLevel(RSSD_LOG) >= LOG_DEBUG_SERIAL)
|
||||
|
|
24
aq_serial.h
24
aq_serial.h
|
@ -62,16 +62,30 @@
|
|||
#define PP3 0xFF
|
||||
#define PP4 0xA5
|
||||
|
||||
#define PEN_CMD_STATUS 0x07
|
||||
#define PEN_DEV_MASTER 0x10
|
||||
|
||||
#define PEN_CMD_SPEED 0x01
|
||||
#define PEN_CMD_REMOTECTL 0x04
|
||||
#define PEN_CMD_POWER 0x06
|
||||
#define PEN_CMD_STATUS 0x07
|
||||
|
||||
|
||||
|
||||
#define PEN_PKT_FROM 6
|
||||
#define PEN_PKT_DEST 5
|
||||
#define PEN_PKT_CMD 7
|
||||
|
||||
#define PEN_HI_B_RPM 14
|
||||
#define PEN_LO_B_RPM 15
|
||||
#define PEN_HI_B_WAT 12
|
||||
#define PEN_LO_B_WAT 13
|
||||
// Pentair VSP
|
||||
#define PEN_MODE 10
|
||||
#define PEN_DRIVE_STATE 11
|
||||
#define PEN_HI_B_WAT 12
|
||||
#define PEN_LO_B_WAT 13
|
||||
#define PEN_HI_B_RPM 14
|
||||
#define PEN_LO_B_RPM 15
|
||||
#define PEN_FLOW 16
|
||||
#define PEN_PPC 17 // Pump pressure curve
|
||||
#define PEN_HI_B_STATUS 20 // The current status value of the pump. following values: ok, filterWarning, overCurrent, priming, systemBlocked, generalAlarm, powerOutage, overCurrent2, overVoltage, commLost
|
||||
#define PEN_LO_B_STATUS 21
|
||||
// END Pentair
|
||||
|
||||
#define AQ_MINPKTLEN 5
|
||||
|
|
31
aq_timer.c
31
aq_timer.c
|
@ -16,6 +16,7 @@ struct timerthread {
|
|||
pthread_mutex_t thread_mutex;
|
||||
pthread_cond_t thread_cond;
|
||||
aqkey *button;
|
||||
int deviceIndex;
|
||||
struct aqualinkdata *aq_data;
|
||||
int duration_min;
|
||||
struct timespec timeout;
|
||||
|
@ -56,9 +57,10 @@ int get_timer_left(aqkey *button)
|
|||
return 0;
|
||||
}
|
||||
|
||||
void clear_timer(struct aqualinkdata *aq_data, aqkey *button)
|
||||
void clear_timer(struct aqualinkdata *aq_data, /*aqkey *button,*/ int deviceIndex)
|
||||
{
|
||||
struct timerthread *t_ptr = find_timerthread(button);
|
||||
//struct timerthread *t_ptr = find_timerthread(button);
|
||||
struct timerthread *t_ptr = find_timerthread(&aq_data->aqbuttons[deviceIndex]);
|
||||
|
||||
if (t_ptr != NULL) {
|
||||
LOG(TIMR_LOG, LOG_INFO, "Clearing timer for '%s'\n",t_ptr->button->name);
|
||||
|
@ -67,8 +69,9 @@ void clear_timer(struct aqualinkdata *aq_data, aqkey *button)
|
|||
}
|
||||
}
|
||||
|
||||
void start_timer(struct aqualinkdata *aq_data, aqkey *button, int duration)
|
||||
void start_timer(struct aqualinkdata *aq_data, /*aqkey *button,*/ int deviceIndex, int duration)
|
||||
{
|
||||
aqkey *button = &aq_data->aqbuttons[deviceIndex];
|
||||
struct timerthread *t_ptr = find_timerthread(button);
|
||||
|
||||
if (t_ptr != NULL) {
|
||||
|
@ -77,23 +80,11 @@ void start_timer(struct aqualinkdata *aq_data, aqkey *button, int duration)
|
|||
pthread_cond_broadcast(&t_ptr->thread_cond);
|
||||
return;
|
||||
}
|
||||
/*
|
||||
struct timerthread *t_ptr;
|
||||
|
||||
if (_timerthread_ll != NULL) {
|
||||
for (t_ptr = _timerthread_ll; t_ptr != NULL; t_ptr = t_ptr->next) {
|
||||
if (t_ptr->button == button) {
|
||||
LOG(TIMR_LOG, LOG_INFO, "already active for '%s', resetting\n",t_ptr->button->name);
|
||||
t_ptr->duration_min = duration;
|
||||
pthread_cond_broadcast(&t_ptr->thread_cond);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
struct timerthread *tmthread = calloc(1, sizeof(struct timerthread));
|
||||
tmthread->aq_data = aq_data;
|
||||
tmthread->button = button;
|
||||
tmthread->deviceIndex = deviceIndex;
|
||||
tmthread->thread_id = 0;
|
||||
tmthread->duration_min = duration;
|
||||
tmthread->next = NULL;
|
||||
|
@ -147,7 +138,8 @@ void *timer_worker( void *ptr )
|
|||
} else {
|
||||
// crap way to do this, need to use net_service logic in teh future, but should never actually get here
|
||||
LOG(TIMR_LOG, LOG_NOTICE, "turning on '%s'\n",tmthread->button->name);
|
||||
aq_send_cmd(tmthread->button->code);
|
||||
//aq_send_cmd(tmthread->button->code);
|
||||
panel_device_request(tmthread->aq_data, ON_OFF, tmthread->deviceIndex, false, NET_TIMER);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -173,13 +165,16 @@ void *timer_worker( void *ptr )
|
|||
LOG(TIMR_LOG, LOG_NOTICE, "End timer for '%s'\n",tmthread->button->name);
|
||||
|
||||
if (tmthread->button->led->state != OFF) {
|
||||
LOG(TIMR_LOG, LOG_INFO, "Timer waking turning '%s' off\n",tmthread->button->name);
|
||||
LOG(TIMR_LOG, LOG_INFO, "Timer waking turning '%s' off\n",tmthread->button->name);
|
||||
/*
|
||||
#ifdef AQ_PDA
|
||||
if (isPDA_PANEL)
|
||||
create_PDA_on_off_request(tmthread->button, false);
|
||||
else
|
||||
#endif
|
||||
aq_send_cmd(tmthread->button->code);
|
||||
*/
|
||||
panel_device_request(tmthread->aq_data, ON_OFF, tmthread->deviceIndex, false, NET_TIMER);
|
||||
} else {
|
||||
LOG(TIMR_LOG, LOG_INFO, "Timer waking '%s' is already off\n",tmthread->button->name);
|
||||
}
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
#include "aqualink.h"
|
||||
|
||||
void start_timer(struct aqualinkdata *aq_data, aqkey *button, int duration);
|
||||
void start_timer(struct aqualinkdata *aq_data, /*aqkey *button,*/ int deviceIndex, int duration);
|
||||
int get_timer_left(aqkey *button);
|
||||
void clear_timer(struct aqualinkdata *aq_data, aqkey *button);
|
||||
void clear_timer(struct aqualinkdata *aq_data, /*aqkey *button,*/ int deviceIndex);
|
||||
// Not best place for this, but leave it here so all requests are in net services, this is forward decleration of function in net_services.c
|
||||
#ifdef AQ_PDA
|
||||
void create_PDA_on_off_request(aqkey *button, bool isON);
|
||||
|
|
|
@ -167,6 +167,11 @@ typedef struct pumpd
|
|||
protocolType prclType;
|
||||
aqkey *button;
|
||||
//bool updated;
|
||||
// Other VSP values read directly from RS485
|
||||
int mode; // 0 local control, 1 remote control
|
||||
//int driveState; // Haven't figured out what this is yet
|
||||
int status;
|
||||
int pressureCurve;
|
||||
} pump_detail;
|
||||
|
||||
// color light modes (Aqualink program, Jandy, Jandy LED, SAm/SAL, Color Logic, Intellibrite)
|
||||
|
@ -185,7 +190,9 @@ typedef enum {
|
|||
NET_MQTT=0,
|
||||
NET_API,
|
||||
NET_WS,
|
||||
NET_DZMQTT} request_source;
|
||||
NET_DZMQTT,
|
||||
NET_TIMER // Not used yet, need to change aq_timer.c
|
||||
} request_source;
|
||||
|
||||
typedef struct clightd
|
||||
{
|
||||
|
|
78
aqualinkd.c
78
aqualinkd.c
|
@ -385,6 +385,7 @@ void _processMessage(char *message, bool reset)
|
|||
//static int swg_msg_count = 0;
|
||||
//static int boost_msg_count = 0;
|
||||
static int16_t msg_loop = 0;
|
||||
static aqledstate default_frz_protect_state = OFF;
|
||||
// NSF replace message with msg
|
||||
#ifdef AQ_RS16
|
||||
int16_t rs16;
|
||||
|
@ -392,7 +393,7 @@ void _processMessage(char *message, bool reset)
|
|||
|
||||
//msg = stripwhitespace(message);
|
||||
//strcpy(_aqualink_data.last_message, msg);
|
||||
//LOG(AQRS_LOG,LOG_INFO, "RS Message :- '%s'\n", msg);
|
||||
//LOG(ALLB_LOG,LOG_INFO, "RS Message :- '%s'\n", msg);
|
||||
|
||||
|
||||
|
||||
|
@ -404,7 +405,7 @@ void _processMessage(char *message, bool reset)
|
|||
if (!reset) {
|
||||
msg = stripwhitespace(message);
|
||||
strcpy(_aqualink_data.last_message, msg);
|
||||
LOG(AQRS_LOG,LOG_INFO, "RS Message :- '%s'\n", msg);
|
||||
LOG(ALLB_LOG,LOG_INFO, "RS Message :- '%s'\n", msg);
|
||||
// Just set this to off, it will re-set since it'll be the only message we get if on
|
||||
_aqualink_data.service_mode_state = OFF;
|
||||
} else {
|
||||
|
@ -414,7 +415,7 @@ void _processMessage(char *message, bool reset)
|
|||
|
||||
// Anything that wasn't on during the last set of messages, turn off
|
||||
if ((msg_loop & MSG_FREEZE) != MSG_FREEZE)
|
||||
_aqualink_data.frz_protect_state = OFF;
|
||||
_aqualink_data.frz_protect_state = default_frz_protect_state;
|
||||
|
||||
if ((msg_loop & MSG_SERVICE) != MSG_SERVICE &&
|
||||
(msg_loop & MSG_TIMEOUT) != MSG_TIMEOUT ) {
|
||||
|
@ -434,16 +435,16 @@ void _processMessage(char *message, bool reset)
|
|||
if (_aqualink_data.swg_percent != 0 || _aqualink_data.swg_led_state == ON) {
|
||||
// Something is wrong here. Let's check pump, if on set SWG to 0, if off turn SWE off
|
||||
if ( _aqualink_data.aqbuttons[PUMP_INDEX].led->state == OFF) {
|
||||
LOG(AQRS_LOG,LOG_INFO, "No AQUAPURE message in cycle, pump is off so setting SWG to off\n");
|
||||
LOG(ALLB_LOG,LOG_INFO, "No AQUAPURE message in cycle, pump is off so setting SWG to off\n");
|
||||
setSWGoff(&_aqualink_data);
|
||||
} else {
|
||||
LOG(AQRS_LOG,LOG_INFO, "No AQUAPURE message in cycle, pump is on so setting SWG to 0%%\n");
|
||||
LOG(ALLB_LOG,LOG_INFO, "No AQUAPURE message in cycle, pump is on so setting SWG to 0%%\n");
|
||||
changeSWGpercent(&_aqualink_data, 0);
|
||||
}
|
||||
} else if (isIAQT_ENABLED == false && isONET_ENABLED == false && READ_RSDEV_SWG == false ) {
|
||||
//We have no other way to read SWG %=0, so turn SWG on with pump
|
||||
if ( _aqualink_data.aqbuttons[PUMP_INDEX].led->state == ON) {
|
||||
LOG(AQRS_LOG,LOG_INFO, "No AQUAPURE message in cycle, pump is off so setting SWG to off\n");
|
||||
LOG(ALLB_LOG,LOG_INFO, "No AQUAPURE message in cycle, pump is off so setting SWG to off\n");
|
||||
//changeSWGpercent(&_aqualink_data, 0);
|
||||
setSWGenabled(&_aqualink_data);
|
||||
}
|
||||
|
@ -515,6 +516,7 @@ void _processMessage(char *message, bool reset)
|
|||
//LOG(AQUA_LOG,LOG_DEBUG, "frz protect long message: %s", &message[28]);
|
||||
_aqualink_data.frz_protect_set_point = atoi(message + 28);
|
||||
_aqualink_data.frz_protect_state = ENABLE;
|
||||
default_frz_protect_state = ENABLE;
|
||||
|
||||
if (_aqualink_data.temp_units == UNKNOWN)
|
||||
setUnits(msg);
|
||||
|
@ -551,7 +553,7 @@ void _processMessage(char *message, bool reset)
|
|||
if (isSINGLE_DEV_PANEL != true)
|
||||
{
|
||||
changePanelToMode_Only();
|
||||
LOG(AQRS_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
LOG(ALLB_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
}
|
||||
}
|
||||
else if (stristr(msg, LNG_MSG_WATER_TEMP1_SET) != NULL)
|
||||
|
@ -564,7 +566,7 @@ void _processMessage(char *message, bool reset)
|
|||
if (isSINGLE_DEV_PANEL != true)
|
||||
{
|
||||
changePanelToMode_Only();
|
||||
LOG(AQRS_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
LOG(ALLB_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
}
|
||||
}
|
||||
else if (stristr(msg, LNG_MSG_WATER_TEMP2_SET) != NULL)
|
||||
|
@ -577,13 +579,13 @@ void _processMessage(char *message, bool reset)
|
|||
if (isSINGLE_DEV_PANEL != true)
|
||||
{
|
||||
changePanelToMode_Only();
|
||||
LOG(AQRS_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
LOG(ALLB_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
}
|
||||
}
|
||||
else if (stristr(msg, LNG_MSG_SERVICE_ACTIVE) != NULL)
|
||||
{
|
||||
if (_aqualink_data.service_mode_state == OFF)
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "AqualinkD set to Service Mode\n");
|
||||
LOG(ALLB_LOG,LOG_NOTICE, "AqualinkD set to Service Mode\n");
|
||||
_aqualink_data.service_mode_state = ON;
|
||||
msg_loop |= MSG_SERVICE;
|
||||
//service_msg_count = 0;
|
||||
|
@ -591,7 +593,7 @@ void _processMessage(char *message, bool reset)
|
|||
else if (stristr(msg, LNG_MSG_TIMEOUT_ACTIVE) != NULL)
|
||||
{
|
||||
if (_aqualink_data.service_mode_state == OFF)
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "AqualinkD set to Timeout Mode\n");
|
||||
LOG(ALLB_LOG,LOG_NOTICE, "AqualinkD set to Timeout Mode\n");
|
||||
_aqualink_data.service_mode_state = FLASH;
|
||||
msg_loop |= MSG_TIMEOUT;
|
||||
//service_msg_count = 0;
|
||||
|
@ -648,16 +650,16 @@ void _processMessage(char *message, bool reset)
|
|||
// Setting time takes a long time, so don't try until we have all other programmed data.
|
||||
if (_initWithRS == true && strlen(_aqualink_data.date) > 1 && checkAqualinkTime() != true)
|
||||
{
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "RS time is NOT accurate '%s %s', re-setting on controller!\n", _aqualink_data.time, _aqualink_data.date);
|
||||
LOG(ALLB_LOG,LOG_NOTICE, "RS time is NOT accurate '%s %s', re-setting on controller!\n", _aqualink_data.time, _aqualink_data.date);
|
||||
aq_programmer(AQ_SET_TIME, NULL, &_aqualink_data);
|
||||
}
|
||||
else if (_initWithRS == false || _aqconfig_.sync_panel_time == false)
|
||||
{
|
||||
LOG(AQRS_LOG,LOG_DEBUG, "RS time '%s %s' not checking\n", _aqualink_data.time, _aqualink_data.date);
|
||||
LOG(ALLB_LOG,LOG_DEBUG, "RS time '%s %s' not checking\n", _aqualink_data.time, _aqualink_data.date);
|
||||
}
|
||||
else if (_initWithRS == true)
|
||||
{
|
||||
LOG(AQRS_LOG,LOG_DEBUG, "RS time is accurate '%s %s'\n", _aqualink_data.time, _aqualink_data.date);
|
||||
LOG(ALLB_LOG,LOG_DEBUG, "RS time is accurate '%s %s'\n", _aqualink_data.time, _aqualink_data.date);
|
||||
}
|
||||
// If we get a time message before REV, the controller didn't see us as we started too quickly.
|
||||
/* Don't need to check this anymore with the check for probe before startup.
|
||||
|
@ -675,8 +677,8 @@ void _processMessage(char *message, bool reset)
|
|||
strcpy(_aqualink_data.version, msg);
|
||||
rsm_get_revision(_aqualink_data.revision, _aqualink_data.version, strlen(_aqualink_data.version));
|
||||
//_gotREV = true;
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "Control Panel version %s\n", _aqualink_data.version);
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "Control Panel revision %s\n", _aqualink_data.revision);
|
||||
LOG(ALLB_LOG,LOG_NOTICE, "Control Panel version %s\n", _aqualink_data.version);
|
||||
LOG(ALLB_LOG,LOG_NOTICE, "Control Panel revision %s\n", _aqualink_data.revision);
|
||||
if (_initWithRS == false)
|
||||
{
|
||||
//LOG(ALLBUTTON,LOG_NOTICE, "Standard protocol initialization complete\n");
|
||||
|
@ -687,7 +689,7 @@ void _processMessage(char *message, bool reset)
|
|||
}
|
||||
else if (stristr(msg, " TURNS ON") != NULL)
|
||||
{
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "Program data '%s'\n", msg);
|
||||
LOG(ALLB_LOG,LOG_NOTICE, "Program data '%s'\n", msg);
|
||||
}
|
||||
else if (_aqconfig_.override_freeze_protect == TRUE && strncasecmp(msg, "Press Enter* to override Freeze Protection with", 47) == 0)
|
||||
{
|
||||
|
@ -727,9 +729,9 @@ void _processMessage(char *message, bool reset)
|
|||
// Aux1: on panel = Button 3 in aqualinkd (button 2 in array)
|
||||
if (strncasecmp(msg+ni+3, "No Label", 8) != 0) {
|
||||
_aqualink_data.aqbuttons[labelid].label = prittyString(cleanalloc(msg+ni+2));
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "AUX ID %s label set to '%s'\n", _aqualink_data.aqbuttons[labelid].name, _aqualink_data.aqbuttons[labelid].label);
|
||||
LOG(ALLB_LOG,LOG_NOTICE, "AUX ID %s label set to '%s'\n", _aqualink_data.aqbuttons[labelid].name, _aqualink_data.aqbuttons[labelid].label);
|
||||
} else {
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "AUX ID %s has no control panel label using '%s'\n", _aqualink_data.aqbuttons[labelid].name, _aqualink_data.aqbuttons[labelid].label);
|
||||
LOG(ALLB_LOG,LOG_NOTICE, "AUX ID %s has no control panel label using '%s'\n", _aqualink_data.aqbuttons[labelid].name, _aqualink_data.aqbuttons[labelid].label);
|
||||
}
|
||||
//_aqualink_data.aqbuttons[labelid + 1].label = cleanalloc(msg + 5);
|
||||
}
|
||||
|
@ -753,7 +755,7 @@ void _processMessage(char *message, bool reset)
|
|||
}
|
||||
else
|
||||
{
|
||||
LOG(AQRS_LOG,LOG_DEBUG_SERIAL, "Ignoring '%s'\n", msg);
|
||||
LOG(ALLB_LOG,LOG_DEBUG_SERIAL, "Ignoring '%s'\n", msg);
|
||||
//_aqualink_data.display_message = msg;
|
||||
//if (in_programming_mode(&_aqualink_data) == false && _aqualink_data.simulate_panel == false &&
|
||||
if (in_programming_mode(&_aqualink_data) == false &&
|
||||
|
@ -780,7 +782,7 @@ void _processMessage(char *message, bool reset)
|
|||
//ascii(_aqualink_data.last_display_message, msg);
|
||||
|
||||
|
||||
//LOG(AQRS_LOG,LOG_INFO, "RS Message loop :- '%d'\n", msg_loop);
|
||||
//LOG(ALLB_LOG,LOG_INFO, "RS Message loop :- '%d'\n", msg_loop);
|
||||
|
||||
// We processed the next message, kick any threads waiting on the message.
|
||||
//printf ("Message kicking\n");
|
||||
|
@ -797,12 +799,14 @@ bool process_packet(unsigned char *packet, int length)
|
|||
static char message[AQ_MSGLONGLEN + 1];
|
||||
static int processing_long_msg = 0;
|
||||
|
||||
LOG(ALLB_LOG,LOG_DEBUG_SERIAL, "process_packer()\n", length);
|
||||
|
||||
// Check packet against last check if different.
|
||||
// Should only use the checksum, not whole packet since it's status messages.
|
||||
/*
|
||||
if ( packet[PKT_CMD] == CMD_STATUS && (memcmp(packet, last_packet, length) == 0))
|
||||
{
|
||||
LOG(AQRS_LOG,LOG_DEBUG_SERIAL, "RS Received duplicate, ignoring.\n", length);
|
||||
LOG(ALLB_LOG,LOG_DEBUG_SERIAL, "RS Received duplicate, ignoring.\n", length);
|
||||
return rtn;
|
||||
}
|
||||
else
|
||||
|
@ -827,7 +831,7 @@ bool process_packet(unsigned char *packet, int length)
|
|||
|
||||
if ( packet[PKT_CMD] == CMD_STATUS && packet[length-3] == last_checksum && ! in_programming_mode(&_aqualink_data) )
|
||||
{
|
||||
LOG(AQRS_LOG,LOG_DEBUG_SERIAL, "RS Received duplicate, ignoring.\n", length);
|
||||
LOG(ALLB_LOG,LOG_DEBUG_SERIAL, "RS Received duplicate, ignoring.\n", length);
|
||||
return false;
|
||||
}
|
||||
else
|
||||
|
@ -844,15 +848,15 @@ bool process_packet(unsigned char *packet, int length)
|
|||
processMessage(message);
|
||||
}
|
||||
|
||||
LOG(AQRS_LOG,LOG_DEBUG_SERIAL, "RS Received packet type 0x%02hhx length %d.\n", packet[PKT_CMD], length);
|
||||
LOG(ALLB_LOG,LOG_DEBUG_SERIAL, "RS Received packet type 0x%02hhx length %d.\n", packet[PKT_CMD], length);
|
||||
|
||||
switch (packet[PKT_CMD])
|
||||
{
|
||||
case CMD_ACK:
|
||||
//LOG(AQRS_LOG,LOG_DEBUG_SERIAL, "RS Received ACK length %d.\n", length);
|
||||
//LOG(ALLB_LOG,LOG_DEBUG_SERIAL, "RS Received ACK length %d.\n", length);
|
||||
break;
|
||||
case CMD_STATUS:
|
||||
//LOG(AQRS_LOG,LOG_DEBUG_SERIAL, "RS Received STATUS length %d.\n", length);
|
||||
//LOG(ALLB_LOG,LOG_DEBUG_SERIAL, "RS Received STATUS length %d.\n", length);
|
||||
memcpy(_aqualink_data.raw_status, packet + 4, AQ_PSTLEN);
|
||||
processLEDstate();
|
||||
if (_aqualink_data.aqbuttons[PUMP_INDEX].led->state == OFF)
|
||||
|
@ -887,14 +891,14 @@ bool process_packet(unsigned char *packet, int length)
|
|||
//strncpy(message, (char *)packet + PKT_DATA + 1, AQ_MSGLEN);
|
||||
rsm_strncpy(message, packet + PKT_DATA + 1, AQ_MSGLONGLEN, AQ_MSGLEN);
|
||||
processing_long_msg = index;
|
||||
//LOG(AQRS_LOG,LOG_ERR, "Message %s\n",message);
|
||||
//LOG(ALLB_LOG,LOG_ERR, "Message %s\n",message);
|
||||
} else {
|
||||
//strncpy(&message[(processing_long_msg * AQ_MSGLEN)], (char *)packet + PKT_DATA + 1, AQ_MSGLEN);
|
||||
//rsm_strncpy(&message[(processing_long_msg * AQ_MSGLEN)], (unsigned char *)packet + PKT_DATA + 1, AQ_MSGLONGLEN, AQ_MSGLEN);
|
||||
rsm_strncpy(&message[( (index-1) * AQ_MSGLEN)], (unsigned char *)packet + PKT_DATA + 1, AQ_MSGLONGLEN, AQ_MSGLEN);
|
||||
//LOG(AQRS_LOG,LOG_ERR, "Long Message %s\n",message);
|
||||
//LOG(ALLB_LOG,LOG_ERR, "Long Message %s\n",message);
|
||||
if (++processing_long_msg != index) {
|
||||
LOG(AQRS_LOG,LOG_DEBUG, "Long message index %d doesn't match buffer %d\n",index,processing_long_msg);
|
||||
LOG(ALLB_LOG,LOG_DEBUG, "Long message index %d doesn't match buffer %d\n",index,processing_long_msg);
|
||||
//printf("RSM Long message index %d doesn't match buffer %d\n",index,processing_long_msg);
|
||||
}
|
||||
#ifdef PROCESS_INCOMPLETE_MESSAGES
|
||||
|
@ -908,24 +912,24 @@ bool process_packet(unsigned char *packet, int length)
|
|||
// MOVED FROM LINE 701 see if less errors
|
||||
//kick_aq_program_thread(&_aqualink_data, ALLBUTTON);
|
||||
|
||||
LOG(AQRS_LOG,LOG_DEBUG, "Processing Message - '%s'\n",message);
|
||||
LOG(ALLB_LOG,LOG_DEBUG, "Processing Message - '%s'\n",message);
|
||||
processMessage(message); // This will kick thread
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case CMD_PROBE:
|
||||
LOG(AQRS_LOG,LOG_DEBUG, "RS Received PROBE length %d.\n", length);
|
||||
LOG(ALLB_LOG,LOG_DEBUG, "RS Received PROBE length %d.\n", length);
|
||||
//LOG(AQUA_LOG,LOG_INFO, "Synch'ing with Aqualink master device...\n");
|
||||
rtn = false;
|
||||
break;
|
||||
case CMD_MSG_LOOP_ST:
|
||||
LOG(AQRS_LOG,LOG_INFO, "RS Received message loop start\n");
|
||||
LOG(ALLB_LOG,LOG_INFO, "RS Received message loop start\n");
|
||||
processMessageReset();
|
||||
rtn = false;
|
||||
break;
|
||||
default:
|
||||
LOG(AQRS_LOG,LOG_INFO, "RS Received unknown packet, 0x%02hhx\n", packet[PKT_CMD]);
|
||||
LOG(ALLB_LOG,LOG_INFO, "RS Received unknown packet, 0x%02hhx\n", packet[PKT_CMD]);
|
||||
rtn = false;
|
||||
break;
|
||||
}
|
||||
|
@ -1091,7 +1095,7 @@ int main(int argc, char *argv[])
|
|||
// Any debug logging masks
|
||||
//addDebugLogMask(IAQT_LOG);
|
||||
//addDebugLogMask(ONET_LOG);
|
||||
//addDebugLogMask(AQRS_LOG);
|
||||
//addDebugLogMask(ALLB_LOG);
|
||||
//addDebugLogMask(PDA_LOG);
|
||||
//addDebugLogMask(NET_LOG);
|
||||
//addDebugLogMask(AQUA_LOG);
|
||||
|
@ -1559,6 +1563,10 @@ void main_loop()
|
|||
_aqualink_data.pumps[i].rpm = TEMP_UNKNOWN;
|
||||
_aqualink_data.pumps[i].gpm = TEMP_UNKNOWN;
|
||||
_aqualink_data.pumps[i].watts = TEMP_UNKNOWN;
|
||||
_aqualink_data.pumps[i].mode = TEMP_UNKNOWN;
|
||||
//_aqualink_data.pumps[i].driveState = TEMP_UNKNOWN;
|
||||
_aqualink_data.pumps[i].status = TEMP_UNKNOWN;
|
||||
_aqualink_data.pumps[i].pressureCurve = TEMP_UNKNOWN;
|
||||
}
|
||||
|
||||
if (_aqconfig_.force_swg == true) {
|
||||
|
@ -1900,7 +1908,7 @@ void main_loop()
|
|||
{
|
||||
if (getLogLevel(AQUA_LOG) >= LOG_DEBUG) {
|
||||
LOG(AQUA_LOG,LOG_DEBUG, "RS received packet of type %s length %d\n", get_packet_type(packet_buffer, packet_length), packet_length);
|
||||
logPacketRead(packet_buffer, packet_length);
|
||||
//logPacketRead(packet_buffer, packet_length);
|
||||
}
|
||||
_aqualink_data.updated = process_packet(packet_buffer, packet_length);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ bool processJandyPacket(unsigned char *packet_buffer, int packet_length, struct
|
|||
{
|
||||
if (interestedInNextAck == DRS_SWG)
|
||||
{
|
||||
rtn = processPacketFromSWG(packet_buffer, packet_length, aqdata);
|
||||
rtn = processPacketFromSWG(packet_buffer, packet_length, aqdata, previous_packet_to);
|
||||
}
|
||||
else if (interestedInNextAck == DRS_EPUMP)
|
||||
{
|
||||
|
@ -71,11 +71,11 @@ bool processJandyPacket(unsigned char *packet_buffer, int packet_length, struct
|
|||
{
|
||||
if (interestedInNextAck == DRS_SWG && aqdata->ar_swg_device_status != SWG_STATUS_OFF)
|
||||
{ // SWG Offline
|
||||
processMissingAckPacketFromSWG(previous_packet_to, aqdata);
|
||||
processMissingAckPacketFromSWG(previous_packet_to, aqdata, previous_packet_to);
|
||||
}
|
||||
else if (interestedInNextAck == DRS_EPUMP)
|
||||
{ // ePump offline
|
||||
processMissingAckPacketFromJandyPump(previous_packet_to, aqdata);
|
||||
processMissingAckPacketFromJandyPump(previous_packet_to, aqdata, previous_packet_to);
|
||||
}
|
||||
interestedInNextAck = DRS_NONE;
|
||||
previous_packet_to = NUL;
|
||||
|
@ -177,10 +177,20 @@ bool processPacketToSWG(unsigned char *packet, int packet_length, struct aqualin
|
|||
return changedAnything;
|
||||
}
|
||||
|
||||
bool processPacketFromSWG(unsigned char *packet, int packet_length, struct aqualinkdata *aqdata) {
|
||||
unsigned char _SWG_ID = NUL;
|
||||
|
||||
bool processPacketFromSWG(unsigned char *packet, int packet_length, struct aqualinkdata *aqdata, const unsigned char previous_packet_to) {
|
||||
bool changedAnything = false;
|
||||
_swg_noreply_cnt = 0;
|
||||
|
||||
// Capture the SWG ID. We could have more than one, but for the moment AqualinkD only supports one so we'll pick the first one.
|
||||
if (_SWG_ID == NUL) {
|
||||
_SWG_ID = previous_packet_to;
|
||||
} else if (_SWG_ID != NUL && _SWG_ID != previous_packet_to) {
|
||||
LOG(DJAN_LOG, LOG_WARNING, "We have two SWG, AqualinkD only supports one. using ID 0x%02hhx, ignoring 0x%02hhx\n", _SWG_ID, previous_packet_to);
|
||||
return changedAnything;
|
||||
}
|
||||
|
||||
// Only log if we are jandy debug move and not serial (otherwise it'll print twice)
|
||||
if (getLogLevel(DJAN_LOG) == LOG_DEBUG && getLogLevel(RSSD_LOG) < LOG_DEBUG ) {
|
||||
char buff[1024];
|
||||
|
@ -211,11 +221,16 @@ bool processPacketFromSWG(unsigned char *packet, int packet_length, struct aqual
|
|||
return changedAnything;
|
||||
}
|
||||
|
||||
void processMissingAckPacketFromSWG(unsigned char destination, struct aqualinkdata *aqdata)
|
||||
void processMissingAckPacketFromSWG(unsigned char destination, struct aqualinkdata *aqdata, const unsigned char previous_packet_to)
|
||||
{
|
||||
// SWG_STATUS_UNKNOWN means we have never seen anything from SWG, so leave as is.
|
||||
// IAQTOUCH & ONETOUCH give us AQUAPURE=0 but ALLBUTTON doesn't, so only turn off if we are not in extra device mode.
|
||||
// NSF Need to check that we actually use 0 from IAQTOUCH & ONETOUCH
|
||||
if (_SWG_ID != previous_packet_to) {
|
||||
//LOG(DJAN_LOG, LOG_DEBUG, "Ignoring SWG no reply from 0x%02hhx\n", previous_packet_to);
|
||||
return;
|
||||
}
|
||||
|
||||
if ( aqdata->ar_swg_device_status != SWG_STATUS_UNKNOWN && isIAQT_ENABLED == false && isONET_ENABLED == false )
|
||||
{
|
||||
if ( _swg_noreply_cnt < 3 ) {
|
||||
|
@ -250,9 +265,9 @@ void setSWGdeviceStatus(struct aqualinkdata *aqdata, emulation_type requester, u
|
|||
}
|
||||
*/
|
||||
// If we are reading state directly from RS458, then ignore everything else.
|
||||
if ( READ_RSDEV_SWG && requester != JANDY_DEVICE ) {
|
||||
return;
|
||||
}
|
||||
//if ( READ_RSDEV_SWG && requester != JANDY_DEVICE ) {
|
||||
// return;
|
||||
//}
|
||||
|
||||
if ((aqdata->ar_swg_device_status == status) || (last_status == status)) {
|
||||
//LOG(DJAN_LOG, LOG_DEBUG, "Set SWG device state to '0x%02hhx', request from %d\n", aqdata->ar_swg_device_status, requester);
|
||||
|
@ -614,7 +629,7 @@ bool processPacketFromJandyPump(unsigned char *packet_buffer, int packet_length,
|
|||
return false;
|
||||
}
|
||||
|
||||
void processMissingAckPacketFromJandyPump(unsigned char destination, struct aqualinkdata *aqdata)
|
||||
void processMissingAckPacketFromJandyPump(unsigned char destination, struct aqualinkdata *aqdata, const unsigned char previous_packet_to)
|
||||
{
|
||||
// Do nothing for the moment.
|
||||
return;
|
||||
|
|
|
@ -8,11 +8,11 @@
|
|||
bool processJandyPacket(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata);
|
||||
|
||||
bool processPacketToSWG(unsigned char *packet, int packet_length, struct aqualinkdata *aqdata, int swg_zero_ignore);
|
||||
bool processPacketFromSWG(unsigned char *packet, int packet_length, struct aqualinkdata *aqdata);
|
||||
bool processPacketFromSWG(unsigned char *packet, int packet_length, struct aqualinkdata *aqdata, const unsigned char previous_packet_to);
|
||||
bool processPacketToJandyPump(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata);
|
||||
bool processPacketFromJandyPump(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata, const unsigned char previous_packet_to);
|
||||
void processMissingAckPacketFromSWG(unsigned char destination, struct aqualinkdata *aqdata);
|
||||
void processMissingAckPacketFromJandyPump(unsigned char destination, struct aqualinkdata *aqdata);
|
||||
void processMissingAckPacketFromSWG(unsigned char destination, struct aqualinkdata *aqdata, const unsigned char previous_packet_to);
|
||||
void processMissingAckPacketFromJandyPump(unsigned char destination, struct aqualinkdata *aqdata, const unsigned char previous_packet_to);
|
||||
|
||||
bool processPacketFromJandyJXiHeater(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata, const unsigned char previous_packet_to );
|
||||
bool processPacketToJandyJXiHeater(unsigned char *packet_buffer, int packet_length, struct aqualinkdata *aqdata);
|
||||
|
|
|
@ -44,6 +44,7 @@ bool processPentairPacket(unsigned char *packet, int packet_length, struct aqual
|
|||
|
||||
//static int pumpIndex = 1;
|
||||
|
||||
// Status from pump
|
||||
if ( packet[PEN_PKT_CMD] == PEN_CMD_STATUS && packet[PEN_PKT_FROM] >= PENTAIR_DEC_PUMP_MIN && packet[PEN_PKT_FROM] <= PENTAIR_DEC_PUMP_MAX ){
|
||||
// We have Pentair Pump packet, let's see if it's configured.
|
||||
//printf("PUMP\n");
|
||||
|
@ -51,28 +52,92 @@ bool processPentairPacket(unsigned char *packet, int packet_length, struct aqual
|
|||
for (i = 0; i < MAX_PUMPS; i++) {
|
||||
if ( aqdata->pumps[i].prclType == PENTAIR && aqdata->pumps[i].pumpID == packet[PEN_PKT_FROM] ) {
|
||||
// We found the pump.
|
||||
LOG(DPEN_LOG, LOG_INFO, "Pentair Pump Status message = RPM %d | WATTS %d\n",
|
||||
LOG(DPEN_LOG, LOG_INFO, "Pentair Pump 0x%02hhx Status message = RPM %d | WATTS %d | GPM %d | Mode %d | DriveState %d | Status %d | PresureCurve %d\n",
|
||||
packet[PEN_PKT_FROM],
|
||||
(packet[PEN_HI_B_RPM] * 256) + packet[PEN_LO_B_RPM],
|
||||
(packet[PEN_HI_B_WAT] * 256) + packet[PEN_LO_B_WAT]);
|
||||
(packet[PEN_HI_B_WAT] * 256) + packet[PEN_LO_B_WAT],
|
||||
packet[PEN_FLOW],
|
||||
packet[PEN_MODE],
|
||||
packet[PEN_DRIVE_STATE],
|
||||
(packet[PEN_HI_B_STATUS] * 256) + packet[PEN_LO_B_STATUS],
|
||||
packet[PEN_PPC]);
|
||||
|
||||
aqdata->pumps[i].rpm = (packet[PEN_HI_B_RPM] * 256) + packet[PEN_LO_B_RPM];
|
||||
aqdata->pumps[i].watts = (packet[PEN_HI_B_WAT] * 256) + packet[PEN_LO_B_WAT];
|
||||
aqdata->pumps[i].gpm = packet[PEN_FLOW];
|
||||
aqdata->pumps[i].mode = packet[PEN_MODE];
|
||||
//aqdata->pumps[i].driveState = packet[PEN_DRIVE_STATE];
|
||||
aqdata->pumps[i].status = (packet[PEN_HI_B_STATUS] * 256) + packet[PEN_LO_B_STATUS];
|
||||
aqdata->pumps[i].pressureCurve = packet[PEN_PPC];
|
||||
|
||||
changedAnything = true;
|
||||
break;
|
||||
}
|
||||
if (changedAnything != true)
|
||||
LOG(DPEN_LOG, LOG_NOTICE, "Pentair Pump found at ID 0x%02hhx with RPM %d | WATTS %d, but not configured, information ignored!\n",
|
||||
if (changedAnything != true) {
|
||||
LOG(DPEN_LOG, LOG_NOTICE, "Pentair Pump found at ID 0x%02hhx values RPM %d | WATTS %d | PGM %d | Mode %d | DriveState %d | Status %d | PresureCurve %d\n",
|
||||
packet[PEN_PKT_FROM],
|
||||
(packet[PEN_HI_B_RPM] * 256) + packet[PEN_LO_B_RPM],
|
||||
(packet[PEN_HI_B_WAT] * 256) + packet[PEN_LO_B_WAT]);
|
||||
(packet[PEN_HI_B_WAT] * 256) + packet[PEN_LO_B_WAT],
|
||||
packet[PEN_FLOW],
|
||||
packet[PEN_MODE],
|
||||
packet[PEN_DRIVE_STATE],
|
||||
(packet[PEN_HI_B_STATUS] * 256) + packet[PEN_LO_B_STATUS],
|
||||
packet[PEN_PPC]);
|
||||
}
|
||||
}
|
||||
//
|
||||
}
|
||||
// Set RPM/GPM to pump
|
||||
else if (packet[PEN_PKT_CMD] == PEN_CMD_SPEED && packet[PEN_PKT_DEST] >= PENTAIR_DEC_PUMP_MIN && packet[PEN_PKT_DEST] <= PENTAIR_DEC_PUMP_MAX) {
|
||||
|
||||
//(msg.extractPayloadByte(2) & 32) >> 5 === 0 ? 'RPM' : 'GPM';
|
||||
|
||||
bool isRPM = (packet[11] & 32) >> 5 == 0?true:false;
|
||||
|
||||
if (isRPM) {
|
||||
LOG(DPEN_LOG, LOG_INFO,"Pentair Pump 0x%02hhx request to set RPM to %d\n",packet[PEN_PKT_DEST], (packet[11] * 256) + packet[12]);
|
||||
} else {
|
||||
LOG(DPEN_LOG, LOG_INFO,"Pentair Pump 0x%02hhx request to set GPM to %d\n",packet[PEN_PKT_DEST],packet[11]);
|
||||
}
|
||||
}
|
||||
// Set power to pump
|
||||
else if (packet[PEN_PKT_CMD] == PEN_CMD_POWER && packet[PEN_PKT_DEST] >= PENTAIR_DEC_PUMP_MIN && packet[PEN_PKT_DEST] <= PENTAIR_DEC_PUMP_MAX) {
|
||||
if (packet[9] == 0x0A) {
|
||||
LOG(DPEN_LOG, LOG_INFO,"Pentair Pump 0x%02hhx request set power ON\n");
|
||||
} else {
|
||||
LOG(DPEN_LOG, LOG_INFO,"Pentair Pump 0x%02hhx request set power OFF\n");
|
||||
}
|
||||
}
|
||||
|
||||
return changedAnything;
|
||||
}
|
||||
/*
|
||||
VSP Pump Status.
|
||||
|
||||
(packet[PEN_HI_B_STATUS] * 256) + packet[PEN_LO_B_STATUS];
|
||||
|
||||
// Below was pulled from another project. 0 doesn;t seem to be accurate.
|
||||
[0, { name: 'off', desc: 'Off' }], // When the pump is disconnected or has no power then we simply report off as the status. This is not the recommended wiring
|
||||
// for a VS/VF pump as is should be powered at all times. When it is, the status will always report a value > 0.
|
||||
[1, { name: 'ok', desc: 'Ok' }], // Status is always reported when the pump is not wired to a relay regardless of whether it is on or not
|
||||
// as is should be if this is a VS / VF pump. However if it is wired to a relay most often filter, the pump will report status
|
||||
// 0 if it is not running. Essentially this is no error but it is not a status either.
|
||||
[2, { name: 'filter', desc: 'Filter warning' }],
|
||||
[3, { name: 'overcurrent', desc: 'Overcurrent condition' }],
|
||||
[4, { name: 'priming', desc: 'Priming' }],
|
||||
[5, { name: 'blocked', desc: 'System blocked' }],
|
||||
[6, { name: 'general', desc: 'General alarm' }],
|
||||
[7, { name: 'overtemp', desc: 'Overtemp condition' }],
|
||||
[8, { name: 'power', dec: 'Power outage' }],
|
||||
[9, { name: 'overcurrent2', desc: 'Overcurrent condition 2' }],
|
||||
[10, { name: 'overvoltage', desc: 'Overvoltage condition' }],
|
||||
[11, { name: 'error11', desc: 'Unspecified Error 11' }],
|
||||
[12, { name: 'error12', desc: 'Unspecified Error 12' }],
|
||||
[13, { name: 'error13', desc: 'Unspecified Error 13' }],
|
||||
[14, { name: 'error14', desc: 'Unspecified Error 14' }],
|
||||
[15, { name: 'error15', desc: 'Unspecified Error 15' }],
|
||||
[16, { name: 'commfailure', desc: 'Communication failure' }]
|
||||
*/
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -5,11 +5,15 @@
|
|||
|
||||
IMAGE=aqualinkd
|
||||
|
||||
DOCKER_HUB_NAME="docker.io/sfeakes"
|
||||
LATEST_TAG=""
|
||||
|
||||
if [ $# -eq 0 ]
|
||||
then
|
||||
# Below is safer, but not supported on all platforms.
|
||||
#VERSION=$(curl --silent "https://api.github.com/repos/sfeakes/AqualinkD/releases/latest" | grep -Po '"tag_name": "[^0-9|v|V]*\K.*?(?=")')
|
||||
VERSION=$(curl --silent "https://api.github.com/repos/sfeakes/AqualinkD/releases/latest" | grep "tag_name" | awk -F'"' '$0=$4')
|
||||
LATEST_TAG="-t ${DOCKER_HUB_NAME}/${IMAGE}:latest"
|
||||
else
|
||||
VERSION=$1
|
||||
fi
|
||||
|
@ -37,10 +41,23 @@ if ! curl --output /dev/null --silent --location --head --fail "$URL"; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Check we are building a version not already on docker hub
|
||||
|
||||
DOCKER_TAGS=$(wget -q -O - "https://hub.docker.com/v2/namespaces/sfeakes/repositories/aqualinkd/tags" | grep -o '"name": *"[^"]*' | grep -o '[^"]*$')
|
||||
|
||||
if echo $DOCKER_TAGS | grep -q $VERSION; then
|
||||
echo "AqualinkD version $VERSION already exists on docker.io, are you sure you want to overide"
|
||||
read -p "Are you sure? " -n 1 -r
|
||||
echo ""
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Building Docker container for $IMAGE using branch $VERSION"
|
||||
docker buildx build --platform=linux/amd64,linux/arm64 \
|
||||
--file Dockerfile.buildx \
|
||||
-t docker.io/sfeakes/${IMAGE}:${VERSION} \
|
||||
-t docker.io/sfeakes/${IMAGE}:latest \
|
||||
-t ${DOCKER_HUB_NAME}/${IMAGE}:${VERSION} \
|
||||
$LATEST_TAG \
|
||||
--build-arg AQUALINKD_VERSION=${VERSION} \
|
||||
--push .
|
23
hassio.c
23
hassio.c
|
@ -267,10 +267,12 @@ void publish_mqtt_hassio_discover(struct aqualinkdata *aqdata, struct mg_connect
|
|||
LOG(NET_LOG,LOG_INFO, "MQTT: Publishing discover messages to '%s'\n", _aqconfig_.mqtt_hass_discover_topic);
|
||||
|
||||
for (i=0; i < aqdata->total_buttons; i++)
|
||||
{ // Heaters
|
||||
if ( (strcmp(BTN_POOL_HTR,aqdata->aqbuttons[i].name) == 0 && (_aqconfig_.force_ps_setpoints || aqdata->pool_htr_set_point != TEMP_UNKNOWN)) ||
|
||||
(strcmp(BTN_SPA_HTR,aqdata->aqbuttons[i].name)==0 && (_aqconfig_.force_ps_setpoints || aqdata->spa_htr_set_point != TEMP_UNKNOWN)) ) {
|
||||
sprintf(msg,HASSIO_CLIMATE_DISCOVER,
|
||||
{
|
||||
if (strcmp("NONE",aqdata->aqbuttons[i].label) != 0 ) {
|
||||
// Heaters
|
||||
if ( (strcmp(BTN_POOL_HTR,aqdata->aqbuttons[i].name) == 0 && (_aqconfig_.force_ps_setpoints || aqdata->pool_htr_set_point != TEMP_UNKNOWN)) ||
|
||||
(strcmp(BTN_SPA_HTR,aqdata->aqbuttons[i].name)==0 && (_aqconfig_.force_ps_setpoints || aqdata->spa_htr_set_point != TEMP_UNKNOWN)) ) {
|
||||
sprintf(msg,HASSIO_CLIMATE_DISCOVER,
|
||||
_aqconfig_.mqtt_aq_topic,
|
||||
aqdata->aqbuttons[i].name,
|
||||
aqdata->aqbuttons[i].label,
|
||||
|
@ -280,12 +282,12 @@ void publish_mqtt_hassio_discover(struct aqualinkdata *aqdata, struct mg_connect
|
|||
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name,
|
||||
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name,
|
||||
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name);
|
||||
sprintf(topic, "%s/climate/aqualinkd/aqualinkd_%s/config", _aqconfig_.mqtt_hass_discover_topic, aqdata->aqbuttons[i].name);
|
||||
send_mqtt(nc, topic, msg);
|
||||
} else if (strcmp("NONE",aqdata->aqbuttons[i].label) != 0 ) {
|
||||
sprintf(topic, "%s/climate/aqualinkd/aqualinkd_%s/config", _aqconfig_.mqtt_hass_discover_topic, aqdata->aqbuttons[i].name);
|
||||
send_mqtt(nc, topic, msg);
|
||||
} else {
|
||||
// Switches
|
||||
//sprintf(msg,"{\"type\": \"switch\",\"unique_id\": \"%s\",\"name\": \"%s\",\"state_topic\": \"aqualinkd/%s\",\"command_topic\": \"aqualinkd/%s/set\",\"json_attributes_topic\": \"aqualinkd/%s/delay\",\"json_attributes_topic\": \"aqualinkd/%s/delay\",\"json_attributes_template\": \"{{ {'delay': value|int} | tojson }}\",\"payload_on\": \"1\",\"payload_off\": \"0\",\"qos\": 1,\"retain\": false}" ,
|
||||
sprintf(msg, HASSIO_SWITCH_DISCOVER,
|
||||
sprintf(msg, HASSIO_SWITCH_DISCOVER,
|
||||
_aqconfig_.mqtt_aq_topic,
|
||||
aqdata->aqbuttons[i].name,
|
||||
aqdata->aqbuttons[i].label,
|
||||
|
@ -293,8 +295,9 @@ void publish_mqtt_hassio_discover(struct aqualinkdata *aqdata, struct mg_connect
|
|||
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name,
|
||||
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name,
|
||||
_aqconfig_.mqtt_aq_topic,aqdata->aqbuttons[i].name);
|
||||
sprintf(topic, "%s/switch/aqualinkd/aqualinkd_%s/config", _aqconfig_.mqtt_hass_discover_topic, aqdata->aqbuttons[i].name);
|
||||
send_mqtt(nc, topic, msg);
|
||||
sprintf(topic, "%s/switch/aqualinkd/aqualinkd_%s/config", _aqconfig_.mqtt_hass_discover_topic, aqdata->aqbuttons[i].name);
|
||||
send_mqtt(nc, topic, msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -881,7 +881,7 @@ void *get_aqualink_iaqtouch_setpoints( void *ptr )
|
|||
if (isSINGLE_DEV_PANEL != true)
|
||||
{
|
||||
changePanelToMode_Only();
|
||||
LOG(AQRS_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
LOG(IAQT_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -898,7 +898,7 @@ void *get_aqualink_iaqtouch_setpoints( void *ptr )
|
|||
if (isSINGLE_DEV_PANEL != true)
|
||||
{
|
||||
changePanelToMode_Only();
|
||||
LOG(AQRS_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
LOG(IAQT_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -938,12 +938,23 @@ void *get_aqualink_iaqtouch_setpoints( void *ptr )
|
|||
button = iaqtFindButtonByLabel("Degrees");
|
||||
|
||||
if (button != NULL) {
|
||||
LOG(IAQT_LOG,LOG_NOTICE, "Temperature units are '%s'\n",button->name);
|
||||
if (*button->name[8] == 'C') {
|
||||
if (rsm_strmatch(*button->name, "Degrees F") == 0) {
|
||||
LOG(IAQT_LOG,LOG_NOTICE, "Temperature unit message is '%s' set to degC\n",button->name);
|
||||
aq_data->temp_units = CELSIUS;
|
||||
} else {
|
||||
LOG(IAQT_LOG,LOG_NOTICE, "Temperature unit message is '%s' set to degF\n",button->name);
|
||||
aq_data->temp_units = FAHRENHEIT;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
printf("************** DEG IS '%c'\n", (uintptr_t)button->name[8]);
|
||||
if ( (uintptr_t)button->name[8] == 'C') { // NSF THIS DOES NOT WORK, LEAVE COMPILER WARNING TO COME BACK AND FIX
|
||||
aq_data->temp_units = CELSIUS;
|
||||
} else {
|
||||
aq_data->temp_units = FAHRENHEIT;
|
||||
}
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -513,7 +513,7 @@ int build_aqualink_aqmanager_JSON(struct aqualinkdata *aqdata, char* buffer, int
|
|||
length += sprintf(buffer+length, ",\"debugmasks\":[");
|
||||
length += logmaskjsonobject(AQUA_LOG, buffer+length);
|
||||
length += logmaskjsonobject(NET_LOG, buffer+length);
|
||||
length += logmaskjsonobject(AQRS_LOG, buffer+length);
|
||||
length += logmaskjsonobject(ALLB_LOG, buffer+length);
|
||||
length += logmaskjsonobject(ONET_LOG, buffer+length);
|
||||
length += logmaskjsonobject(IAQT_LOG, buffer+length);
|
||||
length += logmaskjsonobject(PDA_LOG, buffer+length);
|
||||
|
@ -522,9 +522,10 @@ int build_aqualink_aqmanager_JSON(struct aqualinkdata *aqdata, char* buffer, int
|
|||
length += logmaskjsonobject(DPEN_LOG, buffer+length);
|
||||
length += logmaskjsonobject(RSSD_LOG, buffer+length);
|
||||
length += logmaskjsonobject(PROG_LOG, buffer+length);
|
||||
length += logmaskjsonobject(DBGT_LOG, buffer+length);
|
||||
length += logmaskjsonobject(TIMR_LOG, buffer+length);
|
||||
length += logmaskjsonobject(SCHD_LOG, buffer+length);
|
||||
length += logmaskjsonobject(RSTM_LOG, buffer+length);
|
||||
length += logmaskjsonobject(SIM_LOG, buffer+length);
|
||||
// DBGT_LOG is a compile time only, so don;t include
|
||||
if (buffer[length-1] == ',')
|
||||
length--;
|
||||
length += sprintf(buffer+length, "]");
|
||||
|
|
|
@ -920,6 +920,18 @@ void mqtt_broadcast_aqualinkstate(struct mg_connection *nc)
|
|||
//send_mqtt_aux_msg(nc, PUMP_TOPIC, i+1, PUMP_WATTS_TOPIC, _aqualink_data->pumps[i].watts);
|
||||
send_mqtt_aux_msg(nc, _aqualink_data->pumps[i].button->name, PUMP_WATTS_TOPIC, _aqualink_data->pumps[i].watts);
|
||||
}
|
||||
if (_aqualink_data->pumps[i].mode != TEMP_UNKNOWN && _aqualink_data->pumps[i].mode != _last_mqtt_aqualinkdata.pumps[i].mode) {
|
||||
_last_mqtt_aqualinkdata.pumps[i].mode = _aqualink_data->pumps[i].mode;
|
||||
send_mqtt_aux_msg(nc, _aqualink_data->pumps[i].button->name, PUMP_MODE_TOPIC, _aqualink_data->pumps[i].mode);
|
||||
}
|
||||
if (_aqualink_data->pumps[i].status != TEMP_UNKNOWN && _aqualink_data->pumps[i].status != _last_mqtt_aqualinkdata.pumps[i].status) {
|
||||
_last_mqtt_aqualinkdata.pumps[i].status = _aqualink_data->pumps[i].status;
|
||||
send_mqtt_aux_msg(nc, _aqualink_data->pumps[i].button->name, PUMP_STATUS_TOPIC, _aqualink_data->pumps[i].status);
|
||||
}
|
||||
if (_aqualink_data->pumps[i].pressureCurve != TEMP_UNKNOWN && _aqualink_data->pumps[i].pressureCurve != _last_mqtt_aqualinkdata.pumps[i].pressureCurve) {
|
||||
_last_mqtt_aqualinkdata.pumps[i].pressureCurve = _aqualink_data->pumps[i].pressureCurve;
|
||||
send_mqtt_aux_msg(nc, _aqualink_data->pumps[i].button->name, PUMP_PPC_TOPIC, _aqualink_data->pumps[i].pressureCurve);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1923,9 +1935,13 @@ void reset_last_mqtt_status()
|
|||
_last_mqtt_aqualinkdata.heater_err_status = NUL; // 0x00
|
||||
|
||||
for (i=0; i < _aqualink_data->num_pumps; i++) {
|
||||
_last_mqtt_aqualinkdata.pumps[i].gpm = -1;
|
||||
_last_mqtt_aqualinkdata.pumps[i].rpm = -1;
|
||||
_last_mqtt_aqualinkdata.pumps[i].watts = -1;
|
||||
_last_mqtt_aqualinkdata.pumps[i].gpm = TEMP_UNKNOWN;
|
||||
_last_mqtt_aqualinkdata.pumps[i].rpm = TEMP_UNKNOWN;
|
||||
_last_mqtt_aqualinkdata.pumps[i].watts = TEMP_UNKNOWN;
|
||||
_last_mqtt_aqualinkdata.pumps[i].mode = TEMP_UNKNOWN;
|
||||
_last_mqtt_aqualinkdata.pumps[i].status = TEMP_UNKNOWN;
|
||||
_last_mqtt_aqualinkdata.pumps[i].pressureCurve = TEMP_UNKNOWN;
|
||||
//_last_mqtt_aqualinkdata.pumps[i].driveState = TEMP_UNKNOWN;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -257,7 +257,7 @@ bool log_heater_setpoints(struct aqualinkdata *aq_data)
|
|||
if (isSINGLE_DEV_PANEL != true)
|
||||
{
|
||||
changePanelToMode_Only();
|
||||
LOG(AQRS_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
LOG(ONET_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
}
|
||||
}
|
||||
if (rsm_strcmp(_menu[3], "Temp2") == 0 )
|
||||
|
|
|
@ -110,8 +110,9 @@ void _logPacket(int16_t from, unsigned char *packet_buffer, int packet_length, b
|
|||
if ( is_read && _aqconfig_.RSSD_LOG_filter != packet_buffer[PKT_DEST]) {
|
||||
return;
|
||||
}
|
||||
} else if (!is_read && _lastReadFrom != _aqconfig_.RSSD_LOG_filter) // Must be write
|
||||
} else if (!is_read && _lastReadFrom != _aqconfig_.RSSD_LOG_filter) { // Must be write
|
||||
return;
|
||||
}
|
||||
/*
|
||||
if ( is_read && _aqconfig_.RSSD_LOG_filter != packet_buffer[PKT_DEST]) {
|
||||
return;
|
||||
|
@ -146,14 +147,22 @@ int _beautifyPacket(char *buff, unsigned char *packet_buffer, int packet_length,
|
|||
{
|
||||
int i = 0;
|
||||
int cnt = 0;
|
||||
protocolType ptype = getProtocolType(packet_buffer);
|
||||
|
||||
cnt = sprintf(buff, "%s %s packet %sTo 0x%02hhx of type %16.16s | HEX: ",
|
||||
(is_read?"Read ":"Write"),
|
||||
(ptype==PENTAIR?"Pentair":"Jandy "),
|
||||
(error?"BAD PACKET ":""),
|
||||
packet_buffer[(ptype==JANDY?PKT_DEST:PEN_PKT_DEST)],
|
||||
get_packet_type(packet_buffer, packet_length));
|
||||
/*
|
||||
if (getProtocolType(packet_buffer)==PENTAIR) {
|
||||
// Listing Jandy below if redundant. need to clean this up.
|
||||
cnt = sprintf(buff, "%5.5s %s%8.8s Packet | HEX: ",(is_read?"Read":"Write"),(error?"BAD PACKET ":""),getProtocolType(packet_buffer)==PENTAIR?"Pentair":"Jandy");
|
||||
} else {
|
||||
cnt = sprintf(buff, "%5.5s %sTo 0x%02hhx of type %16.16s | HEX: ",(is_read?"Read":"Write"),(error?"BAD PACKET ":""), packet_buffer[PKT_DEST], get_packet_type(packet_buffer, packet_length));
|
||||
}
|
||||
|
||||
*/
|
||||
for (i = 0; i < packet_length; i++)
|
||||
cnt += sprintf(buff + cnt, "0x%02hhx|", packet_buffer[i]);
|
||||
|
||||
|
|
4
pda.c
4
pda.c
|
@ -252,7 +252,7 @@ void process_pda_packet_msg_long_time(const char *msg)
|
|||
|
||||
if (checkAqualinkTime() != true)
|
||||
{
|
||||
LOG(AQRS_LOG,LOG_NOTICE, "RS time is NOT accurate '%s %s', re-setting on controller!\n", _aqualink_data->time, _aqualink_data->date);
|
||||
LOG(PDA_LOG,LOG_NOTICE, "RS time is NOT accurate '%s %s', re-setting on controller!\n", _aqualink_data->time, _aqualink_data->date);
|
||||
aq_programmer(AQ_SET_TIME, NULL, _aqualink_data);
|
||||
}
|
||||
}
|
||||
|
@ -336,7 +336,7 @@ void setSingleDeviceMode()
|
|||
if (isSINGLE_DEV_PANEL != true)
|
||||
{
|
||||
changePanelToMode_Only();
|
||||
LOG(AQRS_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
LOG(PDA_LOG,LOG_ERR, "AqualinkD set to 'Combo Pool & Spa' but detected 'Only Pool OR Spa' panel, please change config\n");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -138,7 +138,12 @@ report_zero_pool_temp = no
|
|||
# Log any packets from this device.
|
||||
#serial_debug_filter = 0x00
|
||||
|
||||
# Not documented. These are experimental. Will change how RS485 / Serial works, Only use if asked to for problem solving purposes.
|
||||
# Will change how RS485 / Serial works, Only use if asked to for problem solving purposes.
|
||||
# Delay between RS485 frame (set or packets that make up a command), reply too quickly can
|
||||
# cause slow panels (like PDA only) issues, reply too slowly and the control panel will think we are
|
||||
# dead.
|
||||
# ~40 and we will be replying too slowley, so keep below that.
|
||||
# 10~20 is about what most device reply in. But 0-4 works well.
|
||||
rs485_frame_delay = 4
|
||||
|
||||
# Get rid of the startup warning message about no low latency. BETTER option is to buy a better adapter.
|
||||
|
@ -212,10 +217,11 @@ use_panel_aux_labels=no
|
|||
# Simply change these to your setup, valid options for wach button are :-
|
||||
# None of these are mandatory unless you have PDA or RS16 panel, then _label is mandatory
|
||||
# button_??_label=Filter Pump <Label you want to see>
|
||||
# button_??_dzidx=37 <Domoticz IDX>
|
||||
# button_??_pumpID=0x60 <RS485 ID of VSP>
|
||||
# button_??_pumpIndex=1 <Pump index Jandy panel is configured to use>
|
||||
# button_??_lightMode=4 <Color light mode>
|
||||
# button_??_dzidx=37 <Domoticz IDX>
|
||||
# button_??_pumpID=0x60 <RS485 ID of VSP>
|
||||
# button_??_pumpIndex=1 <Pump index Jandy panel is configured to use>
|
||||
# button_??_pumpType=Pentair VF <Pump Type, one of the folowing :- JANDY ePUMP, Pentair VF, Pentair VS>
|
||||
# button_??_lightMode=4 <Color light mode>
|
||||
#
|
||||
# In most cases the label is just what you want to see in web UI/MQTT/API. ie you don't need to use Jandy's labeling. There are 2 exaeptions to the labeling listed below
|
||||
# 1) If using PDA mode, The Labels below are of the utmost importance, the labels MUST exactly match the labels in the "EQUIPTMENT ON/OFF" menu of the PDA device.
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -41,7 +41,7 @@
|
|||
#define SLOG_MAX 80
|
||||
#define PACKET_MAX 600
|
||||
|
||||
#define VERSION "serial_logger V2.1"
|
||||
#define VERSION "serial_logger V2.2"
|
||||
|
||||
/*
|
||||
typedef enum used {
|
||||
|
@ -80,13 +80,15 @@ unsigned char _goodIAQTID[] = {0x30, 0x31, 0x32, 0x33};
|
|||
unsigned char _goodRSSAID[] = {0x48, 0x49}; // Know there are only 2 good RS SA id's, guess 0x49 is the second.
|
||||
unsigned char _filter[10];
|
||||
int _filters=0;
|
||||
unsigned char _pfilter[10];
|
||||
int _pfilters=0;
|
||||
bool _rawlog=false;
|
||||
bool _playback_file = false;
|
||||
|
||||
|
||||
int sl_timespec_subtract (struct timespec *result, const struct timespec *x, const struct timespec *y);
|
||||
|
||||
int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, bool panleProbe, bool rsSerialSpeedTest, bool errorMonitor, bool printAllIDs);
|
||||
int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, bool panleProbe, bool rsSerialSpeedTest, bool errorMonitor, bool printAllIDs, bool timePackets);
|
||||
|
||||
|
||||
#ifdef SERIAL_LOGGER
|
||||
|
@ -101,7 +103,7 @@ void intHandler(int dummy) {
|
|||
}
|
||||
#else
|
||||
int serial_logger (int rs_fd, char *port_name, int logLevel) {
|
||||
return _serial_logger(rs_fd, port_name, PACKET_MAX, (logLevel>=LOG_NOTICE?logLevel:LOG_NOTICE), true, false, false, false);
|
||||
return _serial_logger(rs_fd, port_name, PACKET_MAX, (logLevel>=LOG_NOTICE?logLevel:LOG_NOTICE), true, false, false, false, false);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -306,7 +308,7 @@ void printHex(char *pk, int length)
|
|||
}
|
||||
|
||||
|
||||
void printPacket(unsigned char ID, unsigned char *packet_buffer, int packet_length)
|
||||
void printPacket(unsigned char ID, unsigned char *packet_buffer, int packet_length, char *message)
|
||||
{
|
||||
int i;
|
||||
|
||||
|
@ -316,29 +318,53 @@ void printPacket(unsigned char ID, unsigned char *packet_buffer, int packet_leng
|
|||
return;
|
||||
}
|
||||
|
||||
if (_filters != 0)
|
||||
// if filter is set and not match, then return without printing.
|
||||
if (_filters != 0 || _pfilters != 0)
|
||||
{
|
||||
bool dest_match = false;
|
||||
bool src_match = false;
|
||||
bool pent_match = false;
|
||||
|
||||
for (i=0; i < _filters; i++) {
|
||||
if ( packet_buffer[PKT_DEST] == _filter[i])
|
||||
dest_match = true;
|
||||
if ( ID == _filter[i] && packet_buffer[PKT_DEST] == 0x00 )
|
||||
src_match = true;
|
||||
if (_filters != 0) {
|
||||
for (i=0; i < _filters; i++) {
|
||||
if ( packet_buffer[PKT_DEST] == _filter[i])
|
||||
dest_match = true;
|
||||
if ( ID == _filter[i] && packet_buffer[PKT_DEST] == 0x00 )
|
||||
src_match = true;
|
||||
}
|
||||
}
|
||||
if (_pfilters != 0) {
|
||||
for (i=0; i < _pfilters; i++) {
|
||||
if ( packet_buffer[PEN_PKT_FROM] == _pfilter[i] ||
|
||||
packet_buffer[PEN_PKT_DEST] == _pfilter[i] )
|
||||
pent_match = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(dest_match == false && src_match == false)
|
||||
if(dest_match == false && src_match == false && pent_match == false)
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
if (message != NULL)
|
||||
printf("%s",message);
|
||||
|
||||
protocolType ptype = getProtocolType(packet_buffer);
|
||||
|
||||
printf("%s packet To 0x%02hhx of type %16.16s",
|
||||
(ptype==PENTAIR?"Pentair":"Jandy "),
|
||||
packet_buffer[(ptype==JANDY?PKT_DEST:PEN_PKT_DEST)],
|
||||
get_packet_type(packet_buffer, packet_length));
|
||||
/*
|
||||
if (getProtocolType(packet_buffer)==JANDY) {
|
||||
if (packet_buffer[PKT_DEST] != 0x00)
|
||||
printf("\n");
|
||||
printf("Jandy %4.4s 0x%02hhx of type %16.16s", (packet_buffer[PKT_DEST]==0x00?"From":"To"), (packet_buffer[PKT_DEST]==0x00?ID:packet_buffer[PKT_DEST]), get_packet_type(packet_buffer, packet_length));
|
||||
} else {
|
||||
printf("Pentair From 0x%02hhx To 0x%02hhx ",packet_buffer[PEN_PKT_FROM],packet_buffer[PEN_PKT_DEST] );
|
||||
if (packet_buffer[PEN_PKT_FROM] == 0x10)
|
||||
printf("\n");
|
||||
printf("Pentair From 0x%02hhx To 0x%02hhx ",packet_buffer[PEN_PKT_FROM],packet_buffer[PEN_PKT_DEST] );
|
||||
}
|
||||
*/
|
||||
printf(" | HEX: ");
|
||||
printHex((char *)packet_buffer, packet_length);
|
||||
|
||||
|
@ -363,6 +389,7 @@ int main(int argc, char *argv[]) {
|
|||
bool serialBlocking = true;
|
||||
bool errorMonitor = false;
|
||||
bool printAllIDs = false;
|
||||
bool timePackets = false;
|
||||
|
||||
// aq_serial.c uses the following
|
||||
_aqconfig_.log_protocol_packets = false;
|
||||
|
@ -384,12 +411,14 @@ int main(int argc, char *argv[]) {
|
|||
fprintf(stderr, "\t-d (debug / print messages)\n");
|
||||
fprintf(stderr, "\t-p <number> (# packets to log, default=%d)\n",PACKET_MAX);
|
||||
fprintf(stderr, "\t-i <ID> (just log specific ID, can use multiple -i. will also force -d switc)\n");
|
||||
fprintf(stderr, "\t-pi <ID> (just log specific Pantair ID, can use multiple -pi. will also force -d switch)\n");
|
||||
fprintf(stderr, "\t-r (raw)\n");
|
||||
fprintf(stderr, "\t-s (Serial Speed Test / OS caching issues)\n");
|
||||
fprintf(stderr, "\t-lpack (log RS packets to %s)\n",RS485LOGFILE);
|
||||
fprintf(stderr, "\t-lrawb (log raw RS bytes to %s)\n",RS485BYTELOGFILE);
|
||||
fprintf(stderr, "\t-e (monitor errors)\n");
|
||||
fprintf(stderr, "\t-a (Print all ID's the panel queried)\n");
|
||||
fprintf(stderr, "\t-t (time each packet, will also force -s switch)\n");
|
||||
fprintf(stderr, "\nie:\t%s /dev/ttyUSB0 -d -p 1000 -i 0x08 -i 0x0a\n\n", argv[0]);
|
||||
return 1;
|
||||
}
|
||||
|
@ -405,7 +434,14 @@ int main(int argc, char *argv[]) {
|
|||
sscanf(argv[i+1], "0x%2x", &n);
|
||||
_filter[_filters] = n;
|
||||
_filters++;
|
||||
printf("Add filter %i 0x%02hhx\n",_filters, _filter[_filters-1]);
|
||||
printf("Add Jandy filter %i 0x%02hhx\n",_filters, _filter[_filters-1]);
|
||||
logLevel = LOG_DEBUG; // no point in filtering on ID if we're not going to print it.
|
||||
} else if (strcmp(argv[i], "-pi") == 0 && i+1 < argc) {
|
||||
unsigned int n;
|
||||
sscanf(argv[i+1], "0x%2x", &n);
|
||||
_pfilter[_pfilters] = n;
|
||||
_pfilters++;
|
||||
printf("Add Pentair filter %i 0x%02hhx\n",_pfilters, _pfilter[_pfilters-1]);
|
||||
logLevel = LOG_DEBUG; // no point in filtering on ID if we're not going to print it.
|
||||
} else if (strcmp(argv[i], "-r") == 0) {
|
||||
_rawlog = true;
|
||||
|
@ -425,6 +461,9 @@ int main(int argc, char *argv[]) {
|
|||
errorMonitor = true;
|
||||
} else if (strcmp(argv[i], "-a") == 0) {
|
||||
printAllIDs = true;
|
||||
} else if (strcmp(argv[i], "-t") == 0) {
|
||||
timePackets = true;
|
||||
logLevel = LOG_DEBUG;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -472,7 +511,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
startPacketLogger();
|
||||
|
||||
_serial_logger(rs_fd, argv[1], logPackets, logLevel, panleProbe, rsSerialSpeedTest, errorMonitor, printAllIDs);
|
||||
_serial_logger(rs_fd, argv[1], logPackets, logLevel, panleProbe, rsSerialSpeedTest, errorMonitor, printAllIDs, timePackets);
|
||||
|
||||
stopPacketLogger();
|
||||
|
||||
|
@ -484,7 +523,7 @@ int main(int argc, char *argv[]) {
|
|||
|
||||
|
||||
|
||||
int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, bool panleProbe, bool rsSerialSpeedTest, bool errorMonitor, bool printAllIDs) {
|
||||
int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, bool panleProbe, bool rsSerialSpeedTest, bool errorMonitor, bool printAllIDs, bool timePackets) {
|
||||
int packet_length;
|
||||
int last_packet_length = 0;
|
||||
unsigned char packet_buffer[AQ_MAXPKTLEN];
|
||||
|
@ -500,10 +539,17 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
struct timespec start_time;
|
||||
struct timespec end_time;
|
||||
struct timespec elapsed;
|
||||
struct timespec packet_start_time;
|
||||
struct timespec packet_end_time;
|
||||
struct timespec packet_elapsed;
|
||||
char extra_message[64];
|
||||
int blankReads = 0;
|
||||
bool returnError = false;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &start_time);
|
||||
if (timePackets) {
|
||||
clock_gettime(CLOCK_REALTIME, &packet_start_time);
|
||||
}
|
||||
|
||||
while (_keepRunning == true) {
|
||||
if (rs_fd < 0) {
|
||||
|
@ -512,6 +558,13 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
|
||||
packet_length = get_packet(rs_fd, packet_buffer);
|
||||
|
||||
if (timePackets) {
|
||||
clock_gettime(CLOCK_REALTIME, &packet_end_time);
|
||||
sl_timespec_subtract(&packet_elapsed, &packet_end_time, &packet_start_time);
|
||||
clock_gettime(CLOCK_REALTIME, &packet_start_time);
|
||||
sprintf(extra_message,"Time between packets (%.3f sec)\n", roundf3(timespec2float(&packet_elapsed)) );
|
||||
}
|
||||
|
||||
if (packet_length == AQSERR_READ) {
|
||||
// Unrecoverable read error. Force an attempt to reconnect.
|
||||
LOG(RSSD_LOG, LOG_ERR, "ERROR, on serial port! Please check %s\n",port_name);
|
||||
|
@ -545,7 +598,7 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
//LOG(RSSD_LOG, LOG_DEBUG_SERIAL, "Received Packet for ID 0x%02hhx of type %s\n", packet_buffer[PKT_DEST], get_packet_type(packet_buffer, packet_length));
|
||||
#ifdef SERIAL_LOGGER
|
||||
if (logLevel > LOG_NOTICE)
|
||||
printPacket(lastID, packet_buffer, packet_length);
|
||||
printPacket(lastID, packet_buffer, packet_length, timePackets?extra_message:NULL);
|
||||
#endif
|
||||
if (getProtocolType(packet_buffer) == PENTAIR) {
|
||||
found = false;
|
||||
|
@ -607,6 +660,12 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
|
||||
}
|
||||
|
||||
#ifndef SERIAL_LOGGER
|
||||
if(received_packets%100==0) {
|
||||
LOG(RSSD_LOG, LOG_NOTICE, "Read %d of %d packets\n", received_packets, logPackets);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (logPackets != 0 && received_packets >= logPackets) {
|
||||
_keepRunning = false;
|
||||
}
|
||||
|
@ -629,7 +688,7 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
clock_gettime(CLOCK_REALTIME, &end_time);
|
||||
|
||||
// If we were monitoring errors, or filtering messages, or no panel probe, don;t print details
|
||||
if (errorMonitor || panleProbe==false || _filters > 0) {
|
||||
if (errorMonitor || panleProbe==false || _filters > 0 || _pfilters > 0) {
|
||||
return 0;
|
||||
} else if (returnError) {
|
||||
return 1;
|
||||
|
|
|
@ -0,0 +1,600 @@
|
|||
Debug: RS Serial: Time 0.59 sec (59437865 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10919058 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09934119 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17965098 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07933240 ns)
|
||||
Debug: RS Serial: Time 0.461 sec (461889391 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09914193 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12930179 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10946132 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09939767 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17943857 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07940721 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64939477 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10928577 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12945622 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10947262 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09933341 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17954134 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08930290 ns)
|
||||
Debug: RS Serial: Time 0.462 sec (462875126 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09888860 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13926859 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09938878 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09944415 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17948098 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08928735 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63899667 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09912563 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13953320 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09915989 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10925226 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16950732 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08952531 ns)
|
||||
Debug: RS Serial: Time 0.463 sec (463932706 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09847991 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26916220 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10896133 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13942969 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09941396 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10936465 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16949028 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08924216 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60934255 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09926545 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13953173 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09950711 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10964539 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16895881 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09923582 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62950690 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10915410 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08929772 ns)
|
||||
Debug: RS Serial: Time 0.61 sec (61924307 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09953915 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10931521 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16944009 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09926138 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64950808 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09962155 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13942839 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09942452 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10958058 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16946065 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09959840 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62955707 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10928058 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12953307 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09964488 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10953502 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16963398 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09928804 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62947318 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10940836 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12956233 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09951229 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10973298 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16955713 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09937285 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62953874 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10948465 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13001954 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09878953 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10947780 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16950287 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09959118 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62957096 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10920910 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12954474 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09957785 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10964909 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16956398 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09937174 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62955911 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10948725 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12963122 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09961488 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10959539 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16977398 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09938285 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62952077 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10960335 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08950568 ns)
|
||||
Debug: RS Serial: Time 0.61 sec (61954767 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09911304 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10956409 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16949916 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08947049 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60954568 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10936910 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12932900 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09938508 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10954113 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17947356 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08962345 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62951132 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10952335 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12948751 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09958507 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10960836 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17951505 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08956660 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62955818 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10947558 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26958849 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09946081 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13959357 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09960452 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10964298 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16952806 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08948679 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60949513 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10952150 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12959880 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09914638 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10998871 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17910320 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08955735 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62945910 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10948447 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12948047 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09968544 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10951947 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17954745 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08956530 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62948540 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10942132 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12948047 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10968613 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09963081 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17976170 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08932920 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62911503 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10918299 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08979567 ns)
|
||||
Debug: RS Serial: Time 0.61 sec (61869176 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10947576 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09915619 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16978526 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08879903 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60951160 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10942909 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12960380 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10966909 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09951470 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17932227 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08941919 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26955311 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10954798 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12942789 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10948835 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08945197 ns)
|
||||
Debug: RS Serial: Time 0.20 sec (20949360 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17943226 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08946067 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63960775 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10913318 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12917493 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10946299 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26928274 ns)
|
||||
Debug: RS Serial: Time 0.21 sec (21964687 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17912819 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08932956 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63955423 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10957150 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12970251 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10945946 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08956326 ns)
|
||||
Debug: RS Serial: Time 0.20 sec (20955138 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16950249 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08960919 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63963645 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10888226 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12945381 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10956668 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26977737 ns)
|
||||
Debug: RS Serial: Time 0.21 sec (21913652 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16960749 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08963160 ns)
|
||||
Debug: RS Serial: Time 0.58 sec (58983336 ns)
|
||||
Debug: RS Serial: Time 0.59 sec (59798410 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10949113 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12950807 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10965502 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08950308 ns)
|
||||
Debug: RS Serial: Time 0.56 sec (56934902 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16948379 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08948920 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63964015 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10923613 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12964380 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10966834 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08948160 ns)
|
||||
Debug: RS Serial: Time 0.55 sec (55974795 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17899339 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07947795 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63953088 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950705 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26956774 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10946520 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12958547 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10959909 ns)
|
||||
Debug: RS Serial: Time 0.11 sec (11952904 ns)
|
||||
Debug: RS Serial: Time 0.29 sec (29952536 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07956998 ns)
|
||||
Debug: RS Serial: Time 0.56 sec (56971586 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16958749 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08926976 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64950139 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09956932 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12959806 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950780 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08973660 ns)
|
||||
Debug: RS Serial: Time 0.55 sec (55932351 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17944337 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07929203 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64952825 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09947155 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12967861 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10944669 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08961622 ns)
|
||||
Debug: RS Serial: Time 0.55 sec (55952758 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17959504 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07957979 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64946380 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09957081 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08939826 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62950982 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09932896 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08957881 ns)
|
||||
Debug: RS Serial: Time 0.57 sec (57945210 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17946670 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07953146 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64951064 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09931507 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13962690 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09952655 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08954586 ns)
|
||||
Debug: RS Serial: Time 0.55 sec (55958628 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17960688 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07940239 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64956972 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09948414 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13958449 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09950989 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08959456 ns)
|
||||
Debug: RS Serial: Time 0.55 sec (55951739 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17958781 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07946813 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64950843 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09931544 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13960153 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09932026 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08953790 ns)
|
||||
Debug: RS Serial: Time 0.56 sec (56936087 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16937657 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07935943 ns)
|
||||
Debug: RS Serial: Time 0.64 sec (64948231 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09945636 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13959468 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09954081 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08962900 ns)
|
||||
Debug: RS Serial: Time 0.56 sec (56932216 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16941009 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08957512 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63936255 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09941100 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13965709 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09954877 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09957118 ns)
|
||||
Debug: RS Serial: Time 0.53 sec (53915639 ns)
|
||||
Debug: RS Serial: Time 0.56 sec (56952901 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16936731 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08956567 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63943291 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10953464 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12934992 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09957988 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09955784 ns)
|
||||
Debug: RS Serial: Time 0.55 sec (55954812 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16950694 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08957622 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63929495 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09942340 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26963661 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10923465 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13946375 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09961062 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10949909 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16969656 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08943326 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60968084 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10937539 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13962727 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09960117 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10949094 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16965619 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09946006 ns)
|
||||
Debug: RS Serial: Time 0.61 sec (61952171 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09956173 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13966301 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09916786 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10940465 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16950268 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09960228 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62949871 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10949465 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12961750 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09963228 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950687 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16960082 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10965057 ns)
|
||||
Debug: RS Serial: Time 0.61 sec (61975671 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10953205 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13970652 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09951747 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10961612 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16967730 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09960154 ns)
|
||||
Debug: RS Serial: Time 0.55 sec (55971960 ns)
|
||||
Debug: RS Serial: Time 0.59 sec (59976903 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10865374 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12969361 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09951432 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950965 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16968248 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09949525 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63948142 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950279 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12967139 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09945340 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10963446 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16951823 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09954821 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62933925 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10968260 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12949417 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09927155 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10961927 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16960156 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09962507 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62961332 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10936427 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12958121 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09964284 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950539 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17964632 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08959067 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62951721 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10951575 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12960435 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09960376 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10954335 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17966503 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08958474 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62948628 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10949557 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12956973 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09954210 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10961260 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17958355 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08960067 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62950962 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10958428 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12953121 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09960839 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10963112 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17952577 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08959826 ns)
|
||||
Debug: RS Serial: Time 0.56 sec (56948529 ns)
|
||||
Debug: RS Serial: Time 0.59 sec (59926588 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10955390 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12957565 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09955562 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10960908 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17951744 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08960141 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63951734 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10936946 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26958068 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09965431 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13952486 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10957872 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09955636 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16971174 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08945715 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60953805 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950538 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12958824 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10952298 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09959821 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17958651 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08954381 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62965257 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10987685 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13912913 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10962889 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09956784 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17967743 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08954418 ns)
|
||||
Debug: RS Serial: Time 0.61 sec (61943300 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10946076 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12978861 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10939983 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09964173 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17944596 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08950974 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62930203 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10943113 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12958861 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10952464 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09963228 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17939133 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08942252 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62952035 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10927391 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12926880 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10967834 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09975746 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17951632 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08948752 ns)
|
||||
Debug: RS Serial: Time 0.56 sec (56967676 ns)
|
||||
Debug: RS Serial: Time 0.59 sec (59935680 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950779 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12944862 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10960853 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09956192 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17951707 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08961789 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63955585 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10931872 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12948917 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10956612 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12961009 ns)
|
||||
Debug: RS Serial: Time 0.14 sec (14953610 ns)
|
||||
Debug: RS Serial: Time 0.58 sec (58959462 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16947230 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60946193 ns)
|
||||
Debug: RS Serial: Time 0.15 sec (15944661 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08958196 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17959984 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07943683 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63952381 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10937317 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12942417 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10962556 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09957154 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17952521 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08951067 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62959071 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10950094 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12934899 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10952667 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09959858 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17954077 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08962159 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62939721 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10942816 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12959899 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10961631 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09955654 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17953836 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08963103 ns)
|
||||
Debug: RS Serial: Time 0.463 sec (463943040 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09827139 ns)
|
||||
Debug: RS Serial: Time 0.26 sec (26962290 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10934576 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13962782 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09950506 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09961524 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17949096 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07956053 ns)
|
||||
Debug: RS Serial: Time 0.61 sec (61962779 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09951617 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13972985 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09955191 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09958969 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17941484 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08965603 ns)
|
||||
Debug: RS Serial: Time 0.456 sec (456883334 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60906415 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09942321 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13948523 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09968969 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10943297 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16966099 ns)
|
||||
Debug: RS Serial: Time 0.07 sec (07948850 ns)
|
||||
Debug: RS Serial: Time 0.65 sec (65949703 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09958173 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13952671 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09958247 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10955316 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16963174 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09943673 ns)
|
||||
Debug: RS Serial: Time 0.462 sec (462892078 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09931192 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13954004 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09947118 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10959760 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16959600 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09944598 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62906089 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10943853 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12963416 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09963190 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10972389 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16950100 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09958599 ns)
|
||||
Debug: RS Serial: Time 0.462 sec (462882870 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10930908 ns)
|
||||
Debug: RS Serial: Time 0.25 sec (25963554 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10949278 ns)
|
||||
Debug: RS Serial: Time 0.13 sec (13953541 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09961061 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10958760 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16948063 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08962863 ns)
|
||||
Debug: RS Serial: Time 0.60 sec (60960246 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10957204 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12939269 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09962654 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10958890 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16956989 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09951117 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62961347 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10934427 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12942750 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09958136 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10938797 ns)
|
||||
Debug: RS Serial: Time 0.16 sec (16941693 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09944488 ns)
|
||||
Debug: RS Serial: Time 0.56 sec (56941841 ns)
|
||||
Debug: RS Serial: Time 0.59 sec (59923845 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10970241 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12940046 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09943876 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10956186 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17965576 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08946196 ns)
|
||||
Debug: RS Serial: Time 0.63 sec (63949564 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10936205 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12953786 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09962654 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10949778 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17961446 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08945474 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62968049 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10937816 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12966361 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09959969 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10949667 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17956002 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08957418 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62947735 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10951334 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12962417 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09944617 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10962556 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17945354 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08963603 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62971198 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10948297 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12955416 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09965950 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10952464 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17963298 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08954437 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62976476 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10942890 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12954083 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10891113 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09956728 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17952372 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08953196 ns)
|
||||
Debug: RS Serial: Time 0.62 sec (62958087 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10947223 ns)
|
||||
Debug: RS Serial: Time 0.12 sec (12998156 ns)
|
||||
Debug: RS Serial: Time 0.10 sec (10908947 ns)
|
||||
Debug: RS Serial: Time 0.09 sec (09944839 ns)
|
||||
Debug: RS Serial: Time 0.17 sec (17942521 ns)
|
||||
Debug: RS Serial: Time 0.08 sec (08954029 ns)
|
22
utils.c
22
utils.c
|
@ -26,7 +26,7 @@
|
|||
#include <sys/file.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <time.h>
|
||||
//#include <time.h>
|
||||
#include <ctype.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
|
@ -289,8 +289,8 @@ const char* logmask2name(int16_t from)
|
|||
case NET_LOG:
|
||||
return "NetService:";
|
||||
break;
|
||||
case AQRS_LOG:
|
||||
return "RS Allbtn: ";
|
||||
case ALLB_LOG:
|
||||
return "AllButton: ";
|
||||
break;
|
||||
case RSSA_LOG:
|
||||
return "RS SAdptr: ";
|
||||
|
@ -314,13 +314,16 @@ const char* logmask2name(int16_t from)
|
|||
return "RS Serial: ";
|
||||
break;
|
||||
case PROG_LOG:
|
||||
return "Panl Prog: ";
|
||||
return "Panl&Prog: ";
|
||||
break;
|
||||
case DBGT_LOG:
|
||||
return "AQ Timing: ";
|
||||
return "DebugTimer:";
|
||||
break;
|
||||
case TIMR_LOG:
|
||||
return "Schd/Timer:";
|
||||
case SCHD_LOG:
|
||||
return "Sched/Timr:";
|
||||
break;
|
||||
case RSTM_LOG:
|
||||
return "RS Timings:";
|
||||
break;
|
||||
case SIM_LOG:
|
||||
return "Simulator: ";
|
||||
|
@ -778,6 +781,11 @@ float degCtoF(float degC)
|
|||
return (degC * 1.8 + 32);
|
||||
}
|
||||
|
||||
|
||||
float timespec2float(const struct timespec *elapsed) {
|
||||
return ((float)elapsed->tv_nsec / 1000000000L) + elapsed->tv_sec;
|
||||
}
|
||||
|
||||
#include <time.h>
|
||||
|
||||
void delay (unsigned int howLong) // Microseconds (1000000 = 1 second) miliseconds
|
||||
|
|
15
utils.h
15
utils.h
|
@ -1,6 +1,7 @@
|
|||
#include <syslog.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
#ifndef UTILS_H_
|
||||
#define UTILS_H_
|
||||
|
@ -24,12 +25,13 @@
|
|||
//#define round(a) (int) (a+0.5) // 0 decimal places (doesn't work for negative numbers)
|
||||
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
|
||||
#define roundf(a) (float) ((a*100)/100) // 2 decimal places
|
||||
#define roundf3(a) (float) ((a*1000)/1000) // 3 decimal places
|
||||
|
||||
// Defined as int16_t so 16 bits to mask
|
||||
#define AQUA_LOG (1 << 0) // Aqualink Generic / catchall
|
||||
#define NET_LOG (1 << 1) // Network
|
||||
// Control protocols
|
||||
#define AQRS_LOG (1 << 2) // Allbutton RS Keypad
|
||||
#define ALLB_LOG (1 << 2) // Allbutton RS Keypad
|
||||
#define ONET_LOG (1 << 3) // OneTouch
|
||||
#define IAQT_LOG (1 << 4) // iAqualinkTouch
|
||||
#define PDA_LOG (1 << 5) // PDA
|
||||
|
@ -40,13 +42,14 @@
|
|||
// misc
|
||||
#define RSSD_LOG (1 << 9) // RS485 Connection /dev/ttyUSB?
|
||||
#define PROG_LOG (1 << 10) // Programmer
|
||||
#define DBGT_LOG (1 << 11) // Debug Timer
|
||||
#define TIMR_LOG (1 << 12) // Timers
|
||||
#define SCHD_LOG (1 << 11) // Scheduler Timer
|
||||
#define RSTM_LOG (1 << 12) // RS packet Time
|
||||
#define SIM_LOG (1 << 13) // Simulator
|
||||
|
||||
// Set scheduler log to timer log
|
||||
#define SCHD_LOG TIMR_LOG
|
||||
#define DBGT_LOG (1 << 14) // Debug Timer
|
||||
|
||||
#define TIMR_LOG SCHD_LOG
|
||||
#define PANL_LOG PROG_LOG
|
||||
|
||||
/*
|
||||
#define INT_MAX +2147483647
|
||||
|
@ -116,7 +119,7 @@ char* stristr(const char* haystack, const char* needle);
|
|||
char *prittyString(char *str);
|
||||
//void writePacketLog(char *buff);
|
||||
//void closePacketLog();
|
||||
|
||||
float timespec2float(const struct timespec *elapsed);
|
||||
|
||||
#ifdef AQ_MANAGER
|
||||
//void startInlineLog2File();
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
#define AQUALINKD_NAME "Aqualink Daemon"
|
||||
#define AQUALINKD_SHORT_NAME "AqualinkD"
|
||||
#define AQUALINKD_VERSION "2.3.6"
|
||||
#define AQUALINKD_VERSION "2.3.7"
|
||||
|
|
|
@ -102,9 +102,7 @@
|
|||
color: #777 !important;
|
||||
}
|
||||
|
||||
.statusmsg {
|
||||
|
||||
}
|
||||
.statusmsg {}
|
||||
|
||||
.error {
|
||||
background-color: rgb(255, 0, 0) !important;
|
||||
|
@ -115,6 +113,10 @@
|
|||
color: rgb(255, 0, 0) !important;
|
||||
}
|
||||
|
||||
.newversion {
|
||||
background-color: rgb(148, 195, 233) !important;
|
||||
}
|
||||
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
|
@ -243,6 +245,7 @@
|
|||
|
||||
var _panel_size = 6;
|
||||
var _panel_set = 0;
|
||||
var _latestVersionAvailable = 0;
|
||||
|
||||
function init_collapsible() {
|
||||
var coll = document.getElementsByClassName("collapsible");
|
||||
|
@ -270,7 +273,7 @@
|
|||
}
|
||||
|
||||
function disablebutton(id) {
|
||||
console.log("disable " + id);
|
||||
//console.log("disable " + id);
|
||||
var button = document.getElementById(id);
|
||||
if (button) {
|
||||
button.disabled = true;
|
||||
|
@ -278,7 +281,7 @@
|
|||
}
|
||||
}
|
||||
function enablebutton(id) {
|
||||
console.log("enable " + id);
|
||||
//console.log("enable " + id);
|
||||
var button = document.getElementById(id);
|
||||
if (button) {
|
||||
button.disabled = false;
|
||||
|
@ -323,15 +326,15 @@
|
|||
var logcontainer = document.getElementById("logs");
|
||||
|
||||
if (log_element_count >= LOGS2DISPLAY) {
|
||||
try {
|
||||
console.log("Removing "+logcontainer.lastElementChild.innerHTML);
|
||||
logcontainer.lastElementChild.remove();
|
||||
} catch(e) {
|
||||
console.log("ERROR Removing log '"+logcontainer.lastElementChild.innerHTML+"'");
|
||||
log_element_count++;
|
||||
}
|
||||
try {
|
||||
console.log("Removing " + logcontainer.lastElementChild.innerHTML);
|
||||
logcontainer.lastElementChild.remove();
|
||||
} catch (e) {
|
||||
console.log("ERROR Removing log '" + logcontainer.lastElementChild.innerHTML + "'");
|
||||
log_element_count++;
|
||||
}
|
||||
} else {
|
||||
log_element_count++;
|
||||
log_element_count++;
|
||||
}
|
||||
|
||||
element.appendChild(document.createTextNode(message));
|
||||
|
@ -388,7 +391,7 @@
|
|||
};
|
||||
} else*/
|
||||
if (caller.id == "downloadlog") {
|
||||
|
||||
|
||||
//window.location = '/api/debug/download';
|
||||
downloadFile('/api/logfile/download', document.getElementById("logsize").value);
|
||||
return;
|
||||
|
@ -398,28 +401,28 @@
|
|||
}
|
||||
|
||||
function downloadFile(filePath, lines) {
|
||||
console.log("Lines=" + lines);
|
||||
|
||||
var link = document.createElement('a');
|
||||
link.href = filePath+"/"+lines;
|
||||
//link.download = filePath.substr(filePath.lastIndexOf('/') + 1);
|
||||
link.download = "aqualinkd.log"
|
||||
link.click();
|
||||
// Can't get a form post to cleanly download, and "a download" above can only do get. So add value
|
||||
/*
|
||||
var form = document.createElement('form');
|
||||
form.setAttribute("style", "display: none;");
|
||||
form.method='POST';
|
||||
form.action=filePath;
|
||||
form.target='aqd'; // Set trget to iframe "aqd"(aqualinkd), this stops WS for resetting
|
||||
element=document.createElement('INPUT');
|
||||
element.name='value';
|
||||
element.value=lines;
|
||||
form.appendChild(element);
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
*/
|
||||
|
||||
console.log("Lines=" + lines);
|
||||
|
||||
var link = document.createElement('a');
|
||||
link.href = filePath + "/" + lines;
|
||||
//link.download = filePath.substr(filePath.lastIndexOf('/') + 1);
|
||||
link.download = "aqualinkd.log"
|
||||
link.click();
|
||||
// Can't get a form post to cleanly download, and "a download" above can only do get. So add value
|
||||
/*
|
||||
var form = document.createElement('form');
|
||||
form.setAttribute("style", "display: none;");
|
||||
form.method='POST';
|
||||
form.action=filePath;
|
||||
form.target='aqd'; // Set trget to iframe "aqd"(aqualinkd), this stops WS for resetting
|
||||
element=document.createElement('INPUT');
|
||||
element.name='value';
|
||||
element.value=lines;
|
||||
form.appendChild(element);
|
||||
document.body.appendChild(form);
|
||||
form.submit();
|
||||
*/
|
||||
|
||||
}
|
||||
|
||||
function settoggle(id, onoff) {
|
||||
|
@ -441,13 +444,18 @@
|
|||
|
||||
*/
|
||||
if (data['aqualinkd_version']) {
|
||||
var eCommands = document.getElementById("aqualinkdversion").innerHTML = data['aqualinkd_version'];
|
||||
document.getElementById("aqualinkdversion").innerHTML = data['aqualinkd_version'];
|
||||
if (data['aqualinkd_version'] == _latestVersionAvailable ) {
|
||||
document.getElementById("latesversionavailable").classList.add("hidden");
|
||||
} else {
|
||||
document.getElementById("latesversionavailable").classList.add("newversion");
|
||||
}
|
||||
}
|
||||
if (data['version']) {
|
||||
var eCommands = document.getElementById("panelversion").innerHTML = data['version'];
|
||||
document.getElementById("panelversion").innerHTML = data['version'];
|
||||
}
|
||||
if (data['panel_type']) {
|
||||
var eCommands = document.getElementById("paneltype").innerHTML = data['panel_type'];
|
||||
document.getElementById("paneltype").innerHTML = data['panel_type'];
|
||||
}
|
||||
if (data['status']) {
|
||||
update_status_message(data['status']);
|
||||
|
@ -461,19 +469,19 @@
|
|||
*/
|
||||
}
|
||||
|
||||
function update_status_message(message, error=false) {
|
||||
try{
|
||||
if (error || message.substring(0, 5).toLowerCase() == "error" )
|
||||
document.getElementById("statusmsg").classList.add("error");
|
||||
else
|
||||
document.getElementById("statusmsg").classList.remove("error");
|
||||
function update_status_message(message, error = false) {
|
||||
try {
|
||||
if (error || message.substring(0, 5).toLowerCase() == "error")
|
||||
document.getElementById("statusmsg").classList.add("error");
|
||||
else
|
||||
document.getElementById("statusmsg").classList.remove("error");
|
||||
|
||||
if (message == " ") {
|
||||
document.getElementById("statusmsg").innerHTML = "Connected";
|
||||
} else if (message != " ") {
|
||||
document.getElementById("statusmsg").innerHTML = message;
|
||||
}
|
||||
} catch (Error) {}
|
||||
if (message == " ") {
|
||||
document.getElementById("statusmsg").innerHTML = "Connected";
|
||||
} else if (message != " ") {
|
||||
document.getElementById("statusmsg").innerHTML = message;
|
||||
}
|
||||
} catch (Error) { }
|
||||
}
|
||||
|
||||
function setAqManagerOptions(data) {
|
||||
|
@ -483,26 +491,26 @@
|
|||
if logfilename=NULL we can turn on/off logging to file.
|
||||
logging2file will tell us if it's currently on or off
|
||||
*/
|
||||
if (data['deamonized'] == 'off') {
|
||||
console.log("deamonized=" + data['deamonized'] + " Need to rename Restart to Reload");
|
||||
//disablebutton("restart");
|
||||
}
|
||||
|
||||
/*
|
||||
if (data['logfilename'] == "(null)")
|
||||
enabletoggle("logfile");
|
||||
else
|
||||
disabletoggle("logfile");
|
||||
*/
|
||||
/*
|
||||
if (data['logfileready'] == "on") {
|
||||
enablebutton("downloadlog");
|
||||
enablebutton("cleanlog");
|
||||
} else {
|
||||
disablebutton("downloadlog");
|
||||
disablebutton("cleanlog");
|
||||
if (data['deamonized'] == 'off') {
|
||||
//console.log("deamonized=" + data['deamonized'] + " Need to rename Restart to Reload");
|
||||
disablebutton("restart");
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
if (data['logfilename'] == "(null)")
|
||||
enabletoggle("logfile");
|
||||
else
|
||||
disabletoggle("logfile");
|
||||
*/
|
||||
/*
|
||||
if (data['logfileready'] == "on") {
|
||||
enablebutton("downloadlog");
|
||||
enablebutton("cleanlog");
|
||||
} else {
|
||||
disablebutton("downloadlog");
|
||||
disablebutton("cleanlog");
|
||||
}
|
||||
*/
|
||||
var eCommands = document.getElementById("loglevels");
|
||||
for (var obj in data['loglevels']) {
|
||||
//console.log(data['loglevels'][obj].name);
|
||||
|
@ -641,18 +649,19 @@
|
|||
*/
|
||||
function init() {
|
||||
startWebsockets();
|
||||
getLatestVersion();
|
||||
}
|
||||
|
||||
function set_unavailable(message) {
|
||||
|
||||
|
||||
console.log("!!! NOT Available !!!");
|
||||
|
||||
update_log_message("!!! AqualinkD Manager "+message+" !!!");
|
||||
update_log_message("!!! AqualinkD Manager " + message + " !!!");
|
||||
|
||||
const demoClasses = document.querySelectorAll('.inner');
|
||||
demoClasses.forEach(element => {
|
||||
element.style.opacity = 0.2;
|
||||
console.log('Element '+element);
|
||||
console.log('Element ' + element);
|
||||
});
|
||||
|
||||
disablebutton("restart");
|
||||
|
@ -697,6 +706,20 @@
|
|||
|
||||
send_command(cmd);
|
||||
}
|
||||
|
||||
function getLatestVersion() {
|
||||
var xmlhttp = new XMLHttpRequest();
|
||||
xmlhttp.onreadystatechange = function () {
|
||||
if (this.readyState == 4 && this.status == 200) {
|
||||
var JS = JSON.parse(this.responseText);
|
||||
_latestVersionAvailable = JS.tag_name.replace(/[^\d.-]/g, '');
|
||||
document.getElementById("latestaqualinkdversion").innerHTML = _latestVersionAvailable;
|
||||
|
||||
}
|
||||
};
|
||||
xmlhttp.open("GET", "https://api.github.com/repos/sfeakes/AqualinkD/releases/latest", true);
|
||||
xmlhttp.send();
|
||||
}
|
||||
</script>
|
||||
|
||||
<body onload="init();init_collapsible();">
|
||||
|
@ -712,7 +735,7 @@
|
|||
Console </label></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center"><label id="statusmsg" class="statusmsg" >status</label></td>
|
||||
<td colspan="2" align="center"><label id="statusmsg" class="statusmsg">status</label></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
|
@ -730,6 +753,10 @@
|
|||
<td>AqualinkD version:</td>
|
||||
<td id="aqualinkdversion"></td>
|
||||
</tr>
|
||||
<tr id="latesversionavailable">
|
||||
<td>Latest version:</td>
|
||||
<td id="latestaqualinkdversion"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Panel version:</td>
|
||||
<td id="panelversion"></td>
|
||||
|
@ -753,11 +780,17 @@
|
|||
<div class="toggle-switch"></div><span class="toggle-label">Log to file</span>
|
||||
</label>
|
||||
-->
|
||||
<table border='0'><tr><td>
|
||||
<input id="downloadlog" type="button" onclick="setlogfile(this);" value="Download logfile"></input>
|
||||
</td><td>
|
||||
<input id="logsize" type="text" value="1000" size="5">#lines</input>
|
||||
</td></tr></table>
|
||||
<table border='0'>
|
||||
<tr>
|
||||
<td>
|
||||
<input id="downloadlog" type="button" onclick="setlogfile(this);"
|
||||
value="Download logfile"></input>
|
||||
</td>
|
||||
<td>
|
||||
<input id="logsize" type="text" value="1000" size="5">#lines</input>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
<!-- -->
|
||||
<button class="collapsible">Debug Masks</button>
|
||||
|
@ -777,7 +810,7 @@
|
|||
<!--<div class="inner">END</div>-->
|
||||
</div>
|
||||
</div>
|
||||
<!--<iframe src='about:blank' id="logdownload"></iframe>-->
|
||||
<!--<iframe src='about:blank' id="logdownload"></iframe>-->
|
||||
</div>
|
||||
</body>
|
||||
|
||||
|
|
|
@ -19,6 +19,8 @@
|
|||
--tile-width: 100px;
|
||||
--tile_icon-height: 35px;
|
||||
--tile_name-height: 32px;
|
||||
--tile_name-charlimit: 12;
|
||||
--tile_name-height1line: 17px;
|
||||
--tile_status-height: 15px;
|
||||
--tile_grid-gap: 10px;
|
||||
--tile_name-lineheight: 1.2;
|
||||
|
@ -299,6 +301,11 @@
|
|||
/*background-color: green;*/
|
||||
line-height: var(--tile_name-lineheight);
|
||||
}
|
||||
.tile_name_1line {
|
||||
height: var(--tile_name-height1line);
|
||||
/*background-color: green;*/
|
||||
line-height: var(--tile_name-lineheight);
|
||||
}
|
||||
|
||||
.tile_status {
|
||||
color: var(--tile_status_text);
|
||||
|
@ -633,8 +640,7 @@
|
|||
document.getElementById('vspswitch_options').classList.remove("hide");
|
||||
document.getElementById('timer_options').classList.remove("hide");
|
||||
document.getElementById('scheduler_options').classList.remove("hide");
|
||||
//document.getElementById('simulator_options').classList.remove("hide");
|
||||
document.getElementById('simulator_iframe').classList.remove("hide");
|
||||
//document.getElementById('simulator_iframe').classList.remove("hide");
|
||||
setColors();
|
||||
load_background();
|
||||
showTileOptions(false);
|
||||
|
@ -722,6 +728,8 @@
|
|||
document.documentElement.style.setProperty('--tile-width', '125px');
|
||||
document.documentElement.style.setProperty('--tile_icon-height', '45px');
|
||||
document.documentElement.style.setProperty('--tile_name-height', '42px');
|
||||
document.documentElement.style.setProperty('--tile_name-height1line', '27px');
|
||||
document.documentElement.style.setProperty('--tile_name-charlimit', '15');
|
||||
document.documentElement.style.setProperty('--tile_status-height', '15px');
|
||||
document.documentElement.style.setProperty('--tile_grid-gap', '20px');
|
||||
document.documentElement.style.setProperty('--tile_name-lineheight', '1.4');
|
||||
|
@ -842,6 +850,7 @@
|
|||
|
||||
function add_tile(id, name, status, type, subtype, off_imgurl, on_imgurl) {
|
||||
var height = getComputedStyle(document.documentElement).getPropertyValue('--tile_icon-height');
|
||||
|
||||
var div = document.createElement('div');
|
||||
div.setAttribute('class', 'tile');
|
||||
div.setAttribute('id', id);
|
||||
|
@ -882,13 +891,25 @@
|
|||
valdiv.textContent = '--';
|
||||
subdiv.appendChild(valdiv);
|
||||
} */
|
||||
subdiv = document.createElement('div');
|
||||
subdiv.setAttribute('class', 'tile_name');
|
||||
subdiv.setAttribute('id', id + '_name');
|
||||
subdiv.textContent = name;
|
||||
div.appendChild(subdiv);
|
||||
title_subdiv = document.createElement('div');
|
||||
title_subdiv.setAttribute('class', 'tile_name');
|
||||
title_subdiv.setAttribute('id', id + '_name');
|
||||
title_subdiv.textContent = name;
|
||||
div.appendChild(title_subdiv);
|
||||
// Value and Thermostat are the same, but value is read only and no state
|
||||
if (type != "value") {
|
||||
// Add extra status line to VSP if we can
|
||||
if (subtype == "switch_vsp") {
|
||||
var title1linechatlimit = getComputedStyle(document.documentElement).getPropertyValue('--tile_name-charlimit');
|
||||
if ( name.length <= title1linechatlimit ) {
|
||||
subdiv = document.createElement('div');
|
||||
subdiv.setAttribute('class', 'tile_status');
|
||||
subdiv.setAttribute('id', id + '_status_line2');
|
||||
div.appendChild(subdiv);
|
||||
title_subdiv.classList.add("tile_name_1line");
|
||||
title_subdiv.classList.remove("tile_name");
|
||||
}
|
||||
}
|
||||
subdiv = document.createElement('div');
|
||||
subdiv.setAttribute('class', 'tile_status');
|
||||
subdiv.setAttribute('id', id + '_status');
|
||||
|
@ -1014,6 +1035,15 @@
|
|||
}
|
||||
} catch(exception) {}
|
||||
}
|
||||
function setTileOnTextLine2(id, text) {
|
||||
try {
|
||||
if (document.getElementById(id).getAttribute('status') == 'on') {
|
||||
document.getElementById(id + '_status_line2').innerHTML = text;
|
||||
} else {
|
||||
//console.log("Tile "+id+" status is '"+document.getElementById(id).getAttribute('status')+"' not setting text to '"+text+"'");
|
||||
}
|
||||
} catch(exception) {}
|
||||
}
|
||||
|
||||
function setThermostatTile(id, value, sp_value) {
|
||||
setTileValue(id, value);
|
||||
|
@ -1137,6 +1167,8 @@
|
|||
|
||||
try {
|
||||
document.getElementById(id + '_status').innerHTML = text;
|
||||
// Clear line 2 status if we have it.
|
||||
document.getElementById(id + '_status_line2').innerHTML = "";
|
||||
} catch (e) {}
|
||||
var tile_icon = document.getElementById(id + '_tile_icon_value');
|
||||
type = tile.getAttribute('type');
|
||||
|
@ -1222,15 +1254,22 @@
|
|||
document.getElementById(object.id).setAttribute('setpoint', 0);
|
||||
} else {
|
||||
if (object.Pump_Type == "vfPump") {
|
||||
if (_show_vsp_gpm == true)
|
||||
if (_show_vsp_gpm == true) {
|
||||
setTileOnText(object.id, 'GPM:'+object.Pump_GPM);
|
||||
else
|
||||
setTileOnTextLine2(object.id, 'RPM:'+object.Pump_RPM);
|
||||
} else {
|
||||
setTileOnText(object.id, 'RPM:'+object.Pump_RPM);
|
||||
|
||||
setTileOnTextLine2(object.id, 'GPM:'+object.Pump_GPM);
|
||||
}
|
||||
document.getElementById(object.id).setAttribute('setpoint', object.Pump_GPM);
|
||||
} else {
|
||||
setTileOnText(object.id, 'RPM:'+object.Pump_RPM);
|
||||
document.getElementById(object.id).setAttribute('setpoint', object.Pump_RPM);
|
||||
if (object.Pump_GPM > 0) {
|
||||
setTileOnTextLine2(object.id, 'GPM:'+object.Pump_GPM);
|
||||
} else {
|
||||
setTileOnTextLine2(object.id, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1262,7 +1301,7 @@
|
|||
document.getElementById('vspswitch_options').style.display = 'none';
|
||||
document.getElementById('timer_options').style.display = 'none';
|
||||
document.getElementById('scheduler_options').style.display = 'none';
|
||||
document.getElementById('simulator_iframe').style.display = 'none';
|
||||
//document.getElementById('simulator_iframe').style.display = 'none';
|
||||
} else if (id != null && document.getElementById(id).getAttribute('type') == 'switch_program') {
|
||||
active_option = document.getElementById('pswitch_options');
|
||||
document.getElementById('thermostat_options').style.display = 'none';
|
||||
|
@ -1270,7 +1309,7 @@
|
|||
document.getElementById('vspswitch_options').style.display = 'none';
|
||||
document.getElementById('timer_options').style.display = 'none';
|
||||
document.getElementById('scheduler_options').style.display = 'none';
|
||||
document.getElementById('simulator_iframe').style.display = 'none';
|
||||
//document.getElementById('simulator_iframe').style.display = 'none';
|
||||
} else if (id != null && document.getElementById(id).getAttribute('type') == 'setpoint_swg') {
|
||||
active_option = document.getElementById('swg_options');
|
||||
document.getElementById('thermostat_options').style.display = 'none';
|
||||
|
@ -1278,7 +1317,7 @@
|
|||
document.getElementById('vspswitch_options').style.display = 'none';
|
||||
document.getElementById('timer_options').style.display = 'none';
|
||||
document.getElementById('scheduler_options').style.display = 'none';
|
||||
document.getElementById('simulator_iframe').style.display = 'none';
|
||||
//document.getElementById('simulator_iframe').style.display = 'none';
|
||||
} else if (id != null && document.getElementById(id).getAttribute('type') == 'setpoint_freeze') {
|
||||
active_option = document.getElementById('swg_options');
|
||||
document.getElementById('thermostat_options').style.display = 'none';
|
||||
|
@ -1286,7 +1325,7 @@
|
|||
document.getElementById('vspswitch_options').style.display = 'none';
|
||||
document.getElementById('timer_options').style.display = 'none';
|
||||
document.getElementById('scheduler_options').style.display = 'none';
|
||||
document.getElementById('simulator_iframe').style.display = 'none';
|
||||
//document.getElementById('simulator_iframe').style.display = 'none';
|
||||
} else if (id != null && document.getElementById(id).getAttribute('type') == 'switch_vsp') {
|
||||
active_option = document.getElementById('vspswitch_options');
|
||||
document.getElementById('thermostat_options').style.display = 'none';
|
||||
|
@ -1294,7 +1333,7 @@
|
|||
document.getElementById('swg_options').style.display = 'none';
|
||||
document.getElementById('timer_options').style.display = 'none';
|
||||
document.getElementById('scheduler_options').style.display = 'none';
|
||||
document.getElementById('simulator_iframe').style.display = 'none';
|
||||
//document.getElementById('simulator_iframe').style.display = 'none';
|
||||
} else if (id != null && document.getElementById(id).getAttribute('type') == 'switch_timer') {
|
||||
active_option = document.getElementById('timer_options');
|
||||
document.getElementById('thermostat_options').style.display = 'none';
|
||||
|
@ -1302,7 +1341,7 @@
|
|||
document.getElementById('swg_options').style.display = 'none';
|
||||
document.getElementById('vspswitch_options').style.display = 'none';
|
||||
document.getElementById('scheduler_options').style.display = 'none';
|
||||
document.getElementById('simulator_iframe').style.display = 'none';
|
||||
//document.getElementById('simulator_iframe').style.display = 'none';
|
||||
} else if (id != null && document.getElementById(id).getAttribute('type') == 'scheduler') {
|
||||
active_option = document.getElementById('scheduler_options');
|
||||
document.getElementById('thermostat_options').style.display = 'none';
|
||||
|
@ -1310,8 +1349,8 @@
|
|||
document.getElementById('swg_options').style.display = 'none';
|
||||
document.getElementById('vspswitch_options').style.display = 'none';
|
||||
document.getElementById('timer_options').style.display = 'none';
|
||||
document.getElementById('simulator_iframe').style.display = 'none';
|
||||
} else if (id != null && document.getElementById(id).getAttribute('type') == 'simulator') {
|
||||
//document.getElementById('simulator_iframe').style.display = 'none';
|
||||
} /*else if (id != null && document.getElementById(id).getAttribute('type') == 'simulator') {
|
||||
active_option = document.getElementById('simulator_iframe');
|
||||
document.getElementById('thermostat_options').style.display = 'none';
|
||||
document.getElementById('pswitch_options').style.display = 'none';
|
||||
|
@ -1319,7 +1358,7 @@
|
|||
document.getElementById('vspswitch_options').style.display = 'none';
|
||||
document.getElementById('timer_options').style.display = 'none';
|
||||
document.getElementById('scheduler_options').style.display = 'none';
|
||||
}
|
||||
}*/
|
||||
|
||||
active_option.style.display = 'flex';
|
||||
/*
|
||||
|
@ -1354,7 +1393,7 @@
|
|||
document.getElementById('vspswitch_options').style.display = 'none';
|
||||
document.getElementById('timer_options').style.display = 'none';
|
||||
document.getElementById('scheduler_options').style.display = 'none';
|
||||
document.getElementById('simulator_iframe').style.display = 'none';
|
||||
//document.getElementById('simulator_iframe').style.display = 'none';
|
||||
document.getElementById('wrapper').classList.remove("opaque");
|
||||
return;
|
||||
}
|
||||
|
@ -1408,8 +1447,8 @@
|
|||
} else if (type == 'scheduler') {
|
||||
title = document.getElementById("scheduler_options_title");
|
||||
close_button = document.getElementById("scheduler_options_close");
|
||||
} else if (type == 'simulator') {
|
||||
close_button = document.getElementById("simulator_iframe_close");
|
||||
//} else if (type == 'simulator') {
|
||||
// close_button = document.getElementById("simulator_iframe_close");
|
||||
} else {
|
||||
slider = document.getElementById("option_slider_range");
|
||||
slider_output = document.getElementById("option_slider_text_value");
|
||||
|
@ -2188,15 +2227,22 @@
|
|||
} else {
|
||||
//setTileOnText(object.id, 'RPM:'+object.Pump_RPM);
|
||||
if (data["Pump_"+i].Pump_Type == "vfPump") {
|
||||
if (_show_vsp_gpm == true)
|
||||
if (_show_vsp_gpm == true) {
|
||||
setTileOnText(data["Pump_"+i].id, 'GPM:'+data["Pump_"+i].GPM);
|
||||
else
|
||||
setTileOnTextLine2(data["Pump_"+i].id, 'RPM:'+data["Pump_"+i].RPM);
|
||||
} else {
|
||||
setTileOnText(data["Pump_"+i].id, 'RPM:'+data["Pump_"+i].RPM);
|
||||
|
||||
setTileOnTextLine2(data["Pump_"+i].id, 'GPM:'+data["Pump_"+i].GPM);
|
||||
}
|
||||
document.getElementById(data["Pump_"+i].id).setAttribute('setpoint', data["Pump_"+i].GPM);
|
||||
} else {
|
||||
document.getElementById(data["Pump_"+i].id).setAttribute('setpoint', data["Pump_"+i].RPM);
|
||||
setTileOnText(data["Pump_"+i].id, 'RPM:'+data["Pump_"+i].RPM);
|
||||
if (data["Pump_"+i].GPM > 0) {
|
||||
setTileOnTextLine2(data["Pump_"+i].id, 'GPM:'+data["Pump_"+i].GPM);
|
||||
} else {
|
||||
setTileOnTextLine2(data["Pump_"+i].id, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
|
@ -2468,7 +2514,7 @@
|
|||
}
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
@ -2480,7 +2526,6 @@
|
|||
<!-- <div id='body_wrap' class='body_wrap' onmousedown='showTileOptions(false);'> -->
|
||||
<div id='wrapper' class="wrapper">
|
||||
<div id="header" class="head" onclick="showBackground();">
|
||||
<!--<div id="header" class="head" onclick="event.stopPropagation();showSimulator(this);">-->
|
||||
<table border='0' width='100%' cellpadding='0' cellspacing='0'>
|
||||
<tr>
|
||||
<td width="70px" align='left' id='td_name'><span class='title' id='name'
|
||||
|
@ -2712,15 +2757,14 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!--
|
||||
<div id="simulator_iframe" class='options hide'>
|
||||
<div id="onetouch_iframe" class="simulator_pane" onclick='event.stopPropagation();''>
|
||||
<iframe id="simulatoriframe" src="/onetouch_sim.html" class="simiframe"></iframe>
|
||||
<input type="button" class="options_button" id="simulator_iframe_close" value="Close">
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
-->
|
||||
<div id='scheduler_options' class='options hide'>
|
||||
<div id='scheduler_options_pane' class='scheduler_pane' onclick='event.stopPropagation();'>
|
||||
<table id="cronschedules" border="0">
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -169,13 +169,13 @@ console.log("SIM LOAD");
|
|||
console.log("OneTouch checking if iframe");
|
||||
if (targetNode != null) {
|
||||
var observer = new MutationObserver(function(){
|
||||
if(targetNode.style.display != 'none'){
|
||||
console.log("OneTouch sim Displaying");
|
||||
startWebsockets();
|
||||
} else {
|
||||
console.log("OneTouch sim Hiding");
|
||||
stopWebsockets();
|
||||
}
|
||||
if(targetNode.style.display != 'none'){
|
||||
console.log("OneTouch sim Displaying");
|
||||
startWebsockets();
|
||||
} else {
|
||||
console.log("OneTouch sim Hiding");
|
||||
stopWebsockets();
|
||||
}
|
||||
});
|
||||
observer.observe(targetNode, { attributes: true, childList: true });
|
||||
console.log("OneTouch in iframe");
|
||||
|
|
Loading…
Reference in New Issue