summaryrefslogtreecommitdiff
path: root/cesar/cp2/fsm/test/utest/src/actions.c
blob: 93f65fded736556afa476ff89cb44f7c7cbfbd98 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    src/actions.c
 * \brief   Scenario actions.
 * \ingroup test
 */
#include "common/std.h"

#include "lib/scenario/scenario.h"

void
scenario_action_post_and_process_cb (scenario_globals_t *globals,
                                     scenario_params_t *params)
{
    scenario_action_post_and_process_t *p = &params->action_post_and_process;
    cp_fsm_event_t *event;
    if (p->mme)
        event = cp_fsm_event_mme_new (globals->cp, p->type, p->mme);
    else if (p->beacon)
        event = cp_fsm_event_beacon_new (globals->cp, p->type, p->beacon,
                                         p->net, p->sta);
    else
        event = cp_fsm_event_bare_new (globals->cp, p->type);
    cp_fsm_post (globals->cp, event);
    cp_fsm_process (globals->cp);
}