Skip to content

Commit

Permalink
Fix issues with pr249
Browse files Browse the repository at this point in the history
  • Loading branch information
sfeakes committed Mar 30, 2024
1 parent 1f8001e commit 7cca421
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
4 changes: 3 additions & 1 deletion pda.c
Original file line number Diff line number Diff line change
Expand Up @@ -684,7 +684,9 @@ void process_pda_packet_msg_long_equiptment_status(const char *msg_line, int lin
}
else if ((_aqualink_data->boost) && ((index = rsm_strncasestr(msg, "REMAIN", AQ_MSGLEN)) != NULL))
{
snprintf(_aqualink_data->boost_msg, sizeof(_aqualink_data->boost_msg), "%s", msg+2);
//snprintf(_aqualink_data->boost_msg, sizeof(_aqualink_data->boost_msg), "%s", msg+2);
//Message is ' 23:21 Remain', we only want time part
snprintf(_aqualink_data->boost_msg, 6, "%s", msg);
}
else if ((index = rsm_strncasestr(msg, MSG_SWG_PCT, AQ_MSGLEN)) != NULL)
{
Expand Down
3 changes: 2 additions & 1 deletion pda_aq_programmer.c
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,8 @@ bool goto_pda_menu(struct aqualinkdata *aq_data, pda_menu_type menu) {
if (pda_m_type() == PM_HOME) {
ret = select_pda_menu_item(aq_data, "MENU", true);
} else if (pda_m_type() == PM_MAIN) {
ret = select_pda_menu_item_loose(aq_data, " BOOST", true);
ret = select_pda_menu_item_loose(aq_data, "BOOST", true);
//ret = select_pda_menu_item(aq_data, "BOOST", true);
} else {
send_cmd(KEY_PDA_BACK);
ret = waitForPDAnextMenu(aq_data);
Expand Down
12 changes: 7 additions & 5 deletions pda_menu.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* https://github.com/sfeakes/aqualinkd
*/


#define _GNU_SOURCE 1 // for strcasestr
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
Expand Down Expand Up @@ -83,6 +83,7 @@ int pda_find_m_index(char *text)
int i;

for (i = 0; i < PDA_LINES; i++) {
//printf ("+++ pda_find_m_index() Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
if (strncmp(pda_m_line(i), text, strlen(text)) == 0)
return i;
}
Expand All @@ -96,7 +97,7 @@ int pda_find_m_index_case(char *text, int limit)
int i;

for (i = 0; i < PDA_LINES; i++) {
//printf ("+++ Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
//printf ("+++ pda_find_m_index_case() Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
if (strncasecmp(pda_m_line(i), text, limit) == 0)
return i;
}
Expand All @@ -110,8 +111,9 @@ int pda_find_m_index_loose(char *text)
int i;

for (i = 0; i < PDA_LINES; i++) {
//printf ("+++ Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
if (strstr(pda_m_line(i), text) != NULL)
//printf ("+++ pda_find_m_index_loose() Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
//if (strstr(pda_m_line(i), text) != NULL)
if (strcasestr(pda_m_line(i), text) != NULL)
return i;
}

Expand Down Expand Up @@ -180,7 +182,7 @@ 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 (strstr(_menu[0],"BOOST")) { // This is bad check, but PDA menus are BOOST | BOOST POOL | BOOST SPA, need to do better.
} else if (strcasestr(_menu[0],"BOOST")) { // This is bad check, but PDA menus are BOOST | Boost | BOOST POOL | BOOST SPA, need to do better.
return PM_BOOST;
}
return PM_UNKNOWN;
Expand Down
Binary file modified release/aqualinkd
Binary file not shown.

0 comments on commit 7cca421

Please sign in to comment.