Add packet handling for setting machine state