summaryrefslogtreecommitdiff
path: root/cesar/ce/rx/bitloading/test/inc/scenario_defs.h
blob: 37f292b4f84a0277117c15fc46255609b50b70fb (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
#ifndef ce_rx_bitloading_test_inc_scenario_defs_h
#define ce_rx_bitloading_test_inc_scenario_defs_h
/* Cesar project {{{
 *
 * Copyright (C) 2010 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    ce/rx/bitloading/test/inc/scenario_defs.h
 * \brief   Scenario definition.
 * \ingroup test
 */

#include "ce/rx/rx.h"
#include "mac/common/sta.h"
#include "ce/rx/bitloading/fsm/event.h"
#include "ce_rx_bl_fsm_defs.h"

/* Scenario globals. */
#define SCENARIO_DEFS_GLOBALS \
    ce_rx_t *ce; \

/* Scenario actions. */
#define SCENARIO_DEFS_ACTIONS \
    IDLE__channel_data_received, \
    INITIAL__channel_data_received, \
    TODO

/* Actions with default parameters. */
#define __action(action) \
typedef struct \
{ \
    sta_t *sta; \
    ce_rx_bitloading_fsm_event_param_t data; \
    ce_rx_bl_fsm_branch_t branch; \
} scenario_action_ ## action ## _t; \
\
void \
scenario_action_ ## action ## _cb ( \
                                    scenario_globals_t *globals, \
                                    scenario_params_t *params);

__action (IDLE__channel_data_received)
__action (INITIAL__channel_data_received)
__action (TODO)

#undef __action

/* Scenario events. */
#define SCENARIO_DEFS_EVENTS \
    ce_rx_bl_nsr_sum_init, \
    ce_rx_bl_nsr_sum_add, \
    ce_rx_bl_nsr_compute_mean, \
    ce_rx_bl_start_bl

/* An event. */
#define __event(event, param...) \
typedef struct \
{ \
        PREPROC_FOR_EACH (__p_, ## param) \
} scenario_event_ ## event ## _t;

#define __p_(param) param;

__event (ce_rx_bl_nsr_sum_init);
__event (ce_rx_bl_nsr_sum_add);
__event (ce_rx_bl_nsr_compute_mean);
__event (ce_rx_bl_start_bl);

#undef __event
#undef __p_

#endif /* ce_rx_bitloading_test_inc_scenario_defs_h */