]> rtime.felk.cvut.cz Git - frescor/fna.git/blob - src_frescan/frescan_id.h
makefile changes in rtep and frescan for current marte version (1.9_5nov2008)
[frescor/fna.git] / src_frescan / frescan_id.h
1 /*!
2  * @file frescan_id.h
3  *
4  * @brief functions to manage the fields of the FRESCAN Identifier
5  *
6  * @version 0.01
7  *
8  * @date 27-Feb-2008
9  *
10  * @author
11  *      Daniel Sangorrin
12  *
13  * @comments
14  *
15  * This file contains the functions needed to manage the fields of a
16  * FRESCAN identifier. That is, how the 29 CAN ID bits of each frame are
17  * allocated in the FRESCAN protocol. If this configuration was to
18  * be changed (for example, the bits per field or the position  of the
19  * fields inside the ID), then only these functions need to be modified
20  *
21  * @license
22  *
23  * -----------------------------------------------------------------------
24  *  Copyright (C) 2006 - 2008 FRESCOR consortium partners:
25  *
26  *    Universidad de Cantabria,              SPAIN
27  *    University of York,                    UK
28  *    Scuola Superiore Sant'Anna,            ITALY
29  *    Kaiserslautern University,             GERMANY
30  *    Univ. Politécnica  Valencia,           SPAIN
31  *    Czech Technical University in Prague,  CZECH REPUBLIC
32  *    ENEA                                   SWEDEN
33  *    Thales Communication S.A.              FRANCE
34  *    Visual Tools S.A.                      SPAIN
35  *    Rapita Systems Ltd                     UK
36  *    Evidence                               ITALY
37  *
38  *    See http://www.frescor.org for a link to partners' websites
39  *
40  *           FRESCOR project (FP6/2005/IST/5-034026) is funded
41  *        in part by the European Union Sixth Framework Programme
42  *        The European Union is not liable of any use that may be
43  *        made of this code.
44  *
45  *  This file is part of FRESCAN
46  *
47  *  FRESCAN is free software; you can  redistribute it and/or  modify
48  *  it under the terms of  the GNU General Public License as published by
49  *  the Free Software Foundation;  either  version 2, or (at  your option)
50  *  any later version.
51  *
52  *  FRESCAN  is distributed  in  the hope  that  it  will  be useful,  but
53  *  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
54  *  MERCHANTABILITY  or  FITNESS FOR  A  PARTICULAR PURPOSE. See  the  GNU
55  *  General Public License for more details.
56  *
57  *  You should have  received a  copy of  the  GNU  General Public License
58  *  distributed  with  FRESCAN;  see file COPYING.   If not,  write to the
59  *  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
60  *  02111-1307, USA.
61  *
62  * As a special exception, including FRESCAN header files in a file,
63  * instantiating FRESCAN generics or templates, or linking other files
64  * with FRESCAN objects to produce an executable application, does not
65  * by itself cause the resulting executable application to be covered
66  * by the GNU General Public License. This exception does not
67  * however invalidate any other reasons why the executable file might be
68  * covered by the GNU Public License.
69  * -----------------------------------------------------------------------
70  *
71  */
72
73 #ifndef _MARTE_FRESCAN_ID_H_
74 #define _MARTE_FRESCAN_ID_H_
75
76 #include <stdint.h>  // uint32_t
77
78 /**
79  *        8          4      4     4          8               1     bytes
80  * +----------------------------------------------------------------+
81  * |     prio     | dest | src | chan |     frag_id     | frag_flag |
82  * +----------------------------------------------------------------+
83  *
84  */
85
86 #define FRESCAN_FIELD_PRIO      0
87 #define FRESCAN_FIELD_DEST      1
88 #define FRESCAN_FIELD_SRC       2
89 #define FRESCAN_FIELD_CHAN      3
90 #define FRESCAN_FIELD_FRAG_ID   4
91 #define FRESCAN_FIELD_FRAG_FLAG 5
92
93 extern void frescan_id_set_field(uint32_t *id, uint32_t field, uint32_t value);
94
95 extern uint32_t frescan_id_get_field(uint32_t id, uint32_t field);
96
97 #endif // _MARTE_FRESCAN_ID_H_