use typedef for function
This commit is contained in:
parent
294eef45c6
commit
7e99bafff9
@ -32,11 +32,12 @@ namespace Ha {
|
||||
}
|
||||
};
|
||||
|
||||
typedef void (*onMessage)(const char* msg);
|
||||
struct Command : Component {
|
||||
const char* commandTopic;
|
||||
void (*f)(const char* msg);
|
||||
onMessage f;
|
||||
|
||||
Command(const char* name, const char* uniqueId, const char* configTopic, const char* commandTopic, void (*f)(const char* msg)) : Component(name, uniqueId, configTopic) {
|
||||
Command(const char* name, const char* uniqueId, const char* configTopic, const char* commandTopic, onMessage f) : Component(name, uniqueId, configTopic) {
|
||||
this->commandTopic = commandTopic;
|
||||
this->f = f;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user