Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BREAKING] Refactor NimBLEAdvertised device. #700

Merged
merged 1 commit into from
Jul 18, 2024

Conversation

h2zero
Copy link
Owner

@h2zero h2zero commented Jul 12, 2024

  • Construct the device with the parameters from the advertisement in the initialization list.
  • Remove no longer needed methods; setAddress, setAdvType, setRSSI, setSetId, setPrimaryPhy, setSecondaryPhy, setPeriodicInterval.
  • 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.

@h2zero h2zero force-pushed the refactor-advertised-device branch from 77b7a9b to 95b0c5e Compare July 17, 2024 18:41
* 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.
@h2zero h2zero force-pushed the refactor-advertised-device branch from 95b0c5e to 821d510 Compare July 18, 2024 02:29
@h2zero h2zero merged commit f7fd959 into master Jul 18, 2024
31 of 62 checks passed
@h2zero h2zero deleted the refactor-advertised-device branch July 18, 2024 02:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant