Stack independent helpers for Bluetooth devices, UUIDs and pairing data (lib/btutil).
More...
Stack independent helpers for Bluetooth devices, UUIDs and pairing data (lib/btutil).
}
Remote Bluetooth device, as exposed to applications.
Definition types.h:302
Bluetooth device address.
Definition types.h:251
#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
Uuid bt_uuid_expand_16bit(uint16_t uuid16)
Expand a 16-bit UUID with the Bluetooth Base UUID, 0000xxxx-0000-1000-8000-00805F9B34FB.
bool bt_device_is_invalid(const struct pbl_bt_device *device)
Check whether a device is invalid, such as one returned by an API that found no device.
struct pbl_bt_addr bt_device_get_address(struct pbl_bt_device device)
Get the address of a device.
struct pbl_bt_device bt_device_init_with_address(struct pbl_bt_addr address, bool is_random)
Create an LE device from its address.
#define PBL_LOG_DBG(fmt,...)
Log a routine debug message, possibly queued.
Definition logging.h:570
A 128-bit UUID, with its bytes in the order they are written in string form.
Definition uuid.h:32
◆ bt_device_address_equal()
Compare two addresses.
- Parameters
-
| addr1 | First address, may be NULL. |
| addr2 | Second address, may be NULL. |
- Returns
- true if both are non-NULL and equal.
◆ bt_device_address_is_invalid()
| bool bt_device_address_is_invalid |
( |
const struct pbl_bt_addr * |
addr | ) |
|
Check whether an address is invalid.
- Parameters
-
| addr | The address, may be NULL. |
- Returns
- true if
addr is NULL or all zeros.
◆ bt_device_equal()
Compare two devices, see bt_device_internal_equal().
- Parameters
-
| device1 | First device, may be NULL. |
| device2 | Second device, may be NULL. |
- Returns
- true if both are non-NULL and refer to the same device.
◆ bt_device_get_address()
Get the address of a device.
- Parameters
-
- Returns
- The address.
◆ bt_device_init_with_address()
Create an LE device from its address.
- Parameters
-
| address | The address. |
| is_random | true for a random address, false for the public address (BD_ADDR). |
- Returns
- The device.
◆ bt_device_internal_equal()
Compare two devices: address, address type and transport.
- Parameters
-
| device1_int | First device, may be NULL. |
| device2_int | Second device, may be NULL. |
- Returns
- true if both are non-NULL and refer to the same device.
◆ bt_device_is_invalid()
Check whether a device is invalid, such as one returned by an API that found no device.
- Parameters
-
- Returns
- true if
device equals PBL_BT_DEVICE_INVALID.