Universal Unique Identifiers (UUIDs)

API Reference

group bt_uuid

UUIDs.

Defines

BT_UUID_SIZE_16

Size in octets of a 16-bit UUID

BT_UUID_SIZE_32

Size in octets of a 32-bit UUID

BT_UUID_SIZE_128

Size in octets of a 128-bit UUID

BT_UUID_INIT_16(value)

Initialize a 16-bit UUID.

Parameters
  • value: 16-bit UUID value in host endianness.

BT_UUID_INIT_32(value)

Initialize a 32-bit UUID.

Parameters
  • value: 32-bit UUID value in host endianness.

BT_UUID_INIT_128(value…)

Initialize a 128-bit UUID.

Parameters
  • value: 128-bit UUID array values in little-endian format. Can be combined with BT_UUID_128_ENCODE to initialize a UUID from the readable form of UUIDs.

BT_UUID_DECLARE_16(value)

Helper to declare a 16-bit UUID inline.

Return

Pointer to a generic UUID.

Parameters
  • value: 16-bit UUID value in host endianness.

BT_UUID_DECLARE_32(value)

Helper to declare a 32-bit UUID inline.

Return

Pointer to a generic UUID.

Parameters
  • value: 32-bit UUID value in host endianness.

BT_UUID_DECLARE_128(value…)

Helper to declare a 128-bit UUID inline.

Return

Pointer to a generic UUID.

Parameters
  • value: 128-bit UUID array values in little-endian format. Can be combined with BT_UUID_128_ENCODE to declare a UUID from the readable form of UUIDs.

BT_UUID_16(__u)

Helper macro to access the 16-bit UUID from a generic UUID.

BT_UUID_32(__u)

Helper macro to access the 32-bit UUID from a generic UUID.

BT_UUID_128(__u)

Helper macro to access the 128-bit UUID from a generic UUID.

BT_UUID_128_ENCODE(w32, w1, w2, w3, w48)

Encode 128 bit UUID into array values in little-endian format.

Helper macro to initialize a 128-bit UUID array value from the readable form of UUIDs, or encode 128-bit UUID values into advertising data Can be combined with BT_UUID_DECLARE_128 to declare a 128-bit UUID.

Example of how to declare the UUID 6E400001-B5A3-F393-E0A9-E50E24DCCA9E

BT_UUID_DECLARE_128(
     BT_UUID_128_ENCODE(0x6E400001, 0xB5A3, 0xF393, 0xE0A9, 0xE50E24DCCA9E))

Example of how to encode the UUID 6E400001-B5A3-F393-E0A9-E50E24DCCA9E into advertising data.

BT_DATA_BYTES(BT_DATA_UUID128_ALL,
     BT_UUID_128_ENCODE(0x6E400001, 0xB5A3, 0xF393, 0xE0A9, 0xE50E24DCCA9E))

Just replace the hyphen by the comma and add 0x prefixes.

Return

The comma separated values for UUID 128 initializer that may be used directly as an argument for BT_UUID_INIT_128 or BT_UUID_DECLARE_128

Parameters
  • w32: First part of the UUID (32 bits)

  • w1: Second part of the UUID (16 bits)

  • w2: Third part of the UUID (16 bits)

  • w3: Fourth part of the UUID (16 bits)

  • w48: Fifth part of the UUID (48 bits)

BT_UUID_16_ENCODE(w16)

Encode 16-bit UUID into array values in little-endian format.

Helper macro to encode 16-bit UUID values into advertising data.

Example of how to encode the UUID 0x180a into advertising data.

BT_DATA_BYTES(BT_DATA_UUID16_ALL, BT_UUID_16_ENCODE(0x180a))

Return

The comma separated values for UUID 16 value that may be used directly as an argument for BT_DATA_BYTES.

Parameters
  • w16: UUID value (16-bits)

BT_UUID_32_ENCODE(w32)

Encode 32-bit UUID into array values in little-endian format.

Helper macro to encode 32-bit UUID values into advertising data.

Example of how to encode the UUID 0x180a01af into advertising data.

BT_DATA_BYTES(BT_DATA_UUID32_ALL, BT_UUID_32_ENCODE(0x180a01af))

Return

The comma separated values for UUID 32 value that may be used directly as an argument for BT_DATA_BYTES.

Parameters
  • w32: UUID value (32-bits)

BT_UUID_STR_LEN

Recommended length of user string buffer for Bluetooth UUID.

The recommended length guarantee the output of UUID conversion will not lose valuable information about the UUID being processed. If the length of the UUID is known the string can be shorter.

BT_UUID_GAP_VAL

Generic Access UUID value.

BT_UUID_GAP

Generic Access.

BT_UUID_GATT_VAL

Generic attribute UUID value.

BT_UUID_GATT

Generic Attribute.

BT_UUID_CTS_VAL

Current Time Service UUID value.

BT_UUID_CTS

Current Time Service.

BT_UUID_HTS_VAL

Health Thermometer Service UUID value.

BT_UUID_HTS

Health Thermometer Service.

BT_UUID_DIS_VAL

Device Information Service UUID value.

BT_UUID_DIS

Device Information Service.

BT_UUID_HRS_VAL

Heart Rate Service UUID value.

BT_UUID_HRS

Heart Rate Service.

BT_UUID_BAS_VAL

Battery Service UUID value.

BT_UUID_BAS

Battery Service.

BT_UUID_HIDS_VAL

HID Service UUID value.

BT_UUID_HIDS

HID Service.

BT_UUID_CSC_VAL

Cycling Speed and Cadence Service UUID value.

BT_UUID_CSC

Cycling Speed and Cadence Service.

BT_UUID_ESS_VAL

Environmental Sensing Service UUID value.

BT_UUID_ESS

Environmental Sensing Service.

BT_UUID_BMS_VAL

Bond Management Service UUID value.

BT_UUID_BMS

Bond Management Service.

BT_UUID_IPSS_VAL

IP Support Service UUID value.

BT_UUID_IPSS

IP Support Service.

BT_UUID_OTS_VAL

Object Transfer Service UUID value.

BT_UUID_OTS

Object Transfer Service.

BT_UUID_MESH_PROV_VAL

Mesh Provisioning Service UUID value.

BT_UUID_MESH_PROV

Mesh Provisioning Service.

BT_UUID_MESH_PROXY_VAL

Mesh Proxy Service UUID value.

BT_UUID_MESH_PROXY

Mesh Proxy Service.

BT_UUID_GATT_PRIMARY_VAL

GATT Primary Service UUID value.

BT_UUID_GATT_PRIMARY

GATT Primary Service.

BT_UUID_GATT_SECONDARY_VAL

GATT Secondary Service UUID value.

BT_UUID_GATT_SECONDARY

GATT Secondary Service.

BT_UUID_GATT_INCLUDE_VAL

GATT Include Service UUID value.

BT_UUID_GATT_INCLUDE

GATT Include Service.

BT_UUID_GATT_CHRC_VAL

GATT Characteristic UUID value.

BT_UUID_GATT_CHRC

GATT Characteristic.

BT_UUID_GATT_CEP_VAL

GATT Characteristic Extended Properties UUID value.

BT_UUID_GATT_CEP

GATT Characteristic Extended Properties.

BT_UUID_GATT_CUD_VAL

GATT Characteristic User Description UUID value.

BT_UUID_GATT_CUD

GATT Characteristic User Description.

BT_UUID_GATT_CCC_VAL

GATT Client Characteristic Configuration UUID value.

BT_UUID_GATT_CCC

GATT Client Characteristic Configuration.

BT_UUID_GATT_SCC_VAL

GATT Server Characteristic Configuration UUID value.

BT_UUID_GATT_SCC

GATT Server Characteristic Configuration.

BT_UUID_GATT_CPF_VAL

GATT Characteristic Presentation Format UUID value.

BT_UUID_GATT_CPF

GATT Characteristic Presentation Format.

