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
vb@623
     1
// Driver for DeviceState state machine
vb@623
     2
vb@623
     3
#include <assert.h>
vb@690
     4
#include "pEp_internal.h"
vb@623
     5
vb@623
     6
vb@743
     7
DYNAMIC_API PEP_STATUS fsm_DeviceState_inject(
vb@690
     8
        PEP_SESSION session,
vb@690
     9
        DeviceState_event event,
vb@690
    10
        Identity partner,
vb@951
    11
        void *extra
vb@690
    12
    )
vb@623
    13
{
vb@951
    14
    assert(session);
vb@951
    15
    if (!session)
vb@951
    16
        return PEP_ILLEGAL_VALUE;
vb@623
    17
vb@964
    18
    DeviceState_state state = fsm_DeviceState(session,
vb@964
    19
            session->sync_state, event, partner, extra);
vb@964
    20
    if (state == invalid_out_of_memory)
vb@964
    21
        return PEP_OUT_OF_MEMORY;
vb@964
    22
    if (state < 0)
vb@964
    23
        return PEP_SYNC_STATEMACHINE_ERROR - state;
vb@624
    24
vb@964
    25
    session->sync_state = state;
vb@951
    26
    return PEP_STATUS_OK;
vb@623
    27
}
vb@626
    28