src/sync_fsm.h
changeset 690 3ae86b68fdfe
parent 676 aa02f6473007
child 711 d88dea0f5448
     1.1 --- a/src/sync_fsm.h	Fri May 27 11:46:24 2016 +0200
     1.2 +++ b/src/sync_fsm.h	Sun May 29 12:21:50 2016 +0200
     1.3 @@ -23,6 +23,7 @@
     1.4  // states
     1.5  
     1.6  typedef enum _DeviceState_state {
     1.7 +    DeviceState_state_NONE = 0,
     1.8      InitState, 
     1.9      Sole, 
    1.10      HandshakingSole, 
    1.11 @@ -33,6 +34,7 @@
    1.12  // events
    1.13  
    1.14  typedef enum _DeviceState_event {
    1.15 +    DeviceState_event_NONE = 0,
    1.16      Init, 
    1.17      KeyGen, 
    1.18      CannotDecrypt, 
    1.19 @@ -47,13 +49,13 @@
    1.20  
    1.21  // actions
    1.22  
    1.23 -PEP_STATUS sendBeacon(PEP_SESSION session, const Identity partner);
    1.24 -PEP_STATUS sendHandshakeRequest(PEP_SESSION session, const Identity partner);
    1.25 -PEP_STATUS showHandshake(PEP_SESSION session, const Identity partner);
    1.26 -PEP_STATUS reject(PEP_SESSION session, const Identity partner);
    1.27 -PEP_STATUS storeGroupKeys(PEP_SESSION session, const Identity partner);
    1.28 -PEP_STATUS sendOwnKeys(PEP_SESSION session, const Identity partner);
    1.29 -PEP_STATUS transmitGroupKeys(PEP_SESSION session, const Identity partner);
    1.30 +PEP_STATUS sendBeacon(PEP_SESSION session, DeviceState_state state, const Identity partner);
    1.31 +PEP_STATUS sendHandshakeRequest(PEP_SESSION session, DeviceState_state state, const Identity partner);
    1.32 +PEP_STATUS showHandshake(PEP_SESSION session, DeviceState_state state, const Identity partner);
    1.33 +PEP_STATUS reject(PEP_SESSION session, DeviceState_state state, const Identity partner);
    1.34 +PEP_STATUS storeGroupKeys(PEP_SESSION session, DeviceState_state state, const Identity partner);
    1.35 +PEP_STATUS sendOwnKeys(PEP_SESSION session, DeviceState_state state, const Identity partner);
    1.36 +PEP_STATUS transmitGroupKeys(PEP_SESSION session, DeviceState_state state, const Identity partner);
    1.37  
    1.38  // state machine
    1.39  
    1.40 @@ -61,12 +63,18 @@
    1.41          PEP_SESSION session,
    1.42          DeviceState_state state,
    1.43          DeviceState_event event,
    1.44 -        const Identity partner
    1.45 +        const Identity partner,
    1.46 +        DeviceState_state state_partner
    1.47      );
    1.48  
    1.49  // driver
    1.50  
    1.51 -PEP_STATUS fsm_DeviceState_inject(PEP_SESSION session, DeviceState_event event);
    1.52 +PEP_STATUS fsm_DeviceState_inject(
    1.53 +        PEP_SESSION session,
    1.54 +        DeviceState_event event,
    1.55 +        Identity partner,
    1.56 +        DeviceState_state state_partner
    1.57 +    );
    1.58  
    1.59  #ifdef __cplusplus
    1.60  }