ble_gatt_client
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
uuid.c File Reference

uuid collection of functions More...

#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "bluetooth.h"
#include "uuid.h"

Go to the source code of this file.

Macros

#define BASE_UUID16_OFFSET   2
 
#define BASE_UUID32_OFFSET   0
 

Functions

static void bt_uuid16_to_uuid128 (const bt_uuid_t *src, bt_uuid_t *dst)
 
static void bt_uuid32_to_uuid128 (const bt_uuid_t *src, bt_uuid_t *dst)
 
void bt_uuid_to_uuid128 (const bt_uuid_t *src, bt_uuid_t *dst)
 
static int bt_uuid128_cmp (const bt_uuid_t *u1, const bt_uuid_t *u2)
 
int bt_uuid16_create (bt_uuid_t *btuuid, uint16_t value)
 
int bt_uuid32_create (bt_uuid_t *btuuid, uint32_t value)
 
int bt_uuid128_create (bt_uuid_t *btuuid, uint128_t value)
 
int bt_uuid_cmp (const bt_uuid_t *uuid1, const bt_uuid_t *uuid2)
 
int bt_uuid_to_string (const bt_uuid_t *uuid, char *str, size_t n)
 
static int is_uuid128 (const char *string)
 
static int is_base_uuid128 (const char *string)
 
static int is_uuid32 (const char *string)
 
static int is_uuid16 (const char *string)
 
static int bt_string_to_uuid16 (bt_uuid_t *uuid, const char *string)
 
static int bt_string_to_uuid32 (bt_uuid_t *uuid, const char *string)
 
static int bt_string_to_uuid128 (bt_uuid_t *uuid, const char *string)
 
int bt_string_to_uuid (bt_uuid_t *uuid, const char *string)
 
int bt_uuid_strcmp (const void *a, const void *b)
 
int bt_uuid_to_le (const bt_uuid_t *src, void *dst)
 

Variables

static uint128_t bluetooth_base_uuid
 

Detailed Description

uuid collection of functions

Author
Gilbert Brault

Definition in file uuid.c.

Macro Definition Documentation

#define BASE_UUID16_OFFSET   2

Definition at line 50 of file uuid.c.

Referenced by bt_uuid16_to_uuid128().

#define BASE_UUID32_OFFSET   0

Definition at line 51 of file uuid.c.

Referenced by bt_uuid32_to_uuid128().

Function Documentation

int bt_string_to_uuid ( bt_uuid_t uuid,
const char *  string 
)
static int bt_string_to_uuid128 ( bt_uuid_t uuid,
const char *  string 
)
static

Definition at line 254 of file uuid.c.

References bt_uuid128_create().

Referenced by bt_string_to_uuid().

static int bt_string_to_uuid16 ( bt_uuid_t uuid,
const char *  string 
)
static

Definition at line 226 of file uuid.c.

References bt_uuid16_create().

Referenced by bt_string_to_uuid().

static int bt_string_to_uuid32 ( bt_uuid_t uuid,
const char *  string 
)
static

Definition at line 240 of file uuid.c.

References bt_uuid32_create().

Referenced by bt_string_to_uuid().

static int bt_uuid128_cmp ( const bt_uuid_t u1,
const bt_uuid_t u2 
)
static

Definition at line 103 of file uuid.c.

References bt_uuid_t::u128, and bt_uuid_t::value.

Referenced by bt_uuid_cmp().

int bt_uuid16_create ( bt_uuid_t btuuid,
uint16_t  value 
)
static void bt_uuid16_to_uuid128 ( const bt_uuid_t src,
bt_uuid_t dst 
)
static
int bt_uuid32_create ( bt_uuid_t btuuid,
uint32_t  value 
)

Definition at line 117 of file uuid.c.

References bt_uuid_t::type, bt_uuid_t::u32, and bt_uuid_t::value.

Referenced by bt_string_to_uuid32(), and le_to_uuid().

static void bt_uuid32_to_uuid128 ( const bt_uuid_t src,
bt_uuid_t dst 
)
static
int bt_uuid_strcmp ( const void *  a,
const void *  b 
)

Definition at line 299 of file uuid.c.

int bt_uuid_to_le ( const bt_uuid_t src,
void *  dst 
)
int bt_uuid_to_string ( const bt_uuid_t uuid,
char *  str,
size_t  n 
)
void bt_uuid_to_uuid128 ( const bt_uuid_t src,
bt_uuid_t dst 
)
static int is_base_uuid128 ( const char *  string)
inlinestatic

Definition at line 203 of file uuid.c.

References is_uuid128().

Referenced by bt_string_to_uuid().

static int is_uuid128 ( const char *  string)
inlinestatic

Definition at line 194 of file uuid.c.

Referenced by bt_string_to_uuid(), and is_base_uuid128().

static int is_uuid16 ( const char *  string)
inlinestatic

Definition at line 221 of file uuid.c.

Referenced by bt_string_to_uuid().

static int is_uuid32 ( const char *  string)
inlinestatic

Definition at line 216 of file uuid.c.

Referenced by bt_string_to_uuid().

Variable Documentation

uint128_t bluetooth_base_uuid
static
Initial value:
= {
.data = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00,
0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, 0x34, 0xFB }
}

Definition at line 45 of file uuid.c.

Referenced by bt_uuid16_to_uuid128(), and bt_uuid32_to_uuid128().