BT_UUID_VALID_RANGE_VAL

Valid Range Descriptor UUID value.

BT_UUID_VALID_RANGE

Valid Range Descriptor.

BT_UUID_HIDS_EXT_REPORT_VAL

HID External Report Descriptor UUID value.

BT_UUID_HIDS_EXT_REPORT

HID External Report Descriptor.

BT_UUID_HIDS_REPORT_REF_VAL

HID Report Reference Descriptor UUID value.

BT_UUID_HIDS_REPORT_REF

HID Report Reference Descriptor.

BT_UUID_ES_CONFIGURATION_VAL

Environmental Sensing Configuration Descriptor UUID value.

BT_UUID_ES_CONFIGURATION

Environmental Sensing Configuration Descriptor.

BT_UUID_ES_MEASUREMENT_VAL

Environmental Sensing Measurement Descriptor UUID value.

BT_UUID_ES_MEASUREMENT

Environmental Sensing Measurement Descriptor.

BT_UUID_ES_TRIGGER_SETTING_VAL

Environmental Sensing Trigger Setting Descriptor UUID value.

BT_UUID_ES_TRIGGER_SETTING

Environmental Sensing Trigger Setting Descriptor.

BT_UUID_GAP_DEVICE_NAME_VAL

GAP Characteristic Device Name UUID value.

BT_UUID_GAP_DEVICE_NAME

GAP Characteristic Device Name.

BT_UUID_GAP_APPEARANCE_VAL

GAP Characteristic Appearance UUID value.

BT_UUID_GAP_APPEARANCE

GAP Characteristic Appearance.

BT_UUID_GAP_PPCP_VAL

GAP Characteristic Peripheral Preferred Connection Parameters UUID value.

BT_UUID_GAP_PPCP

GAP Characteristic Peripheral Preferred Connection Parameters.

BT_UUID_GATT_SC_VAL

GATT Characteristic Service Changed UUID value.

BT_UUID_GATT_SC

GATT Characteristic Service Changed.

BT_UUID_BAS_BATTERY_LEVEL_VAL

BAS Characteristic Battery Level UUID value.

BT_UUID_BAS_BATTERY_LEVEL

BAS Characteristic Battery Level.

BT_UUID_HTS_MEASUREMENT_VAL

HTS Characteristic Measurement Value UUID value.

BT_UUID_HTS_MEASUREMENT

HTS Characteristic Measurement Value.

BT_UUID_HIDS_BOOT_KB_IN_REPORT_VAL

HID Characteristic Boot Keyboard Input Report UUID value.

BT_UUID_HIDS_BOOT_KB_IN_REPORT

HID Characteristic Boot Keyboard Input Report.

BT_UUID_DIS_SYSTEM_ID_VAL

DIS Characteristic System ID UUID value.

BT_UUID_DIS_SYSTEM_ID

DIS Characteristic System ID.

BT_UUID_DIS_MODEL_NUMBER_VAL

DIS Characteristic Model Number String UUID value.

BT_UUID_DIS_MODEL_NUMBER

DIS Characteristic Model Number String.

BT_UUID_DIS_SERIAL_NUMBER_VAL

DIS Characteristic Serial Number String UUID value.

BT_UUID_DIS_SERIAL_NUMBER

DIS Characteristic Serial Number String.

BT_UUID_DIS_FIRMWARE_REVISION_VAL

DIS Characteristic Firmware Revision String UUID value.

BT_UUID_DIS_FIRMWARE_REVISION

DIS Characteristic Firmware Revision String.

BT_UUID_DIS_HARDWARE_REVISION_VAL

DIS Characteristic Hardware Revision String UUID value.

BT_UUID_DIS_HARDWARE_REVISION

DIS Characteristic Hardware Revision String.

BT_UUID_DIS_SOFTWARE_REVISION_VAL

DIS Characteristic Software Revision String UUID value.

BT_UUID_DIS_SOFTWARE_REVISION

DIS Characteristic Software Revision String.

BT_UUID_DIS_MANUFACTURER_NAME_VAL

DIS Characteristic Manufacturer Name String UUID Value.

BT_UUID_DIS_MANUFACTURER_NAME

DIS Characteristic Manufacturer Name String.

BT_UUID_DIS_PNP_ID_VAL

DIS Characteristic PnP ID UUID value.

BT_UUID_DIS_PNP_ID

DIS Characteristic PnP ID.

BT_UUID_CTS_CURRENT_TIME_VAL

CTS Characteristic Current Time UUID value.

BT_UUID_CTS_CURRENT_TIME

CTS Characteristic Current Time.

BT_UUID_MAGN_DECLINATION_VAL

Magnetic Declination Characteristic UUID value.

BT_UUID_MAGN_DECLINATION

Magnetic Declination Characteristic.

BT_UUID_HIDS_BOOT_KB_OUT_REPORT_VAL

HID Boot Keyboard Output Report Characteristic UUID value.

BT_UUID_HIDS_BOOT_KB_OUT_REPORT

HID Boot Keyboard Output Report Characteristic.

BT_UUID_HIDS_BOOT_MOUSE_IN_REPORT_VAL

HID Boot Mouse Input Report Characteristic UUID value.

BT_UUID_HIDS_BOOT_MOUSE_IN_REPORT

HID Boot Mouse Input Report Characteristic.

BT_UUID_HRS_MEASUREMENT_VAL

HRS Characteristic Measurement Interval UUID value.

BT_UUID_HRS_MEASUREMENT

HRS Characteristic Measurement Interval.

BT_UUID_HRS_BODY_SENSOR

HRS Characteristic Body Sensor Location.

BT_UUID_HRS_BODY_SENSOR_VAL
BT_UUID_HRS_CONTROL_POINT

HRS Characteristic Control Point.

BT_UUID_HRS_CONTROL_POINT_VAL

HRS Characteristic Control Point UUID value.

BT_UUID_HIDS_INFO_VAL

HID Information Characteristic UUID value.

BT_UUID_HIDS_INFO

HID Information Characteristic.

BT_UUID_HIDS_REPORT_MAP_VAL

HID Report Map Characteristic UUID value.

BT_UUID_HIDS_REPORT_MAP

HID Report Map Characteristic.

BT_UUID_HIDS_CTRL_POINT_VAL

HID Control Point Characteristic UUID value.

BT_UUID_HIDS_CTRL_POINT

HID Control Point Characteristic.

BT_UUID_HIDS_REPORT_VAL

HID Report Characteristic UUID value.

BT_UUID_HIDS_REPORT

HID Report Characteristic.

BT_UUID_HIDS_PROTOCOL_MODE_VAL

HID Protocol Mode Characteristic UUID value.

BT_UUID_HIDS_PROTOCOL_MODE

HID Protocol Mode Characteristic.

BT_UUID_CSC_MEASUREMENT_VAL

CSC Measurement Characteristic UUID value.

BT_UUID_CSC_MEASUREMENT

CSC Measurement Characteristic.

BT_UUID_CSC_FEATURE_VAL

CSC Feature Characteristic UUID value.

BT_UUID_CSC_FEATURE

CSC Feature Characteristic.

BT_UUID_SENSOR_LOCATION_VAL

Sensor Location Characteristic UUID value.

BT_UUID_SENSOR_LOCATION

Sensor Location Characteristic.

BT_UUID_SC_CONTROL_POINT_VAL

SC Control Point Characteristic UUID value.

BT_UUID_SC_CONTROL_POINT

SC Control Point Characteristic.

BT_UUID_ELEVATION_VAL

Elevation Characteristic UUID value.

BT_UUID_ELEVATION

Elevation Characteristic.

BT_UUID_PRESSURE_VAL

Pressure Characteristic UUID value.

BT_UUID_PRESSURE

Pressure Characteristic.

BT_UUID_TEMPERATURE_VAL

Temperature Characteristic UUID value.

BT_UUID_TEMPERATURE

Temperature Characteristic.

BT_UUID_HUMIDITY_VAL

Humidity Characteristic UUID value.

BT_UUID_HUMIDITY

Humidity Characteristic.

BT_UUID_TRUE_WIND_SPEED_VAL

True Wind Speed Characteristic UUID value.

BT_UUID_TRUE_WIND_SPEED

True Wind Speed Characteristic.

BT_UUID_TRUE_WIND_DIR_VAL

True Wind Direction Characteristic UUID value.

BT_UUID_TRUE_WIND_DIR

True Wind Direction Characteristic.

BT_UUID_APPARENT_WIND_SPEED_VAL

Apparent Wind Speed Characteristic UUID value.

BT_UUID_APPARENT_WIND_SPEED

Apparent Wind Speed Characteristic.

BT_UUID_APPARENT_WIND_DIR_VAL

Apparent Wind Direction Characteristic UUID value.

BT_UUID_APPARENT_WIND_DIR

Apparent Wind Direction Characteristic.

BT_UUID_GUST_FACTOR_VAL

Gust Factor Characteristic UUID value.

BT_UUID_GUST_FACTOR

Gust Factor Characteristic.

BT_UUID_POLLEN_CONCENTRATION_VAL

Pollen Concentration Characteristic UUID value.

BT_UUID_POLLEN_CONCENTRATION

Pollen Concentration Characteristic.

BT_UUID_UV_INDEX_VAL

UV Index Characteristic UUID value.

BT_UUID_UV_INDEX

UV Index Characteristic.

BT_UUID_IRRADIANCE_VAL

Irradiance Characteristic UUID value.

BT_UUID_IRRADIANCE

Irradiance Characteristic.

BT_UUID_RAINFALL_VAL

Rainfall Characteristic UUID value.

BT_UUID_RAINFALL

Rainfall Characteristic.

BT_UUID_WIND_CHILL_VAL

Wind Chill Characteristic UUID value.

BT_UUID_WIND_CHILL

Wind Chill Characteristic.

BT_UUID_HEAT_INDEX_VAL

Heat Index Characteristic UUID value.

BT_UUID_HEAT_INDEX

Heat Index Characteristic.

BT_UUID_DEW_POINT_VAL

Dew Point Characteristic UUID value.

BT_UUID_DEW_POINT

Dew Point Characteristic.

BT_UUID_DESC_VALUE_CHANGED_VAL

Descriptor Value Changed Characteristic UUID value.

BT_UUID_DESC_VALUE_CHANGED

Descriptor Value Changed Characteristic.

BT_UUID_MAGN_FLUX_DENSITY_2D_VAL

Magnetic Flux Density - 2D Characteristic UUID value.

BT_UUID_MAGN_FLUX_DENSITY_2D

Magnetic Flux Density - 2D Characteristic.

BT_UUID_MAGN_FLUX_DENSITY_3D_VAL

Magnetic Flux Density - 3D Characteristic UUID value.

BT_UUID_MAGN_FLUX_DENSITY_3D

Magnetic Flux Density - 3D Characteristic.

BT_UUID_BAR_PRESSURE_TREND_VAL

Barometric Pressure Trend Characteristic UUID value.

BT_UUID_BAR_PRESSURE_TREND

Barometric Pressure Trend Characteristic.

BT_UUID_BMS_CONTROL_POINT_VAL

Bond Management Control Point UUID value.

BT_UUID_BMS_CONTROL_POINT

Bond Management Control Point.

BT_UUID_BMS_FEATURE_VAL

Bond Management Feature UUID value.

BT_UUID_BMS_FEATURE

Bond Management Feature.

BT_UUID_CENTRAL_ADDR_RES_VAL

Central Address Resolution Characteristic UUID value.

BT_UUID_CENTRAL_ADDR_RES

Central Address Resolution Characteristic.

BT_UUID_OTS_FEATURE_VAL

OTS Feature Characteristic UUID value.

BT_UUID_OTS_FEATURE

OTS Feature Characteristic.

BT_UUID_OTS_NAME_VAL

OTS Object Name Characteristic UUID value.

BT_UUID_OTS_NAME

OTS Object Name Characteristic.

BT_UUID_OTS_TYPE_VAL

OTS Object Type Characteristic UUID value.

BT_UUID_OTS_TYPE

OTS Object Type Characteristic.

BT_UUID_OTS_SIZE_VAL

OTS Object Size Characteristic UUID value.

BT_UUID_OTS_SIZE

OTS Object Size Characteristic.

BT_UUID_OTS_FIRST_CREATED_VAL

OTS Object First-Created Characteristic UUID value.

BT_UUID_OTS_FIRST_CREATED

OTS Object First-Created Characteristic.

BT_UUID_OTS_LAST_MODIFIED_VAL

OTS Object Last-Modified Characteristic UUI value.

BT_UUID_OTS_LAST_MODIFIED

OTS Object Last-Modified Characteristic.

BT_UUID_OTS_ID_VAL

OTS Object ID Characteristic UUID value.

BT_UUID_OTS_ID

OTS Object ID Characteristic.

BT_UUID_OTS_PROPERTIES_VAL

OTS Object Properties Characteristic UUID value.

BT_UUID_OTS_PROPERTIES

OTS Object Properties Characteristic.

BT_UUID_OTS_ACTION_CP_VAL

OTS Object Action Control Point Characteristic UUID value.

BT_UUID_OTS_ACTION_CP

OTS Object Action Control Point Characteristic.

BT_UUID_OTS_LIST_CP_VAL

OTS Object List Control Point Characteristic UUID value.

BT_UUID_OTS_LIST_CP

OTS Object List Control Point Characteristic.

BT_UUID_OTS_LIST_FILTER_VAL

OTS Object List Filter Characteristic UUID value.

BT_UUID_OTS_LIST_FILTER

OTS Object List Filter Characteristic.

BT_UUID_OTS_CHANGED_VAL

OTS Object Changed Characteristic UUID value.

BT_UUID_OTS_CHANGED

OTS Object Changed Characteristic.

BT_UUID_OTS_TYPE_UNSPECIFIED_VAL

OTS Unspecified Object Type UUID value.

BT_UUID_OTS_TYPE_UNSPECIFIED

OTS Unspecified Object Type.

BT_UUID_OTS_DIRECTORY_LISTING_VAL

OTS Directory Listing UUID value.

BT_UUID_OTS_DIRECTORY_LISTING

OTS Directory Listing.

BT_UUID_MESH_PROV_DATA_IN_VAL

Mesh Provisioning Data In UUID value.

BT_UUID_MESH_PROV_DATA_IN

Mesh Provisioning Data In.

BT_UUID_MESH_PROV_DATA_OUT_VAL

Mesh Provisioning Data Out UUID value.

BT_UUID_MESH_PROV_DATA_OUT

Mesh Provisioning Data Out.

BT_UUID_MESH_PROXY_DATA_IN_VAL

Mesh Proxy Data In UUID value.

BT_UUID_MESH_PROXY_DATA_IN

Mesh Proxy Data In.

BT_UUID_MESH_PROXY_DATA_OUT_VAL

Mesh Proxy Data Out UUID value.

BT_UUID_MESH_PROXY_DATA_OUT

Mesh Proxy Data Out.

BT_UUID_GATT_CLIENT_FEATURES_VAL

Client Supported Features UUID value.

BT_UUID_GATT_CLIENT_FEATURES

Client Supported Features.

BT_UUID_GATT_DB_HASH_VAL

Database Hash UUID value.

BT_UUID_GATT_DB_HASH

Database Hash.

BT_UUID_GATT_SERVER_FEATURES_VAL

Server Supported Features UUID value.

BT_UUID_GATT_SERVER_FEATURES

Server Supported Features.

