mirror of https://github.com/sfeakes/AqualinkD.git
update
parent
d4397f8f27
commit
dba4f553b7
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -471,6 +471,10 @@ SPILLOVER IS DISABLED WHILE SPA IS ON
|
|||
#define IAQ_PAGE_FREEZE_PROTECT 0x11
|
||||
#define IAQ_PAGE_LABEL_AUX 0x32
|
||||
#define IAQ_PAGE_HELP 0x0c
|
||||
#define IAQ_PAGE_SERVICEMODE 0x5e // Also Timeout
|
||||
|
||||
#define IAQ_PAGE_DEVICES_REV_Yg 0x0a // Panel rev Yg (and maybe others use this)
|
||||
|
||||
//#define IAQ_PAGE_START_BOOST 0x3f
|
||||
//#define IAQ_PAGE_DEGREES 0xFF // Added this as never want to actually select the page, just go to it.
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ struct iaqt_page_button *iaqtFindButtonByIndex(int index) {
|
|||
struct iaqt_page_button *buttons;
|
||||
|
||||
// NSF Need to merge this from iaqtFindButtonByLabel function
|
||||
if (_currentPage == IAQ_PAGE_DEVICES)
|
||||
if (_currentPage == IAQ_PAGE_DEVICES || _currentPage == IAQ_PAGE_DEVICES_REV_Yg)
|
||||
buttons = _devicePageButtons[0];
|
||||
else if (_currentPage == IAQ_PAGE_DEVICES2)
|
||||
buttons = _devicePageButtons[1];
|
||||
|
@ -164,7 +164,7 @@ struct iaqt_page_button *iaqtFindButtonByLabel(const char *label) {
|
|||
int i;
|
||||
struct iaqt_page_button *buttons;
|
||||
|
||||
if (_currentPage == IAQ_PAGE_DEVICES)
|
||||
if (_currentPage == IAQ_PAGE_DEVICES || _currentPage == IAQ_PAGE_DEVICES_REV_Yg)
|
||||
buttons = _devicePageButtons[0];
|
||||
else if (_currentPage == IAQ_PAGE_DEVICES2)
|
||||
buttons = _devicePageButtons[1];
|
||||
|
@ -289,7 +289,7 @@ void processPageButton(unsigned char *message, int length, struct aqualinkdata *
|
|||
struct iaqt_page_button *button;
|
||||
int index = (int)message[PKT_IAQT_BUTINDX];
|
||||
|
||||
if (_currentPageLoading == IAQ_PAGE_DEVICES)
|
||||
if (_currentPageLoading == IAQ_PAGE_DEVICES || _currentPageLoading == IAQ_PAGE_DEVICES_REV_Yg)
|
||||
button = &_devicePageButtons[0][index];
|
||||
else if (_currentPageLoading == IAQ_PAGE_DEVICES2)
|
||||
button = &_devicePageButtons[1][index];
|
||||
|
@ -673,8 +673,11 @@ void processPage(struct aqualinkdata *aq_data)
|
|||
case IAQ_PAGE_DEVICES:
|
||||
case IAQ_PAGE_DEVICES2:
|
||||
case IAQ_PAGE_DEVICES3:
|
||||
case IAQ_PAGE_DEVICES_REV_Yg:
|
||||
if (_currentPage == IAQ_PAGE_DEVICES)
|
||||
dp = 0;
|
||||
else if (_currentPage == IAQ_PAGE_DEVICES_REV_Yg)
|
||||
dp = 0;
|
||||
else if (_currentPage == IAQ_PAGE_DEVICES2)
|
||||
dp = 1;
|
||||
else if (_currentPage == IAQ_PAGE_DEVICES3)
|
||||
|
@ -1058,6 +1061,15 @@ const char *iaqt_page_name(const unsigned char page)
|
|||
case IAQ_PAGE_HELP:
|
||||
return "Help Page";
|
||||
break;
|
||||
case IAQ_PAGE_SERVICEMODE:
|
||||
return "Service Mode";
|
||||
break;
|
||||
|
||||
// New stuff
|
||||
case IAQ_PAGE_DEVICES_REV_Yg:
|
||||
return "Devices (rev Yg)";
|
||||
break;
|
||||
|
||||
default:
|
||||
sprintf (_namebuf,"** Unknown 0x%02hhx **",page);
|
||||
return _namebuf;
|
||||
|
@ -1136,6 +1148,8 @@ void temp_debugprintExtraInfo(unsigned char *pk, int length)
|
|||
printf(" New Page | Other Devices\n");
|
||||
else if (pk[4] == IAQ_PAGE_DEVICES2)
|
||||
printf(" New Page | Other Devices page 2\n");
|
||||
else if (pk[4] == IAQ_PAGE_DEVICES_REV_Yg)
|
||||
printf(" New Page | Devices Panel REV Yg\n");
|
||||
else if (pk[4] == IAQ_PAGE_SET_TEMP)
|
||||
printf(" New Page | Set Temp\n");
|
||||
else if (pk[4] == IAQ_PAGE_MENU)
|
||||
|
|
|
@ -372,7 +372,8 @@ bool goto_iaqt_page(const unsigned char pageID, struct aqualinkdata *aq_data) {
|
|||
|
||||
if (pageID == IAQ_PAGE_DEVICES) {
|
||||
send_aqt_cmd(KEY_IAQTCH_HOMEP_KEY08);
|
||||
if (waitfor_iaqt_nextPage(aq_data) != IAQ_PAGE_DEVICES) {
|
||||
unsigned char page = waitfor_iaqt_nextPage(aq_data);
|
||||
if (page != IAQ_PAGE_DEVICES && page == IAQ_PAGE_DEVICES_REV_Yg) {
|
||||
LOG(IAQT_LOG, LOG_ERR, "IAQ Touch did not find Device page\n");
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -98,6 +98,14 @@ const char* _getStatus(struct aqualinkdata *aqdata, const char *blankmsg)
|
|||
return programtypeDisplayName(aqdata->active_thread.ptype);
|
||||
}
|
||||
*/
|
||||
|
||||
/*
|
||||
printf("**** Programming=%s, length=%ld, empty=%s, Message=%s \n",
|
||||
aqdata->active_thread.thread_id==0?"no":"yes",
|
||||
strlen(aqdata->last_display_message),
|
||||
rsm_isempy(aqdata->last_display_message,strlen(aqdata->last_display_message))==true?"yes":"no",
|
||||
aqdata->last_display_message);
|
||||
*/
|
||||
if (aqdata->active_thread.thread_id != 0) {
|
||||
if (!aqdata->is_display_message_programming || rsm_isempy(aqdata->last_display_message,strlen(aqdata->last_display_message))){
|
||||
return programtypeDisplayName(aqdata->active_thread.ptype);
|
||||
|
|
|
@ -156,9 +156,9 @@ bool rsm_isempy(const char *src, int length)
|
|||
int i;
|
||||
for(i=0; i < length; i++) {
|
||||
if (src[i] > 32 && src[i] < 127) // 32 is space
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
/*
|
||||
Can probably replace this with rsm_strncasestr in all code.
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
#define SLOG_MAX 80
|
||||
#define PACKET_MAX 800
|
||||
|
||||
#define VERSION "serial_logger V2.5"
|
||||
#define VERSION "serial_logger V2.6"
|
||||
|
||||
/*
|
||||
typedef enum used {
|
||||
|
@ -661,6 +661,13 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
int blankReads = 0;
|
||||
bool returnError = false;
|
||||
|
||||
bool found_swg =false;
|
||||
bool found_vsp =false;
|
||||
bool found_jxi =false;
|
||||
bool found_lx =false;
|
||||
bool found_chem =false;
|
||||
bool found_pent_vsp =false;
|
||||
|
||||
clock_gettime(CLOCK_REALTIME, &start_time);
|
||||
if (timePackets) {
|
||||
clock_gettime(CLOCK_REALTIME, &packet_start_time);
|
||||
|
@ -839,6 +846,20 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
LOG(SLOG_LOG, LOG_NOTICE, "ID 0x%02hhx is %s %s\n", slog[i].ID, (slog[i].inuse == true) ? "in use " : "not used",
|
||||
(slog[i].inuse == false)?canUseExtended(slog[i].ID):getDevice(slog[i].ID));
|
||||
}
|
||||
|
||||
if (slog[i].inuse == true) {
|
||||
if (slog[i].ID >= JANDY_DEC_SWG_MIN && slog[i].ID <= JANDY_DEC_SWG_MAX) {
|
||||
found_swg =true;
|
||||
} else if (slog[i].ID >= JANDY_DEC_PUMP_MIN && slog[i].ID <= JANDY_DEC_PUMP_MAX) {
|
||||
found_vsp =true;
|
||||
} else if (slog[i].ID >= JANDY_DEC_JXI_MIN && slog[i].ID <= JANDY_DEC_JXI_MAX) {
|
||||
found_jxi =true;
|
||||
} else if (slog[i].ID >= JANDY_DEC_LX_MIN && slog[i].ID <= JANDY_DEC_LX_MAX) {
|
||||
found_lx =true;
|
||||
} else if (slog[i].ID >= JANDY_DEC_CHEM_MIN && slog[i].ID <= JANDY_DEC_CHEM_MAX) {
|
||||
found_chem =true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (pent_sindex > 0) {
|
||||
|
@ -848,6 +869,12 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
for (i=0; i < pent_sindex; i++) {
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "ID 0x%02hhx is %s %s\n", pent_slog[i].ID, (pent_slog[i].inuse == true) ? "in use " : "not used",
|
||||
(pent_slog[i].inuse == false)?canUseExtended(pent_slog[i].ID):getPentairDevice(pent_slog[i].ID));
|
||||
|
||||
if (pent_slog[i].inuse == true) {
|
||||
if (pent_slog[i].ID >= PENTAIR_DEC_PUMP_MIN && pent_slog[i].ID <= PENTAIR_DEC_PUMP_MAX) {
|
||||
found_pent_vsp=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "\n\n");
|
||||
|
@ -896,6 +923,19 @@ int _serial_logger(int rs_fd, char *port_name, int logPackets, int logLevel, boo
|
|||
if (extID != 0x00)
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "extended_device_id = 0x%02hhx\n",extID);
|
||||
|
||||
if (found_pent_vsp)
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "read_RS485_vsfPump = yes\n");
|
||||
if (found_vsp)
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "read_RS485_ePump = yes\n");
|
||||
if (found_swg)
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "read_RS485_swg = yes\n");
|
||||
if (found_jxi)
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "read_RS485_JXi = yes\n");
|
||||
if (found_lx)
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "read_RS485_LX = yes\n");
|
||||
if (found_chem)
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "read_RS485_Chem = yes\n");
|
||||
|
||||
LOG(SLOG_LOG, LOG_NOTICE, "-------------------------\n");
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -185,6 +185,12 @@ void set_aqualink_rssadapter_spa_setpoint(char *args, struct aqualinkdata *aqdat
|
|||
*/
|
||||
}
|
||||
|
||||
void DEBUG_GET_STATE(struct aqualinkdata *aq_data, int buttonIndex) {
|
||||
LOG(RSSA_LOG,LOG_DEBUG, "Getting state for index=%d %s\n",buttonIndex,aq_data->aqbuttons[buttonIndex].label);
|
||||
|
||||
rssadapter_device_state( devID(buttonIndex), 0x00 );
|
||||
}
|
||||
|
||||
void get_aqualink_rssadapter_setpoints() {
|
||||
//push_rssa_cmd(getModel);
|
||||
push_rssa_cmd(getUnits);
|
||||
|
@ -299,7 +305,14 @@ bool process_rssadapter_packet(unsigned char *packet, int length, struct aqualin
|
|||
aq_data->spa_htr_set_point = (int) packet[6];
|
||||
rtn = true;
|
||||
} else if (packet[4] == 0x03) {
|
||||
// These are device status messages
|
||||
// These are device status messages
|
||||
/*
|
||||
for(int i=0; i < aq_data->total_buttons; i++) {
|
||||
if ( devID(i) == ) {
|
||||
|
||||
}
|
||||
//aq_data->aqbuttons[i].led->state;
|
||||
}*/
|
||||
#ifdef AQ_RS16
|
||||
if (packet[7] == RS_SA_AUX12) {
|
||||
LOG(RSSA_LOG,LOG_INFO,"AUX12 %d\n", packet[6]);
|
||||
|
@ -316,6 +329,7 @@ bool process_rssadapter_packet(unsigned char *packet, int length, struct aqualin
|
|||
rtn = setLEDstate(aq_data->aqbuttons[16].led, packet[6], aq_data);
|
||||
}
|
||||
#endif
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -661,9 +661,11 @@ void _LOG(logmask_t from, int msg_level, char *message, int message_buffer_size)
|
|||
|
||||
// Sent the log to the UI if configured.
|
||||
if (msg_level <= LOG_ERR && _loq_display_message != NULL) {
|
||||
//printf ("*** Showing error in web **** \n");
|
||||
//snprintf(_loq_display_message, AQ_MSGLONGLEN-2, "%s\n",message);
|
||||
int len = rsm_strncpy(_loq_display_message, (unsigned char*)message, AQ_MSGLONGLEN-1, message_buffer_size);
|
||||
_loq_display_message[len] = '\0';
|
||||
printf ("*** Adding ERROR to buffer '%s' **** \n",_loq_display_message);
|
||||
}
|
||||
|
||||
#ifndef AQ_MANAGER
|
||||
|
|
|
@ -2,4 +2,4 @@
|
|||
|
||||
#define AQUALINKD_NAME "Aqualink Daemon"
|
||||
#define AQUALINKD_SHORT_NAME "AqualinkD"
|
||||
#define AQUALINKD_VERSION "2.3.8 (dev 0.3)"
|
||||
#define AQUALINKD_VERSION "2.3.8 (dev 0.4)"
|
||||
|
|
Loading…
Reference in New Issue