Generic BLE address handling functions.
More...
Generic BLE address handling functions.
|
file | addr.h |
| Interface for the generic BLE address helper functions.
|
|
|
void | bluetil_addr_swapped_cp (const uint8_t *src, uint8_t *dst) |
| Copy address and swap the byte order in the target buffer.
|
|
void | bluetil_addr_sprint (char *out, const uint8_t *addr) |
| Convert the given BLE address to a human readable string.
|
|
void | bluetil_addr_print (const uint8_t *addr) |
| Print the given BLE address to STDOUT.
|
|
uint8_t * | bluetil_addr_from_str (uint8_t *addr, const char *addr_str) |
| Parse a BLE address from the given string.
|
|
void | bluetil_addr_ipv6_l2ll_sprint (char *out, const uint8_t *addr) |
| Get a string representation of the given BLE addresses IID-based link local address.
|
|
void | bluetil_addr_ipv6_l2ll_print (const uint8_t *addr) |
| Dump the given BLE addresses IPv6 IID-based link local address to STDIO.
|
|
◆ BLUETIL_ADDR_STRLEN
#define BLUETIL_ADDR_STRLEN (18U) |
The length of a BLE address string in bytes (including '\0')
Definition at line 35 of file addr.h.
◆ BLUETIL_IPV6_IID_STRLEN
#define BLUETIL_IPV6_IID_STRLEN (28U) |
The length of an IPv6 IID string in bytes (including '\0')
Definition at line 40 of file addr.h.
◆ bluetil_addr_from_str()
uint8_t * bluetil_addr_from_str |
( |
uint8_t * |
addr, |
|
|
const char * |
addr_str |
|
) |
| |
Parse a BLE address from the given string.
- Note
- The address is expected most significant byte first and is written to
addr
in network byte order
- Parameters
-
[out] | addr | buffer to write the BLE address, must be able to hold BLE_ADDR_LEN bytes |
[in] | addr_str | address string, must be at least of length (BLUETIL_ADDR_STRLEN - 1) |
- Returns
- a pointer to the resulting address on success
-
NULL on parsing error
◆ bluetil_addr_ipv6_l2ll_print()
void bluetil_addr_ipv6_l2ll_print |
( |
const uint8_t * |
addr | ) |
|
Dump the given BLE addresses IPv6 IID-based link local address to STDIO.
- Note
- The address is expected to be in network byte order
- Parameters
-
[in] | addr | generate IID for this address |
◆ bluetil_addr_ipv6_l2ll_sprint()
void bluetil_addr_ipv6_l2ll_sprint |
( |
char * |
out, |
|
|
const uint8_t * |
addr |
|
) |
| |
Get a string representation of the given BLE addresses IID-based link local address.
- Note
- The address is expected to be in network byte order
- Parameters
-
◆ bluetil_addr_print()
void bluetil_addr_print |
( |
const uint8_t * |
addr | ) |
|
Print the given BLE address to STDOUT.
- Note
- The address is expected to be in network byte order
- Parameters
-
[in] | addr | address to print, is expected to hold BLE_ADDR_LEN bytes |
◆ bluetil_addr_sprint()
void bluetil_addr_sprint |
( |
char * |
out, |
|
|
const uint8_t * |
addr |
|
) |
| |
Convert the given BLE address to a human readable string.
- Note
- The address is expected to be in network byte order
- Parameters
-
◆ bluetil_addr_swapped_cp()
void bluetil_addr_swapped_cp |
( |
const uint8_t * |
src, |
|
|
uint8_t * |
dst |
|
) |
| |
Copy address and swap the byte order in the target buffer.
- Parameters
-
[in] | src | buffer with source address, must hold BLE_ADDR_LEN bytes |
[out] | dst | target buffer, must be able to hold BLE_ADDR_LEN bytes |