Skip to content

Commit

Permalink
Consider frame control direction for sending default response
Browse files Browse the repository at this point in the history
  • Loading branch information
SwoopX committed May 30, 2021
1 parent 1d8b3fe commit eed3dd2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
9 changes: 4 additions & 5 deletions de_web_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12238,7 +12238,7 @@ void DeRestPluginPrivate::queuePollNode(RestNodeBase *node)
pollNodes.push_back(pollItem);
}

void DeRestPluginPrivate::sendZclDefaultResponse(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame, quint8 status)
void DeRestPluginPrivate::sendZclDefaultResponse(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame, quint8 status, bool clientToServer)
{
deCONZ::ApsDataRequest apsReq;

Expand All @@ -12255,10 +12255,9 @@ void DeRestPluginPrivate::sendZclDefaultResponse(const deCONZ::ApsDataIndication
deCONZ::ZclFrame outZclFrame;
outZclFrame.setSequenceNumber(zclFrame.sequenceNumber());
outZclFrame.setCommandId(deCONZ::ZclDefaultResponseId);
outZclFrame.setFrameControl(deCONZ::ZclFCProfileCommand |
deCONZ::ZclFCDirectionClientToServer |
deCONZ::ZclFCDisableDefaultResponse);


if (clientToServer) { outZclFrame.setFrameControl(deCONZ::ZclFCProfileCommand | deCONZ::ZclFCDirectionClientToServer | deCONZ::ZclFCDisableDefaultResponse); }
else { outZclFrame.setFrameControl(deCONZ::ZclFCProfileCommand | deCONZ::ZclFCDirectionServerToClient | deCONZ::ZclFCDisableDefaultResponse); }

if (zclFrame.manufacturerCode_t() != 0x0000_mfcode)
{
Expand Down
2 changes: 1 addition & 1 deletion de_web_plugin_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -1600,7 +1600,7 @@ public Q_SLOTS:
void handleTuyaClusterIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void handleZclAttributeReportIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void handleZclConfigureReportingResponseIndication(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void sendZclDefaultResponse(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame, quint8 status);
void sendZclDefaultResponse(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame, quint8 status, bool clientToServer = true);
void taskToLocalData(const TaskItem &task);
void handleZclAttributeReportIndicationXiaomiSpecial(const deCONZ::ApsDataIndication &ind, deCONZ::ZclFrame &zclFrame);
void queuePollNode(RestNodeBase *node);
Expand Down

0 comments on commit eed3dd2

Please sign in to comment.