PebbleOS
Loading...
Searching...
No Matches
Data Structures | Macros | Typedefs | Enumerations

Error codes, addresses, devices and advertising data shared by the Bluetooth API. More...

Data Structures

struct  pbl_bt_addr
 Bluetooth device address. More...
 
struct  pbl_bt_device
 Remote Bluetooth device, as exposed to applications. More...
 
struct  pbl_bt_device_internal
 Remote Bluetooth device: its address and address type. More...
 
struct  pbl_bt_ad_data
 Advertising data and scan response data. More...
 
union  pbl_bt_device.__unnamed7__
 
union  pbl_bt_device_internal.__unnamed9__
 
struct  pbl_bt_device_internal.__unnamed9__.__unnamed11__
 

Macros

#define PBL_BT_ERRNO_WITH_INTERNAL_ERROR(e)   ((int)PBL_BT_ERRNO_INTERNAL_ERROR_BEGIN - e)
 Map a legacy stack error to enum pbl_bt_errno.
 
#define PBL_BT_ERRNO_WITH_HCI_ERROR(e)   ((int)PBL_BT_ERRNO_HCI_ERROR_BEGIN + e)
 Map an HCI error to enum pbl_bt_errno.
 
#define PBL_BT_SERVICE_INVALID   ((pbl_bt_service_t)0)
 Invalid service reference.
 
#define PBL_BT_CHARACTERISTIC_INVALID   ((pbl_bt_characteristic_t)0)
 Invalid characteristic reference.
 
#define PBL_BT_DESCRIPTOR_INVALID   ((pbl_bt_descriptor_t)0)
 Invalid descriptor reference.
 
#define PBL_BT_BONDING_ID_INVALID   (0xFFU)
 Invalid bonding identifier.
 
#define PBL_BT_CCCD_ID_INVALID   (0xFFU)
 Invalid CCCD entry identifier.
 
#define PBL_BT_ADDR_SIZE   (sizeof(struct pbl_bt_addr))
 Size of a struct pbl_bt_addr in bytes.
 
#define PBL_BT_ADDR_FMT   "%02X:%02X:%02X:%02X:%02X:%02X"
 printf() format of an address, as XX:XX:XX:XX:XX:XX.
 
#define PBL_BT_ADDR_FMT_BUFFER_SIZE   (18)
 Buffer size for an address printed with PBL_BT_ADDR_FMT, including the terminator.
 
#define PBL_BT_BD_ADDR_FMT   "0x%02X%02X%02X%02X%02X%02X"
 printf() format of an address, as 0xXXXXXXXXXXXX.
 
#define PBL_BT_BD_ADDR_FMT_BUFFER_SIZE   (15)
 Buffer size for an address printed with PBL_BT_BD_ADDR_FMT, including the terminator.
 
#define PBL_BT_DEVICE_NAME_BUFFER_SIZE   (20)
 Buffer size of a device name, including the terminator.
 
#define PBL_BT_ADDR_XPLODE(a)    (a).octets[5], (a).octets[4], (a).octets[3], (a).octets[2], (a).octets[1], (a).octets[0]
 Expand an address into the printf() arguments of PBL_BT_ADDR_FMT, most significant octet first.
 
#define PBL_BT_ADDR_XPLODE_PTR(a)    (a)->octets[5], (a)->octets[4], (a)->octets[3], (a)->octets[2], (a)->octets[1], (a)->octets[0]
 PBL_BT_ADDR_XPLODE() taking a pointer.
 
#define PBL_BT_DEVICE_INVALID   ((const struct pbl_bt_device){})
 Invalid (all zero) struct pbl_bt_device.
 
#define PBL_BT_DEVICE_INTERNAL_INVALID   ((const struct pbl_bt_device_internal){})
 Invalid (all zero) struct pbl_bt_device_internal.
 
#define PBL_BT_AD_REPORT_DATA_MAX_LENGTH   (31)
 Maximum size in bytes of advertising data or scan response data.
 
#define PBL_BT_LL_CONN_INTV_MIN_SLOTS   (6)
 Minimum connection interval, in 1.25 ms slots.
 
#define PBL_BT_LL_CONN_INTV_MAX_SLOTS   (3200)
 Maximum connection interval, in 1.25 ms slots.
 
#define PBL_BT_LL_SUPERVISION_TIMEOUT_MIN_MS   (100)
 Minimum supervision timeout in milliseconds.
 
#define PBL_BT_SIG_UUID_EXPAND(u)
 Compile-time version of bt_uuid_expand_32bit() and bt_uuid_expand_16bit().
 

Typedefs

typedef uintptr_t pbl_bt_service_t
 Opaque reference to a service object.
 
typedef uintptr_t pbl_bt_characteristic_t
 Opaque reference to a characteristic object.
 
typedef uintptr_t pbl_bt_descriptor_t
 Opaque reference to a descriptor object.
 
typedef uint8_t pbl_bt_bonding_id_t
 Identifier of a bonding.
 
typedef uint16_t pbl_bt_cccd_id_t
 Identifier of a stored Client Characteristic Configuration Descriptor entry.
 

Enumerations

enum  pbl_bt_errno {
  PBL_BT_ERRNO_OK = 0 , PBL_BT_ERRNO_CONNECTED = PBL_BT_ERRNO_OK , PBL_BT_ERRNO_INVALID_PARAMETER = 1 , PBL_BT_ERRNO_CONNECTION_TIMEOUT = 2 ,
  PBL_BT_ERRNO_REMOTELY_TERMINATED = 3 , PBL_BT_ERRNO_LOCALLY_TERMINATED_BY_SYSTEM = 4 , PBL_BT_ERRNO_LOCALLY_TERMINATED_BY_APP = 5 , PBL_BT_ERRNO_NOT_ENOUGH_RESOURCES = 6 ,
  PBL_BT_ERRNO_PAIRING_NOT_SUPPORTED = 7 , PBL_BT_ERRNO_PAIRING_CONFIRMATION_FAILED = 8 , PBL_BT_ERRNO_PAIRING_TIME_OUT = 9 , PBL_BT_ERRNO_PAIRING_OOB_NOT_AVAILABLE = 10 ,
  PBL_BT_ERRNO_INVALID_STATE = 11 , PBL_BT_ERRNO_SERVICE_DISCOVERY_TIMEOUT = 12 , PBL_BT_ERRNO_SERVICE_DISCOVERY_DISCONNECTED = 13 , PBL_BT_ERRNO_SERVICE_DISCOVERY_DATABASE_CHANGED = 14 ,
  PBL_BT_ERRNO_INTERNAL_ERROR_BEGIN = 9000 , PBL_BT_ERRNO_HCI_ERROR_BEGIN = 10000 , PBL_BT_ERRNO_OTHER = 0x3fff
}
 Bluetooth error codes. More...
 
enum  pbl_bt_gatt_error {
  PBL_BT_GATT_ERROR_SUCCESS = 0x00 , PBL_BT_GATT_ERROR_INVALID_HANDLE = 0x01 , PBL_BT_GATT_ERROR_READ_NOT_PERMITTED = 0x02 , PBL_BT_GATT_ERROR_WRITE_NOT_PERMITTED = 0x03 ,
  PBL_BT_GATT_ERROR_INVALID_PDU = 0x04 , PBL_BT_GATT_ERROR_INSUFFICIENT_AUTHENTICATION = 0x05 , PBL_BT_GATT_ERROR_REQUEST_NOT_SUPPORTED = 0x06 , PBL_BT_GATT_ERROR_INVALID_OFFSET = 0x07 ,
  PBL_BT_GATT_ERROR_INSUFFICIENT_AUTHORIZATION = 0x08 , PBL_BT_GATT_ERROR_PREPARE_QUEUE_FULL = 0x09 , PBL_BT_GATT_ERROR_ATTRIBUTE_NOT_FOUND = 0x0A , PBL_BT_GATT_ERROR_ATTRIBUTE_NOT_LONG = 0x0B ,
  PBL_BT_GATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE = 0x0C , PBL_BT_GATT_ERROR_INVALID_ATTRIBUTE_VALUE_LENGTH = 0x0D , PBL_BT_GATT_ERROR_UNLIKELY_ERROR = 0x0E , PBL_BT_GATT_ERROR_INSUFFICIENT_ENCRYPTION = 0x0F ,
  PBL_BT_GATT_ERROR_UNSUPPORTED_GROUP_TYPE = 0x10 , PBL_BT_GATT_ERROR_INSUFFICIENT_RESOURCES = 0x11 , PBL_BT_GATT_ERROR_APPLICATION_SPECIFIC_ERROR_START = 0x80 , PBL_BT_GATT_ERROR_APPLICATION_SPECIFIC_ERROR_END = 0xFC ,
  PBL_BT_GATT_ERROR_CCCD_IMPROPERLY_CONFIGURED = 0xFD , PBL_BT_GATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS = 0xFE , PBL_BT_GATT_ERROR_OUT_OF_RANGE = 0xFF , PBL_BT_GATT_ERROR_REQUEST_TIME_OUT = 0x100 ,
  PBL_BT_GATT_ERROR_REQUEST_PREPARE_WRITE_DATA_MISMATCH = 0x101 , PBL_BT_GATT_ERROR_LOCAL_INSUFFICIENT_RESOURCES = 0x102
}
 ATT error codes returned by a GATT server for read, write and subscribe operations. More...
 
enum  pbl_bt_attribute_property {
  PBL_BT_ATTRIBUTE_PROPERTY_NONE = 0 , PBL_BT_ATTRIBUTE_PROPERTY_BROADCAST = (1 << 0) , PBL_BT_ATTRIBUTE_PROPERTY_READ = (1 << 1) , PBL_BT_ATTRIBUTE_PROPERTY_WRITE_WITHOUT_RESPONSE = (1 << 2) ,
  PBL_BT_ATTRIBUTE_PROPERTY_WRITE = (1 << 3) , PBL_BT_ATTRIBUTE_PROPERTY_NOTIFY = (1 << 4) , PBL_BT_ATTRIBUTE_PROPERTY_INDICATE = (1 << 5) , PBL_BT_ATTRIBUTE_PROPERTY_AUTHENTICATED_SIGNED_WRITES = (1 << 6) ,
  PBL_BT_ATTRIBUTE_PROPERTY_EXTENDED_PROPERTIES = (1 << 7) , PBL_BT_ATTRIBUTE_PROPERTY_READING_REQUIRES_ENCRYPTION = (1 << 8) , PBL_BT_ATTRIBUTE_PROPERTY_WRITING_REQUIRES_ENCRYPTION = (1 << 9)
}
 Property bits of a characteristic. More...
 

Advertising flags

Bits of the Flags AD type, see Supplement to the Bluetooth Core Specification, Part A, 1.3.

#define PBL_BT_AD_FLAGS_LIM_DISCOVERABLE_MASK   (1 << 0)
 LE Limited Discoverable Mode.
 
#define PBL_BT_AD_FLAGS_GEN_DISCOVERABLE_MASK   (1 << 1)
 LE General Discoverable Mode.
 
#define PBL_BT_AD_FLAGS_BR_EDR_NOT_SUPPORTED_MASK   (1 << 2)
 BR/EDR Not Supported.
 
#define PBL_BT_AD_FLAGS_LE_BR_EDR_SIMULT_CONTROLLER_MASK   (1 << 3)
 Simultaneous LE and BR/EDR to Same Device Capable (Controller).
 
#define PBL_BT_AD_FLAGS_LE_BR_EDR_SIMULT_HOST_MASK   (1 << 4)
 Simultaneous LE and BR/EDR to Same Device Capable (Host).
 

Detailed Description

Error codes, addresses, devices and advertising data shared by the Bluetooth API.

Addresses are stored least significant octet first, as on air. Use PBL_BT_ADDR_FMT with PBL_BT_ADDR_XPLODE() to print them most significant octet first:

#define PBL_BT_ADDR_FMT
printf() format of an address, as XX:XX:XX:XX:XX:XX.
Definition types.h:264
#define PBL_BT_ADDR_XPLODE(a)
Expand an address into the printf() arguments of PBL_BT_ADDR_FMT, most significant octet first.
Definition types.h:286
#define PBL_LOG_DBG(fmt,...)
Log a routine debug message, possibly queued.
Definition logging.h:570

Data Structure Documentation

◆ pbl_bt_addr

struct pbl_bt_addr

Bluetooth device address.

Data Fields
uint8_t octets[6] Address octets, least significant first.

◆ pbl_bt_device

struct pbl_bt_device

Remote Bluetooth device, as exposed to applications.

Opaque: the layout is struct pbl_bt_device_internal.

Data Fields
union pbl_bt_device.__unnamed7__ __unnamed__

◆ pbl_bt_device_internal

struct pbl_bt_device_internal

Remote Bluetooth device: its address and address type.

The layout of struct pbl_bt_device. It is not exported to applications and its size must never change.

Data Fields
union pbl_bt_device_internal.__unnamed9__ __unnamed__

◆ pbl_bt_ad_data

struct pbl_bt_ad_data

Advertising data and scan response data.

Variable length: allocate it with room for both payloads after the header.

Data Fields
uint8_t ad_data_length Length of the advertising data in bytes.
uint8_t data[0] The raw advertising data, followed by the raw scan response data.
uint8_t scan_resp_data_length Length of the scan response data in bytes.

◆ pbl_bt_device.__unnamed7__

union pbl_bt_device.__unnamed7__
Data Fields
uint32_t opaque[2] Opaque storage, as 32-bit words.
uint64_t opaque_64 Opaque storage, as a 64-bit word.

◆ pbl_bt_device_internal.__unnamed9__

union pbl_bt_device_internal.__unnamed9__
Data Fields
struct pbl_bt_device_internal.__unnamed9__.__unnamed11__ __unnamed__
struct pbl_bt_device opaque The same device, as the opaque type.

◆ pbl_bt_device_internal.__unnamed9__.__unnamed11__

struct pbl_bt_device_internal.__unnamed9__.__unnamed11__
Data Fields
struct pbl_bt_addr address Device address.
bool is_classic: 1 True for a BR/EDR device, false for an LE device.
bool is_random_address: 1 True if address is a random address, false if it is a public address.
uint16_t zero: 14 Unused, zero.

When adding flags, also update the bt_device_bits field of PebbleBLEGATTClientEvent and PebbleBLEConnectionEvent.

Macro Definition Documentation

◆ PBL_BT_AD_FLAGS_BR_EDR_NOT_SUPPORTED_MASK

#define PBL_BT_AD_FLAGS_BR_EDR_NOT_SUPPORTED_MASK   (1 << 2)

BR/EDR Not Supported.

◆ PBL_BT_AD_FLAGS_GEN_DISCOVERABLE_MASK

#define PBL_BT_AD_FLAGS_GEN_DISCOVERABLE_MASK   (1 << 1)

LE General Discoverable Mode.

◆ PBL_BT_AD_FLAGS_LE_BR_EDR_SIMULT_CONTROLLER_MASK

#define PBL_BT_AD_FLAGS_LE_BR_EDR_SIMULT_CONTROLLER_MASK   (1 << 3)

Simultaneous LE and BR/EDR to Same Device Capable (Controller).

◆ PBL_BT_AD_FLAGS_LE_BR_EDR_SIMULT_HOST_MASK

#define PBL_BT_AD_FLAGS_LE_BR_EDR_SIMULT_HOST_MASK   (1 << 4)

Simultaneous LE and BR/EDR to Same Device Capable (Host).

◆ PBL_BT_AD_FLAGS_LIM_DISCOVERABLE_MASK

#define PBL_BT_AD_FLAGS_LIM_DISCOVERABLE_MASK   (1 << 0)

LE Limited Discoverable Mode.

◆ PBL_BT_AD_REPORT_DATA_MAX_LENGTH

#define PBL_BT_AD_REPORT_DATA_MAX_LENGTH   (31)

Maximum size in bytes of advertising data or scan response data.

◆ PBL_BT_ADDR_FMT

#define PBL_BT_ADDR_FMT   "%02X:%02X:%02X:%02X:%02X:%02X"

printf() format of an address, as XX:XX:XX:XX:XX:XX.

Use with PBL_BT_ADDR_XPLODE() or PBL_BT_ADDR_XPLODE_PTR().

◆ PBL_BT_ADDR_FMT_BUFFER_SIZE

#define PBL_BT_ADDR_FMT_BUFFER_SIZE   (18)

Buffer size for an address printed with PBL_BT_ADDR_FMT, including the terminator.

◆ PBL_BT_ADDR_SIZE

#define PBL_BT_ADDR_SIZE   (sizeof(struct pbl_bt_addr))

Size of a struct pbl_bt_addr in bytes.

◆ PBL_BT_ADDR_XPLODE

#define PBL_BT_ADDR_XPLODE (   a)     (a).octets[5], (a).octets[4], (a).octets[3], (a).octets[2], (a).octets[1], (a).octets[0]

Expand an address into the printf() arguments of PBL_BT_ADDR_FMT, most significant octet first.

Parameters
astruct pbl_bt_addr value.

◆ PBL_BT_ADDR_XPLODE_PTR

#define PBL_BT_ADDR_XPLODE_PTR (   a)     (a)->octets[5], (a)->octets[4], (a)->octets[3], (a)->octets[2], (a)->octets[1], (a)->octets[0]

PBL_BT_ADDR_XPLODE() taking a pointer.

Parameters
aPointer to a struct pbl_bt_addr.

◆ PBL_BT_BD_ADDR_FMT

#define PBL_BT_BD_ADDR_FMT   "0x%02X%02X%02X%02X%02X%02X"

printf() format of an address, as 0xXXXXXXXXXXXX.

Use with PBL_BT_ADDR_XPLODE() or PBL_BT_ADDR_XPLODE_PTR().

◆ PBL_BT_BD_ADDR_FMT_BUFFER_SIZE

#define PBL_BT_BD_ADDR_FMT_BUFFER_SIZE   (15)

Buffer size for an address printed with PBL_BT_BD_ADDR_FMT, including the terminator.

◆ PBL_BT_BONDING_ID_INVALID

#define PBL_BT_BONDING_ID_INVALID   (0xFFU)

Invalid bonding identifier.

◆ PBL_BT_CCCD_ID_INVALID

#define PBL_BT_CCCD_ID_INVALID   (0xFFU)

Invalid CCCD entry identifier.

◆ PBL_BT_CHARACTERISTIC_INVALID

#define PBL_BT_CHARACTERISTIC_INVALID   ((pbl_bt_characteristic_t)0)

Invalid characteristic reference.

◆ PBL_BT_DESCRIPTOR_INVALID

#define PBL_BT_DESCRIPTOR_INVALID   ((pbl_bt_descriptor_t)0)

Invalid descriptor reference.

◆ PBL_BT_DEVICE_INTERNAL_INVALID

#define PBL_BT_DEVICE_INTERNAL_INVALID   ((const struct pbl_bt_device_internal){})

Invalid (all zero) struct pbl_bt_device_internal.

◆ PBL_BT_DEVICE_INVALID

#define PBL_BT_DEVICE_INVALID   ((const struct pbl_bt_device){})

Invalid (all zero) struct pbl_bt_device.

◆ PBL_BT_DEVICE_NAME_BUFFER_SIZE

#define PBL_BT_DEVICE_NAME_BUFFER_SIZE   (20)

Buffer size of a device name, including the terminator.

◆ PBL_BT_ERRNO_WITH_HCI_ERROR

#define PBL_BT_ERRNO_WITH_HCI_ERROR (   e)    ((int)PBL_BT_ERRNO_HCI_ERROR_BEGIN + e)

Map an HCI error to enum pbl_bt_errno.

Parameters
eHCI error code.

◆ PBL_BT_ERRNO_WITH_INTERNAL_ERROR

#define PBL_BT_ERRNO_WITH_INTERNAL_ERROR (   e)    ((int)PBL_BT_ERRNO_INTERNAL_ERROR_BEGIN - e)

Map a legacy stack error to enum pbl_bt_errno.

Parameters
eStack error code.

◆ PBL_BT_LL_CONN_INTV_MAX_SLOTS

#define PBL_BT_LL_CONN_INTV_MAX_SLOTS   (3200)

Maximum connection interval, in 1.25 ms slots.

◆ PBL_BT_LL_CONN_INTV_MIN_SLOTS

#define PBL_BT_LL_CONN_INTV_MIN_SLOTS   (6)

Minimum connection interval, in 1.25 ms slots.

◆ PBL_BT_LL_SUPERVISION_TIMEOUT_MIN_MS

#define PBL_BT_LL_SUPERVISION_TIMEOUT_MIN_MS   (100)

Minimum supervision timeout in milliseconds.

◆ PBL_BT_SERVICE_INVALID

#define PBL_BT_SERVICE_INVALID   ((pbl_bt_service_t)0)

Invalid service reference.

◆ PBL_BT_SIG_UUID_EXPAND

#define PBL_BT_SIG_UUID_EXPAND (   u)
Value:
(0xff & ((uint32_t)u) >> 24), (0xff & ((uint32_t)u) >> 16), (0xff & ((uint32_t)u) >> 8), \
(0xff & ((uint32_t)u) >> 0), 0x00, 0x00, 0x10, 0x00, 0x80, 0x00, 0x00, 0x80, 0x5F, 0x9B, \
0x34, 0xFB

Compile-time version of bt_uuid_expand_32bit() and bt_uuid_expand_16bit().

Expands to the 16 bytes of the UUID, as an initializer list.

Parameters
u16-bit or 32-bit UUID.

Typedef Documentation

◆ pbl_bt_bonding_id_t

typedef uint8_t pbl_bt_bonding_id_t

Identifier of a bonding.

Stable across reboots, so it can be persisted.

◆ pbl_bt_cccd_id_t

typedef uint16_t pbl_bt_cccd_id_t

Identifier of a stored Client Characteristic Configuration Descriptor entry.

◆ pbl_bt_characteristic_t

typedef uintptr_t pbl_bt_characteristic_t

Opaque reference to a characteristic object.

◆ pbl_bt_descriptor_t

typedef uintptr_t pbl_bt_descriptor_t

Opaque reference to a descriptor object.

◆ pbl_bt_service_t

typedef uintptr_t pbl_bt_service_t

Opaque reference to a service object.

Enumeration Type Documentation

◆ pbl_bt_attribute_property

Property bits of a characteristic.

The low byte holds the properties of the Bluetooth Core Specification, Vol 3, Part G, 3.3.1.1.

Enumerator
PBL_BT_ATTRIBUTE_PROPERTY_NONE 

No properties.

PBL_BT_ATTRIBUTE_PROPERTY_BROADCAST 

The value may be broadcast.

PBL_BT_ATTRIBUTE_PROPERTY_READ 

The value may be read.

PBL_BT_ATTRIBUTE_PROPERTY_WRITE_WITHOUT_RESPONSE 

The value may be written without response.

PBL_BT_ATTRIBUTE_PROPERTY_WRITE 

The value may be written.

PBL_BT_ATTRIBUTE_PROPERTY_NOTIFY 

The value may be notified.

PBL_BT_ATTRIBUTE_PROPERTY_INDICATE 

The value may be indicated.

PBL_BT_ATTRIBUTE_PROPERTY_AUTHENTICATED_SIGNED_WRITES 

The value may be written with an authenticated signed write.

PBL_BT_ATTRIBUTE_PROPERTY_EXTENDED_PROPERTIES 

Extended properties are in the Characteristic Extended Properties descriptor.

PBL_BT_ATTRIBUTE_PROPERTY_READING_REQUIRES_ENCRYPTION 

Reading requires an encrypted link.

Only for attributes hosted by the local server.

PBL_BT_ATTRIBUTE_PROPERTY_WRITING_REQUIRES_ENCRYPTION 

Writing requires an encrypted link.

Only for attributes hosted by the local server.

◆ pbl_bt_errno

Bluetooth error codes.

Enumerator
PBL_BT_ERRNO_OK 

The operation was successful.

PBL_BT_ERRNO_CONNECTED 

Connection established successfully.

PBL_BT_ERRNO_INVALID_PARAMETER 

One or more parameters were invalid.

PBL_BT_ERRNO_CONNECTION_TIMEOUT 

The connection timed out, for example because the devices went out of range of each other or packets were lost due to RF interference.

PBL_BT_ERRNO_REMOTELY_TERMINATED 

The connection was terminated by the remote device.

PBL_BT_ERRNO_LOCALLY_TERMINATED_BY_SYSTEM 

The connection was terminated by the system.

PBL_BT_ERRNO_LOCALLY_TERMINATED_BY_APP 

The connection was terminated by the application.

PBL_BT_ERRNO_NOT_ENOUGH_RESOURCES 

The system did not have enough resources for the operation.

PBL_BT_ERRNO_PAIRING_NOT_SUPPORTED 

The remote device does not support pairing.

PBL_BT_ERRNO_PAIRING_CONFIRMATION_FAILED 

The pairing failed because the user did not confirm.

PBL_BT_ERRNO_PAIRING_TIME_OUT 

The pairing failed because it timed out.

PBL_BT_ERRNO_PAIRING_OOB_NOT_AVAILABLE 

The pairing failed because Out-of-Band data was not available.

PBL_BT_ERRNO_INVALID_STATE 

The requested operation cannot be performed in the current state.

PBL_BT_ERRNO_SERVICE_DISCOVERY_TIMEOUT 

GATT service discovery timed out.

PBL_BT_ERRNO_SERVICE_DISCOVERY_DISCONNECTED 

GATT service discovery failed due to disconnection.

PBL_BT_ERRNO_SERVICE_DISCOVERY_DATABASE_CHANGED 

GATT service discovery was restarted because the remote device changed its GATT database.

Service, characteristic and descriptor references obtained before are invalid. Discovery is restarted automatically.

PBL_BT_ERRNO_INTERNAL_ERROR_BEGIN 

Start of the range of stack errors that could not be mapped to a more meaningful code.

The NimBLE backend reports its error codes added to this value.

PBL_BT_ERRNO_HCI_ERROR_BEGIN 

Start of the range of HCI errors that could not be mapped to a more meaningful code.

PBL_BT_ERRNO_OTHER 

Other, uncategorized error.

Also the highest allowed value: it must fit in 14 bits, the width used for errors in PebbleBLEGATTClientEvent.

◆ pbl_bt_gatt_error

ATT error codes returned by a GATT server for read, write and subscribe operations.

The values up to 0xFF are the codes of the Bluetooth Core Specification, Vol 3, Part F, 3.4.1.1, and the common profile error codes. The values from 0x100 are local errors.

Enumerator
PBL_BT_GATT_ERROR_SUCCESS 

Success.

PBL_BT_GATT_ERROR_INVALID_HANDLE 

The attribute handle is invalid on this server.

PBL_BT_GATT_ERROR_READ_NOT_PERMITTED 

The attribute cannot be read.

PBL_BT_GATT_ERROR_WRITE_NOT_PERMITTED 

The attribute cannot be written.

PBL_BT_GATT_ERROR_INVALID_PDU 

The attribute PDU was invalid.

PBL_BT_GATT_ERROR_INSUFFICIENT_AUTHENTICATION 

The attribute requires authentication.

PBL_BT_GATT_ERROR_REQUEST_NOT_SUPPORTED 

The server does not support the request.

PBL_BT_GATT_ERROR_INVALID_OFFSET 

The offset is past the end of the attribute.

PBL_BT_GATT_ERROR_INSUFFICIENT_AUTHORIZATION 

The attribute requires authorization.

PBL_BT_GATT_ERROR_PREPARE_QUEUE_FULL 

Too many prepare writes have been queued.

PBL_BT_GATT_ERROR_ATTRIBUTE_NOT_FOUND 

No attribute found in the given handle range.

PBL_BT_GATT_ERROR_ATTRIBUTE_NOT_LONG 

The attribute cannot be read with a Read Blob request.

PBL_BT_GATT_ERROR_INSUFFICIENT_ENCRYPTION_KEY_SIZE 

The encryption key size is insufficient.

PBL_BT_GATT_ERROR_INVALID_ATTRIBUTE_VALUE_LENGTH 

The attribute value length is invalid.

PBL_BT_GATT_ERROR_UNLIKELY_ERROR 

The request failed for an unlikely reason.

PBL_BT_GATT_ERROR_INSUFFICIENT_ENCRYPTION 

The attribute requires encryption.

PBL_BT_GATT_ERROR_UNSUPPORTED_GROUP_TYPE 

The attribute type is not a supported grouping attribute.

PBL_BT_GATT_ERROR_INSUFFICIENT_RESOURCES 

The server ran out of resources.

PBL_BT_GATT_ERROR_APPLICATION_SPECIFIC_ERROR_START 

First application specific error code.

PBL_BT_GATT_ERROR_APPLICATION_SPECIFIC_ERROR_END 

Last application specific error code.

PBL_BT_GATT_ERROR_CCCD_IMPROPERLY_CONFIGURED 

A Client Characteristic Configuration Descriptor is improperly configured.

PBL_BT_GATT_ERROR_PROCEDURE_ALREADY_IN_PROGRESS 

A request is already in progress.

PBL_BT_GATT_ERROR_OUT_OF_RANGE 

The value is out of range.

PBL_BT_GATT_ERROR_REQUEST_TIME_OUT 

The request timed out.

PBL_BT_GATT_ERROR_REQUEST_PREPARE_WRITE_DATA_MISMATCH 

The data of a prepared write did not match what was sent.

PBL_BT_GATT_ERROR_LOCAL_INSUFFICIENT_RESOURCES 

The local device ran out of resources.