31 static bool notifiedUnavailable =
false;
32 static bool notifiedAvailable =
false;
34 auto controller =
controls[handle.ref.index].controller;
37 if (!notifiedUnavailable) {
38 LOGP(info,
"Controller for {} not yet available.",
specs[handle.ref.index].id);
39 notifiedUnavailable =
true;
43 if (notifiedUnavailable && !notifiedAvailable) {
44 LOGP(info,
"Controller for {} now available.",
specs[handle.ref.index].id);
45 notifiedAvailable =
true;
47 controller->write(handle.message.c_str(), handle.message.size());
51 return this->
controls[handle.ref.index].controller !=
nullptr;
53 auto it = std::remove_if(
messages.begin(),
messages.end(), checkIfController);
54 auto r = std::distance(it,
messages.end());