mirror of https://github.com/sfeakes/AqualinkD.git
PDA update
parent
c2ba23121e
commit
6a80d7b2ca
12
aqualinkd.c
12
aqualinkd.c
|
@ -653,7 +653,17 @@ bool process_pda_packet(unsigned char* packet, int length)
|
|||
}else if (stristr(msg, "SPA HEATER") != NULL) {
|
||||
set_pda_led(_aqualink_data.aqbuttons[10].led, msg[AQ_MSGLEN-1]);
|
||||
}
|
||||
}
|
||||
} else if (pda_m_type() == PM_UNKNOWN) {
|
||||
// Lets make a guess here and just see if there is an ON/OFF/ENA/*** at the end of the line
|
||||
if ( msg[AQ_MSGLEN-1] == 'N' || msg[AQ_MSGLEN-1] == 'F' || msg[AQ_MSGLEN-1] == 'A' || msg[AQ_MSGLEN-1] == '*') {
|
||||
for (i = 0; i < TOTAL_BUTTONS; i++) {
|
||||
if (stristr(msg, _aqualink_data.aqbuttons[i].pda_label) != NULL) {
|
||||
//printf("*** Found Status for %s = '%.*s'\n",_aqualink_data.aqbuttons[i].pda_label, AQ_MSGLEN, msg);
|
||||
set_pda_led(_aqualink_data.aqbuttons[i].led, msg[AQ_MSGLEN-1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
// If we haven't initilixed and we are on line 4, then initilize
|
||||
if (! init && pda_m_hlightindex() == 4) {
|
||||
//printf("** INITILIZE ADD LINE BACK\n");
|
||||
|
|
|
@ -35,7 +35,8 @@ char *pda_m_line(int index)
|
|||
if (index >= 0 && index < PDA_LINES)
|
||||
return _menu[index];
|
||||
else
|
||||
return NULL;
|
||||
return "-"; // Just return something bad so I can use string comparison with no null check
|
||||
// return NULL;
|
||||
}
|
||||
|
||||
pda_menu_type pda_m_type()
|
||||
|
@ -48,7 +49,8 @@ pda_menu_type pda_m_type()
|
|||
return PM_EQUIPTMENT_CONTROL;
|
||||
else if (strncmp(_menu[0]," MAIN MENU ", 16) == 0)
|
||||
return PM_SETTINGS;
|
||||
else if ((_menu[0] == '\0' && _hlightindex == -1) || strncmp(_menu[4], "POOL MODE", 9) == 0 )// IF we are building the main menu this may be valid
|
||||
//else if ((_menu[0] == '\0' && _hlightindex == -1) || strncmp(_menu[4], "POOL MODE", 9) == 0 )// IF we are building the main menu this may be valid
|
||||
else if (strncmp(_menu[4], "POOL MODE", 9) == 0 )
|
||||
return PM_BUILDING_MAIN;
|
||||
|
||||
return PM_UNKNOWN;
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue