summaryrefslogtreecommitdiff
path: root/cesar/cp2/conn/src/link.c
blob: 1c9292637cb7382e07f9aeb34a8b22208881b31f (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
/* Cesar project {{{
 *
 * Copyright (C) 2008 Spidcom
 *
 * <<<Licence>>>
 *
 * }}} */
/**
 * \file    link.c
 * \brief   link management
 * \ingroup cp2/conn
 *
 * « long description »
 */
#include "common/std.h"
#include "cp2/cp.h"
#include "cp2/inc/context.h"
#include "cp2/conn/conn.h"
#include "cp2/conn/link.h"
#include "lib/blk.h"
/**
 * init a link
 * \param  table_ble  ble elements
 * \param  nb_ble  number of element in this table
 * \return  the link initialised
 *
 * init the memory
 * fill the elements concerning the link
 */
cp_link_t*
cp_link_init (cp_link_ble_interval_t *table_ble, u16 nb_ble)
{
    cp_link_t *link;
    blk_t *tmp_blk, *last_blk;

    int i;

    link = blk_alloc();
    link->cinfo = blk_alloc();

    link->ble = blk_alloc_desc_range(10, &last_blk);
    blk_print_memory();

    tmp_blk = link->ble;

    for(i=0;i<nb_ble;i++)
    {
        (cp_link_ble_interval_t*)tmp_blk->data = &table_ble[i];
        tmp_blk = tmp_blk->next;
    }
    
    return link;
}



/**
 * del a connection regarding to its CID.
 * \param  ctx  conn context.
 * \param  lid  Connection identifier
 *
 */
void
cp_link_uninit (cp_link_t *link)
{
}