Generic BLE address handling functions.
More...
Generic BLE address handling functions.
|
file | addr.h |
| Interface for the generic BLE address helper functions.
|
|
◆ 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 |