Skip to content

Commit 7cca421

Browse files
committed
Fix issues with pr249
1 parent 1f8001e commit 7cca421

File tree

4 files changed

+12
-7
lines changed

4 files changed

+12
-7
lines changed

pda.c

+3-1
Original file line numberDiff line numberDiff line change
@@ -684,7 +684,9 @@ void process_pda_packet_msg_long_equiptment_status(const char *msg_line, int lin
684684
}
685685
else if ((_aqualink_data->boost) && ((index = rsm_strncasestr(msg, "REMAIN", AQ_MSGLEN)) != NULL))
686686
{
687-
snprintf(_aqualink_data->boost_msg, sizeof(_aqualink_data->boost_msg), "%s", msg+2);
687+
//snprintf(_aqualink_data->boost_msg, sizeof(_aqualink_data->boost_msg), "%s", msg+2);
688+
//Message is ' 23:21 Remain', we only want time part
689+
snprintf(_aqualink_data->boost_msg, 6, "%s", msg);
688690
}
689691
else if ((index = rsm_strncasestr(msg, MSG_SWG_PCT, AQ_MSGLEN)) != NULL)
690692
{

pda_aq_programmer.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,8 @@ bool goto_pda_menu(struct aqualinkdata *aq_data, pda_menu_type menu) {
447447
if (pda_m_type() == PM_HOME) {
448448
ret = select_pda_menu_item(aq_data, "MENU", true);
449449
} else if (pda_m_type() == PM_MAIN) {
450-
ret = select_pda_menu_item_loose(aq_data, " BOOST", true);
450+
ret = select_pda_menu_item_loose(aq_data, "BOOST", true);
451+
//ret = select_pda_menu_item(aq_data, "BOOST", true);
451452
} else {
452453
send_cmd(KEY_PDA_BACK);
453454
ret = waitForPDAnextMenu(aq_data);

pda_menu.c

+7-5
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
* https://github.com/sfeakes/aqualinkd
1717
*/
1818

19-
19+
#define _GNU_SOURCE 1 // for strcasestr
2020
#include <stdbool.h>
2121
#include <stdio.h>
2222
#include <string.h>
@@ -83,6 +83,7 @@ int pda_find_m_index(char *text)
8383
int i;
8484

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

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

112113
for (i = 0; i < PDA_LINES; i++) {
113-
//printf ("+++ Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
114-
if (strstr(pda_m_line(i), text) != NULL)
114+
//printf ("+++ pda_find_m_index_loose() Compare '%s' to '%s' index %d\n",text,pda_m_line(i),i);
115+
//if (strstr(pda_m_line(i), text) != NULL)
116+
if (strcasestr(pda_m_line(i), text) != NULL)
115117
return i;
116118
}
117119

@@ -180,7 +182,7 @@ pda_menu_type pda_m_type()
180182
} else if (strncasecmp(_menu[0]," LABEL AUX", 12) == 0 && // Will have number ie AUX4
181183
strncasecmp(_menu[2]," CURRENT LABEL ", 16) == 0) {
182184
return PM_AUX_LABEL_DEVICE;
183-
} else if (strstr(_menu[0],"BOOST")) { // This is bad check, but PDA menus are BOOST | BOOST POOL | BOOST SPA, need to do better.
185+
} else if (strcasestr(_menu[0],"BOOST")) { // This is bad check, but PDA menus are BOOST | Boost | BOOST POOL | BOOST SPA, need to do better.
184186
return PM_BOOST;
185187
}
186188
return PM_UNKNOWN;

release/aqualinkd

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)