Skip to content

T_NOTIFICATION_METHOD callback class enhanced to support non-static methods for context. #156

@Makuna

Description

@Makuna

Users requested that the callback be made on an instance of class so they can provide context.

Notes:
See T_SERIAL_METHOD for a way to define and pass an instance.
Another option for backward compatibility is to provide a default implementation with static callbacks like today but it manages a singleton object instance that it then calls onto.
Provide an empty implementation so that there is no need for the sketch author to even provide one. Update samples to remove it from the simplest.

typedef DfMp3Notify<MyClass> Mp3Notify;
typedef DFMiniMp3<HardwareSerial, Mp3Notify> DfMp3;

...
MyClass myInstance;
Mp3Notify::SetInstances(myInstance);

Metadata

Metadata

Assignees

Labels

enhancementpendingapplied to repo but not in a release yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions