Fix touchlink issues for fast responding devices
@@ -313,6 +313,8 @@ int DeRestPluginPrivate::resetLight(ApiRequest &req, ApiResponse &rsp)
touchlinkAction = TouchlinkReset;
touchlinkChannel = touchlinkDevice.channel;
+ DBG_Printf(DBG_TLINK, "start touchlink reset for 0x%016llX\n", touchlinkDevice.address.ext());
+
touchlinkDisconnectNetwork();
rsp.httpStatus = HttpStatusOk;
@@ -482,9 +484,17 @@ void DeRestPluginPrivate::sendTouchlinkScanRequest()
touchlinkScanCount++;
if (touchlinkCtrl->sendInterpanRequest(touchlinkReq) == 0)
+ {
+ if (touchlinkAction == TouchlinkIdentify || touchlinkAction == TouchlinkReset)
+ {
+ touchlinkState = TL_WaitScanResponses;
+ touchlinkTimer->start(TL_SCAN_WAIT_TIME);
+ }
+ else
{
touchlinkState = TL_SendingScanRequest;
}
+ }
else
{
DBG_Printf(DBG_TLINK, "touchlink send scan request failed\n");
@@ -631,14 +641,6 @@ void DeRestPluginPrivate::sendTouchlinkConfirm(deCONZ::TouchlinkStatus status)
}
break;
- case TouchlinkIdentify:
- case TouchlinkReset:
- {
- touchlinkState = TL_WaitScanResponses;
- touchlinkTimer->start(TL_SCAN_WAIT_TIME);
- }
- break;
-
default:
{
DBG_Printf(DBG_TLINK, "unknown touchlink action: %d, abort\n", touchlinkAction);
