High Performance OPC UA Server SDK
1.7.1.383
|
A 16-byte globally unique identifier. More...
#include <guid.h>
Public Member Functions | |
void | ua_guid_init (struct ua_guid *g) |
Initialize an ua_guid as null guid. | |
void | ua_guid_clear (struct ua_guid *g) |
Clear an ua_guid and set it to a null guid. | |
int | ua_guid_create (struct ua_guid *g) |
Write a random guid to g . | |
int | ua_guid_compare (const struct ua_guid *a, const struct ua_guid *b) |
Compare two ua_guids. More... | |
int | ua_guid_copy (struct ua_guid *dst, const struct ua_guid *src) |
Copy ua_guid src to dst . More... | |
int | ua_guid_to_string (const struct ua_guid *src, struct ua_string *dst) |
Converts the given GUID into a UA string. More... | |
int | ua_guid_snprintf (char *dst, size_t size, const struct ua_guid *src) |
Prints the given GUID src into dst . More... | |
int | ua_guid_from_string (struct ua_guid *dst, const struct ua_string *src) |
This function parses a GUID string that was created using ua_guid_to_string. More... | |
Data Fields | |
uint32_t | data1 |
Data1 field. More... | |
uint16_t | data2 |
Data2 field. More... | |
uint16_t | data3 |
Data3 field. More... | |
uint8_t | data4 [8] |
Data4 array. More... | |
Related Functions | |
#define | UA_GUID_INITIALIZER { 0, 0, 0, {0} } |
Initializer for null guids. | |
A 16-byte globally unique identifier.
Its layout is shown in the following table:
Component | Data Type |
---|---|
Data1 | UInt32 |
Data2 | UInt16 |
Data3 | UInt16 |
Data4 | Byte[8] |
Guid values may be represented as a string in this form:
<Data1>-<Data2>-<Data3>-<Data4[0:1]>-<Data4[2:7]>
Where Data1
is 8 characters wide, Data2
and Data3
are 4 characters wide and each Byte in Data4
is 2 characters wide. Each value is formatted as a hexadecimal number padded zeros. A typical Guid value would look like this when formatted as a string:
C496578A-0DFE-4b8f-870A-745238C6AEAE
Compare two ua_guids.
Copy ua_guid src
to dst
.
This function parses a GUID string that was created using ua_guid_to_string.
dst | Guid to fill with information from src . |
src | String to parse. |
int ua_guid_snprintf | ( | char * | dst, |
size_t | size, | ||
const struct ua_guid * | src | ||
) |
Prints the given GUID src
into dst
.
dst
should be at least 37 bytes long to avoid truncation. Format: "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
Converts the given GUID into a UA string.
This function uses ua_guid_snprintf internally.
src | Guid to convert. |
dst | Pointer to UA String to fill. This argument can be a null-string (not a NULL pointer) as this function automatically allocates the required memory internally. Existing strings inside dst will be freed before allocation. |
uint32_t data1 |
Data1 field.
uint16_t data2 |
Data2 field.
uint16_t data3 |
Data3 field.
uint8_t data4[8] |
Data4 array.