Added registration of new functions
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user