Commit | Line | Data |
---|---|---|
cd9434cc T |
1 | /* |
2 | * Copyright (c) 2013-2015 TRUSTONIC LIMITED | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions are met: | |
7 | * | |
8 | * 1. Redistributions of source code must retain the above copyright notice, | |
9 | * this list of conditions and the following disclaimer. | |
10 | * | |
11 | * 2. Redistributions in binary form must reproduce the above copyright | |
12 | * notice, this list of conditions and the following disclaimer in the | |
13 | * documentation and/or other materials provided with the distribution. | |
14 | * | |
15 | * 3. Neither the name of the TRUSTONIC LIMITED nor the names of its | |
16 | * contributors may be used to endorse or promote products derived from | |
17 | * this software without specific prior written permission. | |
18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | |
20 | * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED | |
21 | * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
22 | * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR | |
23 | * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | |
24 | * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | |
25 | * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; | |
26 | * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, | |
27 | * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR | |
28 | * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF | |
29 | * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | |
31 | ||
32 | #ifndef MC_UUID_H_ | |
33 | #define MC_UUID_H_ | |
34 | ||
35 | #ifdef WIN32 | |
36 | #define _UNUSED | |
37 | #else | |
38 | #define _UNUSED __attribute__((unused)) | |
39 | #endif | |
40 | ||
41 | #define UUID_TYPE | |
42 | ||
43 | #define UUID_LENGTH 16 | |
44 | /** Universally Unique Identifier (UUID) according to ISO/IEC 11578. */ | |
45 | typedef struct { | |
46 | uint8_t value[UUID_LENGTH]; /**< Value of the UUID. */ | |
47 | } mcUuid_t, *mcUuid_ptr; | |
48 | ||
49 | /** UUID value used as free marker in service provider containers. */ | |
50 | #define MC_UUID_FREE_DEFINE \ | |
51 | { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ | |
52 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF } | |
53 | ||
54 | static _UNUSED const mcUuid_t MC_UUID_FREE = { | |
55 | MC_UUID_FREE_DEFINE | |
56 | }; | |
57 | ||
58 | /** Reserved UUID. */ | |
59 | #define MC_UUID_RESERVED_DEFINE \ | |
60 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | |
61 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } | |
62 | ||
63 | static _UNUSED const mcUuid_t MC_UUID_RESERVED = { | |
64 | MC_UUID_RESERVED_DEFINE | |
65 | }; | |
66 | ||
67 | /** UUID for system applications. */ | |
68 | #define MC_UUID_SYSTEM_DEFINE \ | |
69 | { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, \ | |
70 | 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFE } | |
71 | ||
72 | static _UNUSED const mcUuid_t MC_UUID_SYSTEM = { | |
73 | MC_UUID_SYSTEM_DEFINE | |
74 | }; | |
75 | ||
76 | #define MC_UUID_RTM_DEFINE \ | |
77 | { 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, \ | |
78 | 0x12, 0x34, 0x12, 0x34, 0x12, 0x34, 0x12, 0x34 } | |
79 | ||
80 | static _UNUSED const mcUuid_t MC_UUID_RTM = { | |
81 | MC_UUID_RTM_DEFINE | |
82 | }; | |
83 | ||
84 | /** | |
85 | * TODO: Replace with v5 UUID (milestone #3) | |
86 | */ | |
87 | #define LTA_UUID_DEFINE \ | |
88 | { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, \ | |
89 | 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11} | |
90 | ||
91 | #endif // MC_UUID_H_ | |
92 |