diff --git a/release/aqualinkd-arm64 b/release/aqualinkd-arm64 index 2a42c13..a77f6bf 100755 Binary files a/release/aqualinkd-arm64 and b/release/aqualinkd-arm64 differ diff --git a/release/aqualinkd-armhf b/release/aqualinkd-armhf index bf9f60b..cd4c1e7 100755 Binary files a/release/aqualinkd-armhf and b/release/aqualinkd-armhf differ diff --git a/source/pda.c b/source/pda.c index 7b05250..a71e84c 100644 --- a/source/pda.c +++ b/source/pda.c @@ -906,6 +906,10 @@ bool process_pda_packet(unsigned char *packet, int length) static bool read_equiptment_menu = false; static int time_msg_cnt = 0; + if (packet[PKT_CMD] != _aqualink_data->last_packet_type) { + LOG(PDA_LOG,LOG_DEBUG, "Received PDA packet type 0x%02hhx\n", packet[PKT_CMD]); + } + _aqualink_data->last_packet_type = packet[PKT_CMD]; process_pda_menu_packet(packet, length, in_programming_mode(_aqualink_data)); diff --git a/source/pda_aq_programmer.c b/source/pda_aq_programmer.c index 4fff9a3..6b72d6f 100644 --- a/source/pda_aq_programmer.c +++ b/source/pda_aq_programmer.c @@ -1297,6 +1297,7 @@ bool waitForPDAMessages(struct aqualinkdata *aqdata, int numberMessages) Use -1 for cur_val if you want this to find the current value and change it. Use number for cur_val to increase / decrease from known start point */ + bool set_PDA_numeric_field_value(struct aqualinkdata *aqdata, int val, int cur_val, char *select_label, int step) { int i=0; @@ -1372,16 +1373,49 @@ void *set_PDA_aqualink_SWG_setpoint(void *ptr) { cleanAndTerminateThread(threadCtrl); return ptr; } + /* // wait for menu to display to capture current value with process_pda_packet_msg_long_SWG - waitForPDAMessageTypes(aqdata,CMD_PDA_HIGHLIGHT,CMD_PDA_HIGHLIGHTCHARS, 10); + waitForPDAMessageTypes(aqdata,CMD_PDA_HIGHLIGHT,CMD_PDA_HIGHLIGHTCHARS, 15); + + // On an PDA-ONLY panel we get the above BEFORE the actual menu is displayed, so wait a bit more, + waitForPDAMessages(aqdata, 2); + */ + /* +Fucking PDA, can't be that same for all version. PDA Line 0 = SET AquaPure PDA Line 1 = PDA Line 2 = PDA Line 3 = SET TO 100% PDA Line 4 = PDA Line 5 = +PDA Line 6 = +PDA Line 7 = Use ARROW KEYS +PDA Line 8 = to set value. +PDA Line 9 = Then SELECT. + +PDA Line 0 = SET AquaPure +PDA Line 1 = +PDA Line 2 = +PDA Line 3 = SET TO 100% +PDA Line 4 = +PDA Line 5 = +PDA Line 6 = +PDA Line 7 = +PDA Line 8 = Use Arrow Keys +PDA Line 9 = to set value. + +PDA Line 0 = Set AQUAPURE +PDA Line 1 = +PDA Line 2 = +PDA Line 3 = Set Pool to: 35% +PDA Line 4 = +PDA Line 5 = +PDA Line 6 = +PDA Line 7 = +PDA Line 8 = Use Arrow Keys +PDA Line 9 = to set value. PDA Line 0 = SET AquaPure PDA Line 1 = @@ -1389,16 +1423,33 @@ PDA Line 2 = PDA Line 3 = SET POOL TO: 45% PDA Line 4 = SET SPA TO: 0% PDA Line 5 = +PDA Line 6 = +PDA Line 7 = +PDA Line 8 = Highlight an +PDA Line 9 = item and press */ - -//if (strncasecmp(pda_m_line(3), "SET TO", 6) == 0) { -if (pda_find_m_index_loose("SET TO") > 0) { - set_PDA_numeric_field_value(aqdata, val, -1, "SET TO", 5); -} else if (aqdata->aqbuttons[SPA_INDEX].led->state != OFF) { - set_PDA_numeric_field_value(aqdata, val, -1, "SET SPA", 5); + + // At the menus above if we just get CMD_PDA_HIGHLIGHT then we need to press enter to set the % + // if it's CMD_PDA_HIGHLIGHT then CMD_PDA_HIGHLIGHTCHARS, we can simply set the % + bool selected=false; + waitForPDAMessageType(aqdata,CMD_PDA_HIGHLIGHT, 15); + if ( waitForPDAMessageType(aqdata,CMD_PDA_HIGHLIGHTCHARS, 2)) { + selected = true; + } + +if (selected) { + LOG(PDA_LOG,LOG_DEBUG, "SWG %% already selected\n"); + set_PDA_numeric_field_value(aqdata, val, -1, NULL, 5); // Null = line already selected } else { + LOG(PDA_LOG,LOG_DEBUG, "Looking for SWG device (pool/spa) to set\n"); + if (pda_find_m_index_loose("SET TO") > 0) { + set_PDA_numeric_field_value(aqdata, val, -1, "SET TO", 5); + } else if (aqdata->aqbuttons[SPA_INDEX].led->state != OFF) { + set_PDA_numeric_field_value(aqdata, val, -1, "SET SPA", 5); + } else { // Dual Setpoint Screen with SPA mode disabled set_PDA_numeric_field_value(aqdata, val, -1, "SET POOL", 5); + } } diff --git a/source/version.h b/source/version.h index 6d2eb7f..a0eb46b 100644 --- a/source/version.h +++ b/source/version.h @@ -4,5 +4,5 @@ #define AQUALINKD_SHORT_NAME "AqualinkD" // Use Magor . Minor . Patch -#define AQUALINKD_VERSION "3.0.3 (dev.3)" +#define AQUALINKD_VERSION "3.0.3 (dev.4)" \ No newline at end of file