summaryrefslogtreecommitdiff
path: root/cesar/bsu/inc/interface.h
blob: 9d49f19d9454bba45f5060fc76dc584608ecf0ed (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
#ifndef bsu_inc_interface_h
#define bsu_inc_interface_h
/* Cesar project {{{
 *
 * Copyright (C) 2010 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    bsu/inc/interface.h
 * \brief   BSU private interface functions.
 * \ingroup bsu
 */

BEGIN_DECLS

/**
 * Send a copy of the beacon to the upper layer.
 * \param  ctx  the module context.
 * \param  beacon  the beacon structure to fill.
 * \param  direction  the reception or transmission.
 * \param  avln  structure to get the beacon.
 */
void
bsu_beacon_send_upper_layer (
    bsu_t *ctx, bsu_beacon_direction_t direction,
    bsu_beacon_t *beacon, bsu_avln_t *avln);

/**
 * Send a beacon over the medium.
 * \param  ctx  the bsu context.
 * \param  beacon_type  the beacon type to send.
 * \param  beacon  the beacon to send.
 * \param  bsu_params  the BSU computed parameters.
 * \param  bto_bpsto  pointer address to access to the bto and bpsto.
 *
 * This function will send the beacon over the medium and to the upper layer
 * (it adds a reference on the beacon before providing it to the upper layer).
 */
void
bsu_beacon_send (bsu_t *ctx, bsu_beacon_type_t beacon_type,
                 pb_beacon_t *beacon, void *bto_bpsto);

/**
 * Receive a beacon from the medium.
 * \param  ctx  the bsu context.
 * \param  beacon  the beacon received.
 * \param  params  the beacon phy rx params received.
 */
void
bsu_beacon_recv (bsu_t *ctx, pb_beacon_t *beacon,
                 pbproc_rx_beacon_params_t *params);

END_DECLS

#endif /* bsu_inc_interface_h */