Skip to content

Conversation

@afpineda
Copy link
Contributor

This fix is related to Issue #805 in the NimBLEHIDDevice class.

What fixes:

  • The user can call getXXXXXReport() in any order.
  • The user gets a different characteristic for each different reportID.
  • The user gets the same characteristic for the same reportID.

Fix description:

A new private method is introduced: locateReportCharacteristicById(): given a reportID, it returns the characteristic if already created, nullptr otherwise.
getXXXXXReport() tries to locate the characteristic. If found, it is returned "as is". If not found, it is created and returned.

Drawbacks:
There is a computational overhead. The user should store/cache the value returned by getXXXXXReport() instead of repeating the calls. Perhaps we should warn about this in the documentation.

Arduino IDE requires this file when developing an Arduino library, but that file must not be included in the release.
@h2zero
Copy link
Owner

h2zero commented Dec 17, 2024

#805 (comment)

Copy link
Owner

@h2zero h2zero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just a minor comment. Also can you please check the formatting, if in vscode you can just right click and format document.

@afpineda
Copy link
Contributor Author

Also can you please check the formatting, if in vscode you can just right click and format document.

Done.

@h2zero h2zero merged commit 462f918 into h2zero:master Dec 19, 2024
31 checks passed
@h2zero
Copy link
Owner

h2zero commented Dec 19, 2024

Thank you @afpineda !

h2zero pushed a commit that referenced this pull request Dec 22, 2024
…ture report + temporal coupling (#812)

* Add ".development" to gitignore

Arduino IDE requires this file when developing an Arduino library, but that file must not be included in the release.

* Fix get Input/Output/Feature Report
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.

2 participants