Finished the finite transition machine

AP and TD can transmit, recv and transit to proper state under the new
framework