Improve debug output and add level cluster signals
parent
5901dc06b5
commit
cc725a9533
|
|
@ -141,6 +141,31 @@ void ZigbeeClusterLevelControl::processDataIndication(ZigbeeClusterLibrary::Fram
|
|||
Command command = static_cast<Command>(frame.header.command);
|
||||
qCDebug(dcZigbeeCluster()) << "Command sent from" << m_node << m_endpoint << this << command;
|
||||
emit commandSent(command, frame.payload);
|
||||
|
||||
switch (command) {
|
||||
case CommandStep: {
|
||||
QByteArray payload = frame.payload;
|
||||
QDataStream payloadStream(&payload, QIODevice::ReadOnly);
|
||||
payloadStream.setByteOrder(QDataStream::LittleEndian);
|
||||
quint8 fadeModeValue = 0; quint8 stepSize; quint16 transitionTime;
|
||||
payloadStream >> fadeModeValue >> stepSize >> transitionTime;
|
||||
emit commandStepSent(static_cast<FadeMode>(fadeModeValue), stepSize, transitionTime);
|
||||
break;
|
||||
}
|
||||
case CommandMove: {
|
||||
QByteArray payload = frame.payload;
|
||||
QDataStream payloadStream(&payload, QIODevice::ReadOnly);
|
||||
payloadStream.setByteOrder(QDataStream::LittleEndian);
|
||||
quint8 moveModeValue = 0; quint8 rate;;
|
||||
payloadStream >> moveModeValue >> rate;
|
||||
emit commandMoveSent(static_cast<MoveMode>(moveModeValue), rate);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
qCDebug(dcZigbeeCluster()) << "Command received without special implementation";
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
break;
|
||||
case Server:
|
||||
|
|
|
|||
|
|
@ -107,7 +107,8 @@ protected:
|
|||
signals:
|
||||
void currentLevelChanged(quint8 level);
|
||||
void commandSent(ZigbeeClusterLevelControl::Command command, const QByteArray ¶meter = QByteArray());
|
||||
|
||||
void commandMoveSent(MoveMode moveMode, quint8 rate = 0xff);
|
||||
void commandStepSent(FadeMode fadeMode, quint8 stepSize, quint16 transitionTime);
|
||||
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -125,6 +125,15 @@ void ZigbeeClusterOnOff::processDataIndication(ZigbeeClusterLibrary::Frame frame
|
|||
case CommandToggle:
|
||||
emit commandSent(CommandToggle);
|
||||
break;
|
||||
case CommandOffWithEffect: {
|
||||
QByteArray payload = frame.payload;
|
||||
QDataStream payloadStream(&payload, QIODevice::ReadOnly);
|
||||
payloadStream.setByteOrder(QDataStream::LittleEndian);
|
||||
quint8 effectValue = 0; quint16 effectVariant;
|
||||
payloadStream >> effectValue >> effectVariant;
|
||||
emit commandOffWithEffectSent(static_cast<Effect>(effectValue), effectVariant);
|
||||
break;
|
||||
}
|
||||
case CommandOnWithTimedOff: {
|
||||
QByteArray payload = frame.payload;
|
||||
QDataStream payloadStream(&payload, QIODevice::ReadOnly);
|
||||
|
|
|
|||
|
|
@ -97,6 +97,9 @@ signals:
|
|||
void commandSent(Command command);
|
||||
// On and off time is in 1/10 seconds
|
||||
void commandOnWithTimedOffSent(bool acceptOnlyWhenOn, quint16 onTime, quint16 offTime);
|
||||
|
||||
// On and off time is in 1/10 seconds
|
||||
void commandOffWithEffectSent(Effect effect, quint8 effectVariant);
|
||||
};
|
||||
|
||||
#endif // ZIGBEECLUSTERONOFF_H
|
||||
|
|
|
|||
|
|
@ -273,6 +273,7 @@ public:
|
|||
Cirronet = 0x1000,
|
||||
Chipcon = 0x1001,
|
||||
Ember = 0x1003,
|
||||
Philips = 0x100b,
|
||||
Ikea = 0x117C,
|
||||
FeiBit = 0x117E
|
||||
};
|
||||
|
|
|
|||
|
|
@ -669,6 +669,6 @@ QDebug operator<<(QDebug debug, ZigbeeNetwork *network)
|
|||
<< network->backendType() << ", "
|
||||
<< "Channel: " << network->channel() << ", "
|
||||
<< network->state()
|
||||
<< ") ";
|
||||
return debug.space();
|
||||
<< ")";
|
||||
return debug.space().quote();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -721,6 +721,7 @@ QDebug operator<<(QDebug debug, ZigbeeNode *node)
|
|||
{
|
||||
debug.nospace().noquote() << "ZigbeeNode(" << ZigbeeUtils::convertUint16ToHexString(node->shortAddress());
|
||||
debug.nospace().noquote() << ", " << node->extendedAddress().toString();
|
||||
debug.nospace().noquote() << ", RX on:" << node->macCapabilities().receiverOnWhenIdle;
|
||||
debug.nospace().noquote() << ")";
|
||||
return debug.space().quote();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -303,6 +303,6 @@ QDebug operator<<(QDebug debug, ZigbeeNodeEndpoint *endpoint)
|
|||
debug.nospace().noquote() << ", " << static_cast<Zigbee::GreenPowerDevice>(endpoint->deviceId());
|
||||
}
|
||||
|
||||
debug.nospace().noquote() << ") ";
|
||||
return debug;
|
||||
debug.nospace().noquote() << ")";
|
||||
return debug.space().quote();
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue