Welcome to gattlib’s documentation!

Indices and tables

Docs

struct gattlib_advertisement_data_t
#include <gattlib.h>

Structure to represent a GATT Service and its data in the BLE advertisement packet

Public Members

uuid_t uuid

UUID of the GATT Service

uint8_t *data

Data attached to the GATT Service

size_t data_length

Length of data attached to the GATT Service

struct gattlib_characteristic_t
#include <gattlib.h>

Structure to represent GATT Characteristic

Public Members

uint16_t handle

Handle of the GATT characteristic

uint8_t properties

Property of the GATT characteristic

uint16_t value_handle

Handle for the value of the GATT characteristic

uuid_t uuid

UUID of the GATT characteristic

struct gattlib_descriptor_t
#include <gattlib.h>

Structure to represent GATT Descriptor

Public Members

uint16_t handle

Handle of the GATT Descriptor

uint16_t uuid16

UUID16 of the GATT Descriptor

uuid_t uuid

UUID of the GATT Descriptor

struct gattlib_manufacturer_data_t
#include <gattlib.h>

Structure to represent manufacturer data from GATT advertisement packet

Public Members

uint16_t manufacturer_id
uint8_t *data
size_t data_size
struct gattlib_primary_service_t
#include <gattlib.h>

Structure to represent GATT Primary Service

Public Members

uint16_t attr_handle_start

First attribute handle of the GATT Primary Service

uint16_t attr_handle_end

Last attibute handle of the GATT Primary Service

uuid_t uuid

UUID of the Primary Service

file gattlib.h
#include <stdbool.h>
#include <stdint.h>
#include <bluetooth/bluetooth.h>
#include <bluetooth/sdp.h>
#include <bluetooth/sdp_lib.h>

Gattlib errors

GATTLIB_SUCCESS
GATTLIB_INVALID_PARAMETER
GATTLIB_NOT_FOUND
GATTLIB_TIMEOUT
GATTLIB_OUT_OF_MEMORY
GATTLIB_NOT_SUPPORTED
GATTLIB_DEVICE_ERROR
GATTLIB_DEVICE_NOT_CONNECTED
GATTLIB_NO_ADAPTER
GATTLIB_BUSY
GATTLIB_UNEXPECTED
GATTLIB_ADAPTER_CLOSE
GATTLIB_DEVICE_DISCONNECTED
GATTLIB_ERROR_MODULE_MASK
GATTLIB_ERROR_DBUS
GATTLIB_ERROR_BLUEZ
GATTLIB_ERROR_UNIX
GATTLIB_ERROR_INTERNAL
GATTLIB_ERROR_DBUS_WITH_ERROR(error)
GATTLIB_ERROR_BLUEZ_WITH_ERROR(ret)
GATTLIB_ERROR_UNIX_WITH_ERROR(ret)

GATT Characteristic Properties Bitfield values

GATTLIB_CHARACTERISTIC_BROADCAST
GATTLIB_CHARACTERISTIC_READ
GATTLIB_CHARACTERISTIC_WRITE_WITHOUT_RESP
GATTLIB_CHARACTERISTIC_WRITE
GATTLIB_CHARACTERISTIC_NOTIFY
GATTLIB_CHARACTERISTIC_INDICATE
CREATE_UUID16(value16)

Helper function to create UUID16 from a 16bit integer

Options for gattlib_connect()

Note

Options with the prefix GATTLIB_CONNECTION_OPTIONS_LEGACY_ is for Bluez prior to v5.42 (before Bluez) support

GATTLIB_CONNECTION_OPTIONS_NONE
GATTLIB_CONNECTION_OPTIONS_LEGACY_BDADDR_LE_PUBLIC
GATTLIB_CONNECTION_OPTIONS_LEGACY_BDADDR_LE_RANDOM
GATTLIB_CONNECTION_OPTIONS_LEGACY_BT_SEC_LOW
GATTLIB_CONNECTION_OPTIONS_LEGACY_BT_SEC_MEDIUM
GATTLIB_CONNECTION_OPTIONS_LEGACY_BT_SEC_HIGH
GATTLIB_CONNECTION_OPTIONS_LEGACY_PSM(value)
GATTLIB_CONNECTION_OPTIONS_LEGACY_MTU(value)
GATTLIB_CONNECTION_OPTIONS_LEGACY_GET_PSM(options)
GATTLIB_CONNECTION_OPTIONS_LEGACY_GET_MTU(options)
GATTLIB_CONNECTION_OPTIONS_LEGACY_DEFAULT

Discover filter

GATTLIB_DISCOVER_FILTER_USE_NONE
GATTLIB_DISCOVER_FILTER_USE_UUID
GATTLIB_DISCOVER_FILTER_USE_RSSI
GATTLIB_DISCOVER_FILTER_NOTIFY_CHANGE

Gattlib Eddystone types

GATTLIB_EDDYSTONE_TYPE_UID
GATTLIB_EDDYSTONE_TYPE_URL
GATTLIB_EDDYSTONE_TYPE_TLM
GATTLIB_EDDYSTONE_TYPE_EID
GATTLIB_EDDYSTONE_LIMIT_RSSI

Eddystone ID types defined by its specification: https://github.com/google/eddystone

EDDYSTONE_TYPE_UID
EDDYSTONE_TYPE_URL
EDDYSTONE_TYPE_TLM
EDDYSTONE_TYPE_EID
GATTLIB_ERROR

Log level

GATTLIB_WARNING
GATTLIB_INFO
GATTLIB_DEBUG
GATTLIB_LOG(level, args...)
typedef struct _gattlib_adapter gattlib_adapter_t
typedef struct _gattlib_connection gattlib_connection_t
typedef struct _gattlib_stream_t gattlib_stream_t
typedef void (*gattlib_event_handler_t)(const uuid_t *uuid, const uint8_t *data, size_t data_length, void *user_data)
typedef void (*gattlib_disconnection_handler_t)(gattlib_connection_t *connection, void *user_data)

Handler called on disconnection.

Param connection:

Connection that is disconnecting

Param user_data:

Data defined when calling gattlib_register_on_disconnect()

typedef void (*gattlib_discovered_device_t)(gattlib_adapter_t *adapter, const char *addr, const char *name, void *user_data)

Handler called on new discovered BLE device.

Param adapter:

is the adapter that has found the BLE device

Param addr:

is the MAC address of the BLE device

Param name:

is the name of BLE device if advertised

Param user_data:

Data defined when calling gattlib_register_on_disconnect()

typedef void (*gattlib_discovered_device_with_data_t)(gattlib_adapter_t *adapter, const char *addr, const char *name, gattlib_advertisement_data_t *advertisement_data, size_t advertisement_data_count, gattlib_manufacturer_data_t *manufacturer_data, size_t manufacturer_data_count, void *user_data)

Handler called on new discovered BLE device.

Param adapter:

is the adapter that has found the BLE device

Param addr:

is the MAC address of the BLE device

Param name:

is the name of BLE device if advertised

Param advertisement_data:

is an array of Service UUID and their respective data

Param advertisement_data_count:

is the number of elements in the advertisement_data array

Param manufacturer_data:

is an array of gattlib_manufacturer_data_t

Param manufacturer_data_count:

is the number of entry in gattlib_manufacturer_data_t array

Param user_data:

Data defined when calling gattlib_register_on_disconnect()

typedef void (*gatt_connect_cb_t)(gattlib_adapter_t *adapter, const char *dst, gattlib_connection_t *connection, int error, void *user_data)

Handler called on asynchronous connection when connection is ready or on connection error.

Param adapter:

Local Adaptater interface. When passing NULL, we use default adapter.

Param dst:

Remote Bluetooth address

Param connection:

Connection that is disconnecting

Param error:

Connection error code

Param user_data:

Data defined when calling gattlib_register_on_disconnect()

typedef void *(*gatt_read_cb_t)(const void *buffer, size_t buffer_len)

Callback called when GATT characteristic read value has been received.

Param buffer:

contains the value to read.

Param buffer_len:

Length of the read data

const uuid_t gattlib_eddystone_common_data_uuid

Constant defining Eddystone common data UID in Advertisement data.

const char *gattlib_eddystone_url_scheme_prefix[]

List of prefix for Eddystone URL Scheme.

int gattlib_adapter_open(const char *adapter_name, gattlib_adapter_t **adapter)

Open Bluetooth adapter.

Parameters:
  • adapter_name – With value NULL, the default adapter will be selected.

  • adapter – is the context of the newly opened adapter

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

const char *gattlib_adapter_get_name(gattlib_adapter_t *adapter)

Get adapter name.

Parameters:

adapter – is the context of the newly opened adapter

Returns:

Adapter name

int gattlib_adapter_scan_enable(gattlib_adapter_t *adapter, gattlib_discovered_device_t discovered_device_cb, size_t timeout, void *user_data)

Enable Bluetooth scanning on a given adapter.

Parameters:
  • adapter – is the context of the newly opened adapter

  • discovered_device_cb – is the function callback called for each new Bluetooth device discovered

  • timeout – defines the duration of the Bluetooth scanning. When timeout=0, we scan indefinitely.

  • user_data – is the data passed to the callback discovered_device_cb()

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_adapter_scan_enable_with_filter(gattlib_adapter_t *adapter, uuid_t **uuid_list, int16_t rssi_threshold, uint32_t enabled_filters, gattlib_discovered_device_t discovered_device_cb, size_t timeout, void *user_data)

Enable Bluetooth scanning on a given adapter.

This function will block until either the timeout has expired or gattlib_adapter_scan_disable() has been called.

Parameters:
  • adapter – is the context of the newly opened adapter

  • uuid_list – is a NULL-terminated list of UUIDs to filter. The rule only applies to advertised UUID. Returned devices would match any of the UUIDs of the list.

  • rssi_threshold – is the imposed RSSI threshold for the returned devices.

  • enabled_filters – defines the parameters to use for filtering. There are selected by using the macros GATTLIB_DISCOVER_FILTER_USE_UUID and GATTLIB_DISCOVER_FILTER_USE_RSSI.

  • discovered_device_cb – is the function callback called for each new Bluetooth device discovered

  • timeout – defines the duration of the Bluetooth scanning. When timeout=0, we scan indefinitely.

  • user_data – is the data passed to the callback discovered_device_cb()

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_adapter_scan_enable_with_filter_non_blocking(gattlib_adapter_t *adapter, uuid_t **uuid_list, int16_t rssi_threshold, uint32_t enabled_filters, gattlib_discovered_device_t discovered_device_cb, size_t timeout, void *user_data)

Enable Bluetooth scanning on a given adapter (non-blocking)

This function will return as soon as the BLE scan has been started.

Parameters:
  • adapter – is the context of the newly opened adapter

  • uuid_list – is a NULL-terminated list of UUIDs to filter. The rule only applies to advertised UUID. Returned devices would match any of the UUIDs of the list.

  • rssi_threshold – is the imposed RSSI threshold for the returned devices.

  • enabled_filters – defines the parameters to use for filtering. There are selected by using the macros GATTLIB_DISCOVER_FILTER_USE_UUID and GATTLIB_DISCOVER_FILTER_USE_RSSI.

  • discovered_device_cb – is the function callback called for each new Bluetooth device discovered

  • timeout – defines the duration of the Bluetooth scanning. When timeout=0, we scan indefinitely.

  • user_data – is the data passed to the callback discovered_device_cb()

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_adapter_scan_eddystone(gattlib_adapter_t *adapter, int16_t rssi_threshold, uint32_t eddystone_types, gattlib_discovered_device_with_data_t discovered_device_cb, size_t timeout, void *user_data)

Enable Eddystone Bluetooth Device scanning on a given adapter.

This function will block until either the timeout has expired or gattlib_adapter_scan_disable() has been called.

Parameters:
  • adapter – is the context of the newly opened adapter

  • rssi_threshold – is the imposed RSSI threshold for the returned devices.

  • eddystone_types – defines the type(s) of Eddystone advertisement data type to select. The types are defined by the macros GATTLIB_EDDYSTONE_TYPE_*. The macro GATTLIB_EDDYSTONE_LIMIT_RSSI can also be used to limit RSSI with rssi_threshold.

  • discovered_device_cb – is the function callback called for each new Bluetooth device discovered

  • timeout – defines the duration of the Bluetooth scanning. When timeout=0, we scan indefinitely.

  • user_data – is the data passed to the callback discovered_device_cb()

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_adapter_scan_disable(gattlib_adapter_t *adapter)

Disable Bluetooth scanning on a given adapter.

Parameters:

adapter – is the context of the newly opened adapter

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_adapter_close(gattlib_adapter_t *adapter)

Close Bluetooth adapter context.

Parameters:

adapter – is the context of the newly opened adapter

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_connect(gattlib_adapter_t *adapter, const char *dst, unsigned long options, gatt_connect_cb_t connect_cb, void *user_data)

Function to asynchronously connect to a BLE device.

Note

This function is mainly used before Bluez v5.42 (prior to D-BUS support)

Parameters:
  • adapter – Local Adaptater interface. When passing NULL, we use default adapter.

  • dst – Remote Bluetooth address

  • options – Options to connect to BLE device. See GATTLIB_CONNECTION_OPTIONS_*

  • connect_cb – is the callback to call when the connection is established

  • user_data – is the user specific data to pass to the callback

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_disconnect(gattlib_connection_t *connection, bool wait_disconnection)

Function to disconnect the GATT connection.

Note

: If a callback has been registered by gattlib_register_on_disconnect() then it will be called when the device will have signaled is disconnected.

Parameters:
  • connection – Active GATT connection

  • wait_disconnection – If false gattlib_disconnect does not wait for the device to confirm it has been disconnected and return immediately.

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

Returns:

GATTLIB_TIMEOUT when wait_disconnection is true and the device has not been disconnected for GATTLIB_DISCONNECTION_WAIT_TIMEOUT_SEC seconds

int gattlib_register_on_disconnect(gattlib_connection_t *connection, gattlib_disconnection_handler_t handler, void *user_data)

Function to register a callback on GATT disconnection.

Parameters:
  • connection – Active GATT connection

  • handler – is the callaback to invoke on disconnection

  • user_data – is user specific data to pass to the callaback

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_discover_primary(gattlib_connection_t *connection, gattlib_primary_service_t **services, int *services_count)

Function to discover GATT Services.

Note

This function can be used to force GATT services/characteristic discovery

Parameters:
  • connection – Active GATT connection

  • services – array of GATT services allocated by the function. Can be NULL.

  • services_count – Number of GATT services discovered. Can be NULL

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_discover_char_range(gattlib_connection_t *connection, uint16_t start, uint16_t end, gattlib_characteristic_t **characteristics, int *characteristics_count)

Function to discover GATT Characteristic.

Note

This function can be used to force GATT services/characteristic discovery

Parameters:
  • connection – Active GATT connection

  • start – is the index of the first handle of the range

  • end – is the index of the last handle of the range

  • characteristics – array of GATT characteristics allocated by the function. Can be NULL.

  • characteristics_count – Number of GATT characteristics discovered. Can be NULL

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_discover_char(gattlib_connection_t *connection, gattlib_characteristic_t **characteristics, int *characteristics_count)

Function to discover GATT Characteristic.

Note

This function can be used to force GATT services/characteristic discovery

Parameters:
  • connection – Active GATT connection

  • characteristics – array of GATT characteristics allocated by the function. Can be NULL.

  • characteristics_count – Number of GATT characteristics discovered. Can be NULL

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_discover_desc_range(gattlib_connection_t *connection, int start, int end, gattlib_descriptor_t **descriptors, int *descriptors_count)

Function to discover GATT Descriptors in a range of handles.

Parameters:
  • connection – Active GATT connection

  • start – is the index of the first handle of the range

  • end – is the index of the last handle of the range

  • descriptors – array of GATT descriptors allocated by the function. Can be NULL.

  • descriptors_count – Number of GATT descriptors discovered. Can be NULL

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_discover_desc(gattlib_connection_t *connection, gattlib_descriptor_t **descriptors, int *descriptors_count)

Function to discover GATT Descriptor.

Parameters:
  • connection – Active GATT connection

  • descriptors – array of GATT descriptors allocated by the function. Can be NULL.

  • descriptors_count – Number of GATT descriptors discovered. Can be NULL

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_read_char_by_uuid(gattlib_connection_t *connection, uuid_t *uuid, void **buffer, size_t *buffer_len)

Function to read GATT characteristic.

Note

buffer is allocated by the function. It is the responsibility of the caller to free the buffer.

Parameters:
  • connection – Active GATT connection

  • uuid – UUID of the GATT characteristic to read

  • buffer – contains the value to read. It is allocated by the function.

  • buffer_len – Length of the read data

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_read_char_by_uuid_async(gattlib_connection_t *connection, uuid_t *uuid, gatt_read_cb_t gatt_read_cb)

Function to asynchronously read GATT characteristic.

Parameters:
  • connection – Active GATT connection

  • uuid – UUID of the GATT characteristic to read

  • gatt_read_cb – is the callback to read when the GATT characteristic is available

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

void gattlib_characteristic_free_value(void *ptr)

Free buffer allocated by the characteristic reading to store the value.

Parameters:

buffer – Buffer to free

int gattlib_write_char_by_uuid(gattlib_connection_t *connection, uuid_t *uuid, const void *buffer, size_t buffer_len)

Function to write to the GATT characteristic UUID.

Parameters:
  • connection – Active GATT connection

  • uuid – UUID of the GATT characteristic to read

  • buffer – contains the values to write to the GATT characteristic

  • buffer_len – is the length of the buffer to write

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_write_char_by_handle(gattlib_connection_t *connection, uint16_t handle, const void *buffer, size_t buffer_len)

Function to write to the GATT characteristic handle.

Parameters:
  • connection – Active GATT connection

  • handle – is the handle of the GATT characteristic

  • buffer – contains the values to write to the GATT characteristic

  • buffer_len – is the length of the buffer to write

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_write_without_response_char_by_uuid(gattlib_connection_t *connection, uuid_t *uuid, const void *buffer, size_t buffer_len)

Function to write without response to the GATT characteristic UUID.

Parameters:
  • connection – Active GATT connection

  • uuid – UUID of the GATT characteristic to read

  • buffer – contains the values to write to the GATT characteristic

  • buffer_len – is the length of the buffer to write

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_write_char_by_uuid_stream_open(gattlib_connection_t *connection, uuid_t *uuid, gattlib_stream_t **stream, uint16_t *mtu)

Create a stream to a GATT characteristic to write data in continue.

Note

: The GATT characteristic must support ‘Write-Without-Response’

Parameters:
  • connection – Active GATT connection

  • uuid – UUID of the GATT characteristic to write

  • stream – is the object that is attached to the GATT characteristic that is used to write data to

  • mtu – is the MTU of the GATT connection to optimise the stream writting

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_write_char_stream_write(gattlib_stream_t *stream, const void *buffer, size_t buffer_len)

Write data to the stream previously created with gattlib_write_char_by_uuid_stream_open()

Parameters:
  • stream – is the object that is attached to the GATT characteristic that is used to write data to

  • buffer – is the data to write to the stream

  • buffer_len – is the length of the buffer to write

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_write_char_stream_close(gattlib_stream_t *stream)

Close the stream previously created with gattlib_write_char_by_uuid_stream_open()

Parameters:

stream – is the object that is attached to the GATT characteristic that is used to write data to

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_write_without_response_char_by_handle(gattlib_connection_t *connection, uint16_t handle, const void *buffer, size_t buffer_len)

Function to write without response to the GATT characteristic handle.

Parameters:
  • connection – Active GATT connection

  • handle – is the handle of the GATT characteristic

  • buffer – contains the values to write to the GATT characteristic

  • buffer_len – is the length of the buffer to write

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_notification_start(gattlib_connection_t *connection, const uuid_t *uuid)
int gattlib_notification_stop(gattlib_connection_t *connection, const uuid_t *uuid)
int gattlib_indication_start(gattlib_connection_t *connection, const uuid_t *uuid)
int gattlib_indication_stop(gattlib_connection_t *connection, const uuid_t *uuid)
int gattlib_register_notification(gattlib_connection_t *connection, gattlib_event_handler_t notification_handler, void *user_data)
int gattlib_register_indication(gattlib_connection_t *connection, gattlib_event_handler_t indication_handler, void *user_data)
int gattlib_get_rssi_from_mac(gattlib_adapter_t *adapter, const char *mac_address, int16_t *rssi)

Function to retrieve RSSI from a MAC Address.

Note

: This function must be used before a connection is established. Once the connection established, the function will return a null RSSI.

Parameters:
  • adapter – is the adapter the new device has been seen

  • mac_address – is the MAC address of the device to get the RSSI

  • rssi – is the Received Signal Strength Indicator of the remote device

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_get_advertisement_data(gattlib_connection_t *connection, gattlib_advertisement_data_t **advertisement_data, size_t *advertisement_data_count, gattlib_manufacturer_data_t **manufacturer_data, size_t *manufacturer_data_count)

Function to retrieve Advertisement Data from a MAC Address.

Parameters:
  • connection – Active GATT connection

  • advertisement_data – is an array of Service UUID and their respective data

  • advertisement_data_count – is the number of elements in the advertisement_data array

  • manufacturer_data – is an array of gattlib_manufacturer_data_t

  • manufacturer_data_count – is the number of entry in gattlib_manufacturer_data_t array

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_get_advertisement_data_from_mac(gattlib_adapter_t *adapter, const char *mac_address, gattlib_advertisement_data_t **advertisement_data, size_t *advertisement_data_count, gattlib_manufacturer_data_t **manufacturer_data, size_t *manufacturer_data_count)

Function to retrieve Advertisement Data from a MAC Address.

Parameters:
  • adapter – is the adapter the new device has been seen

  • mac_address – is the MAC address of the device to get the RSSI

  • advertisement_data – is an array of Service UUID and their respective data

  • advertisement_data_count – is the number of elements in the advertisement_data array

  • manufacturer_data – is an array of gattlib_manufacturer_data_t

  • manufacturer_data_count – is the number of entry in gattlib_manufacturer_data_t array

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_uuid_to_string(const uuid_t *uuid, char *str, size_t size)

Convert a UUID into a string.

Parameters:
  • uuid – is the UUID to convert

  • str – is the buffer that will contain the string

  • size – is the size of the buffer

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_string_to_uuid(const char *str, size_t size, uuid_t *uuid)

Convert a string representing a UUID into a UUID structure.

Parameters:
  • str – is the buffer containing the string

  • size – is the size of the buffer

  • uuid – is the UUID structure that would receive the UUID

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

int gattlib_uuid_cmp(const uuid_t *uuid1, const uuid_t *uuid2)

Compare two UUIDs.

Parameters:
  • uuid1 – is the one of the UUID to compare with

  • uuid2 – is the other UUID to compare with

Returns:

GATTLIB_SUCCESS on success or GATTLIB_* error code

void gattlib_log(int level, const char *format, ...)

Logging function used by Gattlib.

Parameters:
  • level – is the logging level of the message

  • format – is the message format

int gattlib_mainloop(void *(*task)(void *arg), void *arg)

Defines

BDADDR_BREDR
BDADDR_LE_PUBLIC
BDADDR_LE_RANDOM
GATTLIB_DISCONNECTION_WAIT_TIMEOUT_SEC

Gattlib constants

dir /builddir/build/BUILD/gattlib-0.7.2-build/gattlib-0.7.2/include