Skip to content

Commit

Permalink
[BREAKING] Refactor NimBLEAdvertised device.
Browse files Browse the repository at this point in the history
* Construct the device with the parameters from the advertisement in the initialization list.
* Removed no longer needed methods; setAddress, setAdvType, setRSSI, setSetId, setPrimaryPhy, setSecondaryPhy, setPeriodicInterval.
* Removed `hasRSSI()` method, the RSSI is always reported so this is redundant.
* Replace setPayload with new method; `update` which will update the device info when new advertisement data is received.
* getPayload now returns `const std::vector<uint8_t>` instead of a pointer to internal memory.
* Added `begin` and `end` read-only iterators for convienience and use in range loops.
* Timestamp removed, if needed then the app should track the time in the callback.
* Consolidate some functions to use getPayloadByType.
* Add optional index parameter to getPayloadByType.
* Change payload indexing to use 0 as the first item.
* Code cleanup and apply const correctness.
  • Loading branch information
h2zero committed Jul 18, 2024
1 parent 6848d27 commit f7fd959
Show file tree
Hide file tree
Showing 3 changed files with 358 additions and 502 deletions.
Loading

0 comments on commit f7fd959

Please sign in to comment.