mirror of
https://github.com/h2zero/esp-nimble-cpp.git
synced 2024-11-22 13:10:55 +01:00
NimBLEAddress: New constructor added to create blank addresses
* Docuement NimBLEAddress::getNative in migration docs.
This commit is contained in:
parent
9cdf60d360
commit
10acb004dc
3 changed files with 15 additions and 0 deletions
|
@ -47,6 +47,12 @@ For example `BLEAddress addr(11:22:33:44:55:66, 1)` will create the address obje
|
||||||
|
|
||||||
As this paramameter is optional no changes to existing code are needed, it is mentioned here for information.
|
As this paramameter is optional no changes to existing code are needed, it is mentioned here for information.
|
||||||
<br/>
|
<br/>
|
||||||
|
`BLEAddress::getNative` (`NimBLEAddress::getNative`) returns a uint8_t pointer to the native address byte array.
|
||||||
|
In this library the address bytes are stored in reverse order from the original library. This is due to the way
|
||||||
|
the NimBLE stack expects addresses to be presented to it. All other functions such as `toString` are
|
||||||
|
not affected as the endian change is made within them.
|
||||||
|
<br/>
|
||||||
|
|
||||||
<a name="server-api"></a>
|
<a name="server-api"></a>
|
||||||
## Server API
|
## Server API
|
||||||
Creating a `BLEServer` instance is the same as original, no changes required.
|
Creating a `BLEServer` instance is the same as original, no changes required.
|
||||||
|
|
|
@ -37,6 +37,14 @@ NimBLEAddress::NimBLEAddress(ble_addr_t address) {
|
||||||
} // NimBLEAddress
|
} // NimBLEAddress
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Create a blank address, i.e. 00:00:00:00:00:00, type 0.
|
||||||
|
*/
|
||||||
|
NimBLEAddress::NimBLEAddress() {
|
||||||
|
NimBLEAddress("");
|
||||||
|
} // NimBLEAddress
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Create an address from a hex string
|
* @brief Create an address from a hex string
|
||||||
*
|
*
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
*/
|
*/
|
||||||
class NimBLEAddress {
|
class NimBLEAddress {
|
||||||
public:
|
public:
|
||||||
|
NimBLEAddress();
|
||||||
NimBLEAddress(ble_addr_t address);
|
NimBLEAddress(ble_addr_t address);
|
||||||
NimBLEAddress(uint8_t address[6], uint8_t type = BLE_ADDR_PUBLIC);
|
NimBLEAddress(uint8_t address[6], uint8_t type = BLE_ADDR_PUBLIC);
|
||||||
NimBLEAddress(const std::string &stringAddress, uint8_t type = BLE_ADDR_PUBLIC);
|
NimBLEAddress(const std::string &stringAddress, uint8_t type = BLE_ADDR_PUBLIC);
|
||||||
|
|
Loading…
Reference in a new issue