From 8657b39b8f2d2f0b94dca8601c07ddcde46499c7 Mon Sep 17 00:00:00 2001 From: Lee Ballard Date: Thu, 22 Aug 2019 22:07:53 -0500 Subject: [PATCH] ballle98/AqualinkD#39: add support for status menus --- pda_aq_programmer.c | 7 ++++++- pda_menu.c | 10 +++++++++- pda_menu.h | 5 ++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/pda_aq_programmer.c b/pda_aq_programmer.c index a73eabe0..b71b1d1a 100644 --- a/pda_aq_programmer.c +++ b/pda_aq_programmer.c @@ -123,6 +123,9 @@ bool wait_pda_selected_item(struct aqualinkdata *aq_data) } bool waitForPDAnextMenu(struct aqualinkdata *aq_data) { + pda_menu_type menu; + + logMessage(LOG_DEBUG, "waitForPDAnextMenu\n"); if (!waitForPDAMessageTypes(aq_data,CMD_PDA_CLEAR,CMD_STATUS,2,0)) { logMessage(LOG_ERR, "waitForPDAnextMenu - no CLEAR or STATUS\n"); return false; @@ -140,7 +143,9 @@ bool waitForPDAnextMenu(struct aqualinkdata *aq_data) { // The FW version and status menus do not have highlight logMessage(LOG_NOTICE, "waitForPDAnextMenu - received STATUS instead of HIGHLIGHT\n"); } else if ((aq_data->last_packet_type == CMD_PDA_HIGHLIGHTCHARS) && - (pda_m_type() == PM_EQUIPTMENT_CONTROL)) { + (((menu = pda_m_type()) == PM_EQUIPTMENT_CONTROL) || + (menu == PM_HOME) || (menu == PM_BUILDING_HOME))) { + // Flashing state for filter pump and spa mode is done with HIGHLIGHTCHARS if (! waitForPDAMessageTypes(aq_data,CMD_PDA_HIGHLIGHT,CMD_STATUS,2,0)) { logMessage(LOG_ERR, "waitForPDAnextMenu - EQUIPTMENT_CONTROL no HIGHLIGHT or STATUS\n"); return false; diff --git a/pda_menu.c b/pda_menu.c index 522a769d..76ab7d73 100644 --- a/pda_menu.c +++ b/pda_menu.c @@ -148,7 +148,15 @@ pda_menu_type pda_m_type() } else if (strncasecmp(_menu[0]," LABEL AUX", 12) == 0 && // Will have number ie AUX4 strncasecmp(_menu[2]," CURRENT LABEL ", 16) == 0) { return PM_AUX_LABEL_DEVICE; - } + } else if (strncasecmp(_menu[5]," TURN ON ", 16) == 0 && + strncasecmp(_menu[6]," AFTER DELAY ", 16) == 0) { + return PM_TURN_ON_AFTER_DELAY; + } else if (strncasecmp(_menu[3]," SERVICE MODE ", 16) == 0) { + return PM_SERVICE_MODE; + } else if (strncasecmp(_menu[5]," must be set ", 16) == 0 && + strncasecmp(_menu[6]," higher than ", 16) == 0) { + return PM_MUST_BE_SET_HIGHER_THAN; + } return PM_UNKNOWN; } diff --git a/pda_menu.h b/pda_menu.h index 311ee5cb..77b72f7d 100644 --- a/pda_menu.h +++ b/pda_menu.h @@ -28,7 +28,10 @@ typedef enum pda_menu_type { PM_SETTINGS, PM_EQUIPTMENT_CONTROL, PM_EQUIPTMENT_STATUS, - PM_PALM_OPTIONS // This seems to be only older revisions + PM_PALM_OPTIONS, // This seems to be only older revisions + PM_TURN_ON_AFTER_DELAY, + PM_SERVICE_MODE, + PM_MUST_BE_SET_HIGHER_THAN } pda_menu_type; // PDA Line 4 = POOL MODE OFF