I have the same issue as #13, and found a workaround by adding some code into setup(), but I'd really love to keep PacketSerial fully inside my class. As it stands now, it won't work as 'this' was not captured for this lambda function if I try to setup the lambda function within my class. If I could have the callback return return an optional void* which I setup to point to my class, I could have the callback call a static method in my class.
Please LMK if you'd be interested in supporting this and I can at least prototype how I think it should work, though you might have a better solution than I could come up with. (This is my first time learning about lambda functions let alone trying to use one)
I have the same issue as #13, and found a workaround by adding some code into
setup()
, but I'd really love to keep PacketSerial fully inside my class. As it stands now, it won't work as'this' was not captured for this lambda function
if I try to setup the lambda function within my class. If I could have the callback return return an optionalvoid*
which I setup to point to my class, I could have the callback call a static method in my class.https://wiki.c2.com/?VirtualStaticIdiom
Please LMK if you'd be interested in supporting this and I can at least prototype how I think it should work, though you might have a better solution than I could come up with. (This is my first time learning about lambda functions let alone trying to use one)