turnout.pending = state;
turnout.active = true;
+ turnout.off_timeout = Time::TimeStamp();
turnout_command(addr, state, true);
}
read_all(data, 2);
unsigned addr = data[0]+((data[1]&7)<<8);
- signal_turnout.emit(addr, (data[1]&0x80)!=0);
+ Turnout &turnout = turnouts[addr];
+ turnout.state = (data[1]&0x80)!=0;
+ turnout.pending = turnout.state;
+ signal_turnout.emit(addr, turnout.state);
}
}
else if(cmd==CMD_EVENT_SENSOR)
if(state!=turnout.state)
{
turnout.state = state;
+ turnout.pending = state;
signal_turnout.emit(addr, turnout.state);
}
}
Intellibox::Turnout::Turnout():
state(false),
- active(false)
+ active(false),
+ pending(false)
{ }