BT_UUID_SDP_VAL
BT_UUID_SDP
BT_UUID_UDP_VAL
BT_UUID_UDP
BT_UUID_RFCOMM_VAL
BT_UUID_RFCOMM
BT_UUID_TCP_VAL
BT_UUID_TCP
BT_UUID_TCS_BIN_VAL
BT_UUID_TCS_BIN
BT_UUID_TCS_AT_VAL
BT_UUID_TCS_AT
BT_UUID_ATT_VAL
BT_UUID_ATT
BT_UUID_OBEX_VAL
BT_UUID_OBEX
BT_UUID_IP_VAL
BT_UUID_IP
BT_UUID_FTP_VAL
BT_UUID_FTP
BT_UUID_HTTP_VAL
BT_UUID_HTTP
BT_UUID_BNEP_VAL
BT_UUID_BNEP
BT_UUID_UPNP_VAL
BT_UUID_UPNP
BT_UUID_HIDP_VAL
BT_UUID_HIDP
BT_UUID_HCRP_CTRL_VAL
BT_UUID_HCRP_CTRL
BT_UUID_HCRP_DATA_VAL
BT_UUID_HCRP_DATA
BT_UUID_HCRP_NOTE_VAL
BT_UUID_HCRP_NOTE
BT_UUID_AVCTP_VAL
BT_UUID_AVCTP
BT_UUID_AVDTP_VAL
BT_UUID_AVDTP
BT_UUID_CMTP_VAL
BT_UUID_CMTP
BT_UUID_UDI_VAL
BT_UUID_UDI
BT_UUID_MCAP_CTRL_VAL
BT_UUID_MCAP_CTRL
BT_UUID_MCAP_DATA_VAL
BT_UUID_MCAP_DATA
BT_UUID_L2CAP_VAL
BT_UUID_L2CAP

Enums

enum [anonymous]

Bluetooth UUID types.

Values:

enumerator BT_UUID_TYPE_16

UUID type 16-bit.

enumerator BT_UUID_TYPE_32

UUID type 32-bit.

enumerator BT_UUID_TYPE_128

UUID type 128-bit.

Functions

int bt_uuid_cmp(const struct bt_uuid *u1, const struct bt_uuid *u2)

Compare Bluetooth UUIDs.

Compares 2 Bluetooth UUIDs, if the types are different both UUIDs are first converted to 128 bits format before comparing.

Return

negative value if u1 < u2, 0 if u1 == u2, else positive

Parameters
  • u1: First Bluetooth UUID to compare

  • u2: Second Bluetooth UUID to compare

bool bt_uuid_create(struct bt_uuid *uuid, const uint8_t *data, uint8_t data_len)

Create a bt_uuid from a little-endian data buffer.

Create a bt_uuid from a little-endian data buffer. The data_len parameter is used to determine whether the UUID is in 16, 32 or 128 bit format (length 2, 4 or 16). Note: 32 bit format is not allowed over the air.

Return

true if the data was valid and the UUID was successfully created.

Parameters
  • uuid: Pointer to the bt_uuid variable

  • data: pointer to UUID stored in little-endian data buffer

  • data_len: length of the UUID in the data buffer

void bt_uuid_to_str(const struct bt_uuid *uuid, char *str, size_t len)

Convert Bluetooth UUID to string.

Converts Bluetooth UUID to string. UUID can be in any format, 16-bit, 32-bit or 128-bit.

Return

N/A

Parameters
  • uuid: Bluetooth UUID

  • str: pointer where to put converted string

  • len: length of str

struct bt_uuid
#include <uuid.h>

This is a ‘tentative’ type and should be used as a pointer only.

struct bt_uuid_16
#include <uuid.h>

Public Members

struct bt_uuid uuid

UUID generic type.

uint16_t val

UUID value, 16-bit in host endianness.

struct bt_uuid_32
#include <uuid.h>

Public Members

struct bt_uuid uuid

UUID generic type.

uint32_t val

UUID value, 32-bit in host endianness.

struct bt_uuid_128
#include <uuid.h>

Public Members

struct bt_uuid uuid

UUID generic type.

uint8_t val[16]

UUID value, 128-bit in little-endian format.