Added registration of new functions

This commit is contained in:
2026-01-25 18:24:49 +01:00
parent f733bde53f
commit ca45b50b8c
3 changed files with 82 additions and 3 deletions

View File

@@ -39,6 +39,9 @@ void SerialConnector::cycle()
acknowledge(getCheckBitFromIncomming(raw).toInt());
// Dispatch known commands to their handlers if present.
///////////////////////////////////////////
/// Command Dispatcher ///
/////////////////////////////////////////
if (cmd == "CAL-BGN")
{
if (calibrationBeginHandler)
@@ -322,6 +325,9 @@ void SerialConnector::afterSendCheck(String cmd)
}
}
///////////////////////////////////////////
/// Command Handlers Registers ///
/////////////////////////////////////////
void SerialConnector::onCalibrationBegin(void (*handler)(String args))
{
// Register the callback invoked when a CAL-BGN message is received.