Skip to content
Snippets Groups Projects
  1. Sep 19, 2023
    • Mark's avatar
      SyncSM04: implement processMessage function · 21cdb40e
      Mark authored
      After this change, all synchronous state machine functions are
      implemented.
      There are some intentional limiations:
      1. Allow setup states before machine thread started or inside machine
         thread but states can only be setup once before calling #start.
      2. The behavior of transitionTo is defined so that the destination
         state can never change during state transitions. Once a destination
         has been specified, it cannot be changed until the previous state
         transition is complete. In other words, SyncStateMachine does not
         support calling transitionTo in State enter or exit.
      3. Support sendSelfMessage in State#processMessage(), #enter() and
         #exit(). This allow automaton to decide the follow up action by
         itself. For example: if something wrong happens during state
         transition, the implementation can enqueue an error message then
         process the error message after finishing the current state
         transition.
      
      Test: atest SynStateMachineTest
      Change-Id: I0790df4eeab2dccdb9f407d9131a62c3c12d123b
      21cdb40e
  2. Sep 15, 2023
    • Mark's avatar
      SyncSM03: implement state transition logic · 9e572d10
      Mark authored
      Implement performTransitions which does state transitions.
      1. Determine the common ancestor state of current/destination states
      2. Invoke state exit list from current state to common ancestor state.
      3. Invoke state enter list from common ancestor state to destState by
      going through mEnterStateStack.
      
      The state transition is always defined so that the target can never be
      changed mid-way of a state transition. In other words, calling
      transitionTo in State enter and exit is not allowed.
      
      Test: atest SyncStateMachineTest
      Change-Id: I51e8c5440a8b9ac25715c3d030717421f68c15b3
      9e572d10
    • Mark's avatar
      SyncSM02: implement addState function · 1d460b56
      Mark authored
      Duplicated state is not allowed.
      
      Test: atest SynStateMachineTest
      Change-Id: I0d5c73f666f90aebcfbf535cf0f824c5050941a2
      1d460b56
    • Mark's avatar
      SyncSM01: define SyncStateMachine user interface · b48caa22
      Mark authored
      This change adds SyncStateMachine class and provides the user
      interface but doesn't have the details implementation.
      
      Test: m
      Change-Id: Ic2fa69b9e6424601fc2df2d07a052f48a6a46370
      b48caa22
  3. Sep 08, 2023
  4. Sep 07, 2023
  5. Sep 06, 2023
  6. Sep 05, 2023
Loading