Closed finger563 closed 1 month ago
Follow-up: if you're willing to require c++17
(c++20
is default in esp-idf v5), then we can use the concepts
and requires
functionality to clean up the metaprogramming.
Thanks, the problem with this is that it will not work with Arduino String, which is why I used the c_str and length check since those functions are available in std::string and String.
@h2zero I've pushed an update which keeps support for data/size
but will fall back to c_str/length
and finally &v[0]/sizeof(v)
FYI, esp-idf 4.4 reached end of life back in July, so it is no longer supported. Might be worth upgrading your CI to allow the codebase to migrate to more modern standards :)
Looks good to me, thanks!. I'll do some testing then merge shortly.
@h2zero Thanks, I've addressed your comments, hopefully they all pass now :)
Thanks!
Closes #200
Replace test for
c_str()
andlength()
(which only matches a few stl containers), for the more generaldata()
andsize()
check.I tested with this example application and it now works properly:
https://github.com/finger563/nimble-cpp-hid-issue-example/tree/main
Note: I realize I accidentally committed the update to
NimBLEHIDDevice
to expose thereportMap
characteristic. Personally I think it's a good change, but LMK if you want to revert that.