summaryrefslogtreecommitdiff
path: root/mac/sar/test/src/sar_unit_test_functions.c
blob: 085c267cec8ee5d49ae5ea39e22d8a60379f75b5 (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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/* Cesar project {{{
 *
 * Copyright (C) 2007 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    sar_unit_test_functions.c
 * \brief   function for the unit tests.
 * \ingroup mac/sar/src
 *
 */
#include "common/std.h"
#include "mac/sar/test/inc/sar_unit_test_functions.h"

/** TODO REMOVE THIS FUNCTIONS **/

static sar_pbproc_t pbproc_global;

/**
 * Initialise pbproc and return its context.
 * \param  config  global mac configuration
 * \param  store  MFS and STA store
 * \param  user_data  user data passed to any callback
 * \param  rx_cb  MPDU RX callback
 * \return  pbproc context
 */
pbproc_t *
pbproc_init (mac_config_t *config, mac_store_t *store)
{
    pbproc_global.cpt_expiration = 0;
    return (pbproc_t *) &pbproc_global;
}

void
pbproc_init_cb (pbproc_t *ctx, void *user_data, pbproc_rx_cb_t rx_cb,
        pbproc_rx_beacon_cb_t rx_beacon_cb)
{
    
}

void
pbproc_uninit(pbproc_t *ctx)
{
    
}

/**
 * Give segments back to pbproc for reception.
 * \param  ctx  pbproc context
 * \param  first  first segment
 * \param  last  last segment
 * \param  nb  number of segment
 */
void pbproc_rx_segment_refill (pbproc_t *ctx, pb_t *first, pb_t *last, uint nb)
{
    pb_t *pb_curr;
    while (first != last)
    {
        pb_curr = first;
        first = first->next;
        blk_release_desc ((blk_t *)pb_curr);
    }
    
    blk_release_desc ((blk_t *) first);
}


/**
* Unregister an MFS from the Channel Access, so that it can no longer be
* sent.
* \param  ctx  ca context
* \param  mfs  the MFS to remove
* \return  true if successful
*
* If unsuccessful, the caller should try later because the MFS is currently
* been used for a transmission.
*/
bool
ca_mfs_remove (ca_t *ctx, mfs_tx_t *mfs)
{
    return true;
}

/**
* Register an MFS with the Channel Access, so it can be sent.
* \param  ctx  ca context
* \param  mfs  the MFS to add
*/
void
ca_mfs_add (ca_t *ctx, mfs_tx_t *mfs)
{
}

void
ca_mfs_update (ca_t *ctx, mfs_tx_t *mfs)
{
    
}