NimBLE-Arduino 1.4.2
|
A BLE device address. More...
#include <NimBLEAddress.h>
Public Member Functions | |
NimBLEAddress () | |
Create a blank address, i.e. 00:00:00:00:00:00, type 0. | |
NimBLEAddress (ble_addr_t address) | |
Create an address from the native NimBLE representation. More... | |
NimBLEAddress (uint8_t address[6], uint8_t type=BLE_ADDR_PUBLIC) | |
Constructor for compatibility with bluedroid esp library using native ESP representation. More... | |
NimBLEAddress (const std::string &stringAddress, uint8_t type=BLE_ADDR_PUBLIC) | |
Create an address from a hex string. More... | |
NimBLEAddress (const uint64_t &address, uint8_t type=BLE_ADDR_PUBLIC) | |
Constructor for address using a hex value. Use the same byte order, so use 0xa4c1385def16 for "a4:c1:38:5d:ef:16". More... | |
bool | equals (const NimBLEAddress &otherAddress) const |
Determine if this address equals another. More... | |
const uint8_t * | getNative () const |
Get the native representation of the address. More... | |
std::string | toString () const |
Convert a BLE address to a string. More... | |
uint8_t | getType () const |
Get the address type. More... | |
bool | operator== (const NimBLEAddress &rhs) const |
Convenience operator to check if this address is equal to another. | |
bool | operator!= (const NimBLEAddress &rhs) const |
Convenience operator to check if this address is not equal to another. | |
operator std::string () const | |
Convienience operator to convert this address to string representation. More... | |
operator uint64_t () const | |
Convenience operator to convert the native address representation to uint_64. | |
A BLE device address.
Every BLE device has a unique address which can be used to identify it and form connections.
NimBLEAddress::NimBLEAddress | ( | ble_addr_t | address | ) |
Create an address from the native NimBLE representation.
[in] | address | The native NimBLE address. |
NimBLEAddress::NimBLEAddress | ( | uint8_t | address[6], |
uint8_t | type = BLE_ADDR_PUBLIC |
||
) |
Constructor for compatibility with bluedroid esp library using native ESP representation.
[in] | address | A uint8_t[6] or esp_bd_addr_t containing the address. |
[in] | type | The type of the address. |
NimBLEAddress::NimBLEAddress | ( | const std::string & | stringAddress, |
uint8_t | type = BLE_ADDR_PUBLIC |
||
) |
Create an address from a hex string.
A hex string is of the format:
which is 17 characters in length.
[in] | stringAddress | The hex string representation of the address. |
[in] | type | The type of the address. |
NimBLEAddress::NimBLEAddress | ( | const uint64_t & | address, |
uint8_t | type = BLE_ADDR_PUBLIC |
||
) |
Constructor for address using a hex value.
Use the same byte order, so use 0xa4c1385def16 for "a4:c1:38:5d:ef:16".
[in] | address | uint64_t containing the address. |
[in] | type | The type of the address. |
bool NimBLEAddress::equals | ( | const NimBLEAddress & | otherAddress | ) | const |
Determine if this address equals another.
[in] | otherAddress | The other address to compare against. |
const uint8_t * NimBLEAddress::getNative | ( | ) | const |
Get the native representation of the address.
uint8_t NimBLEAddress::getType | ( | ) | const |
Get the address type.
NimBLEAddress::operator std::string | ( | ) | const |
Convienience operator to convert this address to string representation.
This allows passing NimBLEAddress to functions that accept std::string and/or or it's methods as a parameter.
std::string NimBLEAddress::toString | ( | ) | const |
Convert a BLE address to a string.
A string representation of an address is in the format: