src/sync_driver.c
author Volker Birk <vb@pep.foundation>
Tue, 02 Aug 2016 12:06:45 +0200
branchkeysync
changeset 964 ef02296c41ca
parent 951 dec407deb10e
child 1043 f786ee22e281
permissions -rw-r--r--
store group keys
     1 // Driver for DeviceState state machine
     2 
     3 #include <assert.h>
     4 #include "pEp_internal.h"
     5 
     6 
     7 DYNAMIC_API PEP_STATUS fsm_DeviceState_inject(
     8         PEP_SESSION session,
     9         DeviceState_event event,
    10         Identity partner,
    11         void *extra
    12     )
    13 {
    14     assert(session);
    15     if (!session)
    16         return PEP_ILLEGAL_VALUE;
    17 
    18     DeviceState_state state = fsm_DeviceState(session,
    19             session->sync_state, event, partner, extra);
    20     if (state == invalid_out_of_memory)
    21         return PEP_OUT_OF_MEMORY;
    22     if (state < 0)
    23         return PEP_SYNC_STATEMACHINE_ERROR - state;
    24 
    25     session->sync_state = state;
    26     return PEP_STATUS_OK;
    27 }
    28