Fix issues with pr249

pull/100/merge v2.3.2
sfeakes 2024-03-30 15:33:37 -05:00
parent 1f8001e939
commit 7cca4215aa
4 changed files with 12 additions and 7 deletions

4
pda.c
View File

@ -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)
{

View File

@ -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);

View File

@ -16,7 +16,7 @@
* https://github.com/sfeakes/aqualinkd
*/
#define _GNU_SOURCE 1 // for strcasestr
#include <stdbool.h>
#include <stdio.h>
#include <string.h>
@ -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;
}
@ -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;
}
@ -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;
}
@ -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;

Binary file not shown.