Simulator update

pull/11/head
shaun feakes 2018-07-29 11:32:31 -05:00
parent 52fc4fb0c7
commit 4c917bbc72
4 changed files with 13 additions and 1 deletions

View File

@ -74,6 +74,10 @@ bool push_aq_cmd(unsigned char cmd) {
return true;
}
int get_aq_cmd_length()
{
return _stack_place;
}
unsigned char pop_aq_cmd(struct aqualinkdata *aq_data)
{
unsigned char cmd = NUL;

View File

@ -52,4 +52,6 @@ unsigned char pop_aq_cmd(struct aqualinkdata *aq_data);
//void *set_aqualink_time( void *ptr );
//void *get_aqualink_pool_spa_heater_temps( void *ptr );
int get_aq_cmd_length();
#endif

View File

@ -797,12 +797,18 @@ void main_loop() {
if (getLogLevel() >= LOG_DEBUG)
logMessage(LOG_DEBUG, "RS received packet of type %s length %d\n", get_packet_type(packet_buffer, packet_length), packet_length);
send_ack(rs_fd, pop_aq_cmd(&_aqualink_data));
// **** NSF (Taken out while playing with Panel Simulator, put back in. ************)
//send_ack(rs_fd, pop_aq_cmd(&_aqualink_data));
// Process the packet. This includes deriving general status, and identifying
// warnings and errors. If something changed, notify any listeners
if (process_packet(packet_buffer, packet_length) != false) {
broadcast_aqualinkstate(mgr.active_connections);
}
//if (! _aqualink_data.simulate_panel || stristr(_aqualink_data.last_display_message, "SELECT") == NULL || get_aq_cmd_length() > 0)
send_ack(rs_fd, pop_aq_cmd(&_aqualink_data));
} else if (packet_length > 0) {
// printf("packet not for us %02x\n",packet_buffer[PKT_DEST]);
if (packet_buffer[PKT_DEST] == DEV_MASTER && interestedInNextAck == true) {

Binary file not shown.