Distributed Publish & Subscribe for IoT
uuid.h
Go to the documentation of this file.
1 
6 /*
7  *******************************************************************
8  *
9  * Copyright 2016 Intel Corporation All rights reserved.
10  *
11  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
12  *
13  * Licensed under the Apache License, Version 2.0 (the "License");
14  * you may not use this file except in compliance with the License.
15  * You may obtain a copy of the License at
16  *
17  * http://www.apache.org/licenses/LICENSE-2.0
18  *
19  * Unless required by applicable law or agreed to in writing, software
20  * distributed under the License is distributed on an "AS IS" BASIS,
21  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
22  * See the License for the specific language governing permissions and
23  * limitations under the License.
24  *
25  *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
26  */
27 
28 #ifndef _DPS_UUID_H
29 #define _DPS_UUID_H
30 
31 #include <stdint.h>
32 #include <dps/err.h>
33 
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
47 typedef struct _DPS_UUID {
49  union {
50  uint8_t val[16];
51  uint32_t val32[4];
52  uint64_t val64[2];
53  };
54 } DPS_UUID;
55 
62 
68 void DPS_GenerateUUID(DPS_UUID* uuid);
69 
79 const char* DPS_UUIDToString(const DPS_UUID* uuid);
80 
92 int DPS_UUIDCompare(const DPS_UUID* a, const DPS_UUID* b);
93 
96 #ifdef __cplusplus
97 }
98 #endif
99 
100 #endif
Type definition for a UUID.
Definition: uuid.h:47
const char * DPS_UUIDToString(const DPS_UUID *uuid)
Return a string representation of a UUID.
DPS_Status DPS_InitUUID(void)
One time initialization.
struct _DPS_UUID DPS_UUID
Type definition for a UUID.
uint64_t val64[2]
The UUID as an array of 64-bit values.
Definition: uuid.h:52
int DPS_Status
The status code type.
Definition: err.h:41
uint8_t val[16]
The UUID as an array of 8-bit values.
Definition: uuid.h:50
Status codes.
int DPS_UUIDCompare(const DPS_UUID *a, const DPS_UUID *b)
Numerical comparison of two UUIDs.
uint32_t val32[4]
The UUID as an array of 32-bit values.
Definition: uuid.h:51
void DPS_GenerateUUID(DPS_UUID *uuid)
Non secure generation of a random UUID.