Commit graph

11 commits

Author SHA1 Message Date
h2zero
6279817143 [BREAKING] Refactor NimBLEAddress - use NimBLE core representation.
This simplifies the NimBLEAddress code by directly using the NimBLE core `ble_addr_t` type to hold the address
and allows using NimBLE core functions and macros to replace code in some methods.

* `getNative()` replaced with `getBase()` and now returns a pointer to `const ble_addr_t` instead of a pointer to the address value.
* Adds `isNrpa()` method to test if an address is random non-resolvable.
* Adds `isStatic()` method to test if an address is random static.
* Adds `isPublic()` method to test if an address is a public address.
* Adds `isNull()` methods to test if an address is NULL.
* Adds `getValue()` method which returns a read-only pointer to the address value.
* Adds `reverseByteOrder()` method which will reverse the byte order of the address value.
* `equals()` method and == operator will now also test if the address types are the same.
* Code cleanup.
2024-07-17 19:38:35 -06:00
h2zero
c156b0202c Add isRpa method to NimBLEAddress.
This provides and easy way to check if the peer address is a Resolvable Private Address.
2024-06-12 21:12:09 -06:00
h2zero
ccea428b9e Refactor include directives to use different paths for arduino/idf.
* Sets macros to allow compiling when Central role is enabled and Observer disabled, or Peripheral enabled and Broadcaster disabled.

* Adds a macro definition for CONFIG_NIMBLE_CPP_IDF to enable different include paths/functionality for IDF / Arduino.
2021-09-12 18:43:31 -06:00
h2zero
10acb004dc NimBLEAddress: New constructor added to create blank addresses
* Docuement NimBLEAddress::getNative in migration docs.
2020-09-02 14:52:34 -06:00
h2zero
1a5beaa7c0
Store address type in NimBLEAddress. (#25) 2020-07-30 14:57:47 -06:00
h2zero
afb2f8d4c7 Add uint64_t cast of an address 2020-06-19 12:32:57 -06:00
h2zero
32e1022e67 Correct error in creation of NimBLEAddress from six bytes in a std::string
* Add creation of a NimBLEAddress from a std::string of 6 exactly bytes.

* Add creation of a NimBLEAddress from an empty string.
2020-05-18 10:11:54 -06:00
h2zero
03cb7b21d9 Conditionally compile code for specific roles.
This allows NimBLE options in menuconfig to reduce code size based on
the roles selected (scan/advertising/central/peripheral).

Significant code space can be saved by removing unnecessary roles for the application.
2020-05-13 22:03:56 -06:00
h2zero
f0191eb1e6 Add ==,!= operators to NimBLEAddress, pass parameters by const reference. 2020-05-10 07:21:46 -06:00
h2zero
1779a3f723 Bugfixes + add new NimBLEUUID constructor. 2020-05-03 13:50:49 -06:00
h2zero
5d4332e945 Initial commit. 2020-03-29 17:44:20 -06:00