src/sync_driver.c
changeset 690 3ae86b68fdfe
parent 627 ef1fdfde8ced
child 743 e4b613ebac2f
     1.1 --- a/src/sync_driver.c	Fri May 27 11:46:24 2016 +0200
     1.2 +++ b/src/sync_driver.c	Sun May 29 12:21:50 2016 +0200
     1.3 @@ -1,17 +1,22 @@
     1.4  // Driver for DeviceState state machine
     1.5  
     1.6  #include <assert.h>
     1.7 -#include "sync_fsm.h"
     1.8 +#include "pEp_internal.h"
     1.9  
    1.10  
    1.11 -PEP_STATUS fsm_DeviceState_inject(PEP_SESSION session, DeviceState_event event)
    1.12 +PEP_STATUS fsm_DeviceState_inject(
    1.13 +        PEP_SESSION session,
    1.14 +        DeviceState_event event,
    1.15 +        Identity partner,
    1.16 +        DeviceState_state state_partner
    1.17 +    )
    1.18  {
    1.19      PEP_STATUS status = PEP_STATUS_OK;
    1.20  
    1.21 -    static DeviceState_state state = InitState;
    1.22 -    static Identity partner = NULL;
    1.23 +    session->sync_state = InitState;
    1.24 +    session->sync_state = fsm_DeviceState(session, session->sync_state,
    1.25 +            event, partner, state_partner);
    1.26  
    1.27 -    state = fsm_DeviceState(session, state, event, partner);
    1.28      return status;
    1.29  }
    1.30