Ignore the coordinator node in the zigbee resource

This commit is contained in:
Simon Stürz 2020-11-19 14:37:44 +01:00
parent 929ef2fb5d
commit 527989fe7c
2 changed files with 19 additions and 0 deletions

View File

@ -169,6 +169,10 @@ void ZigbeeHardwareResourceImplementation::thingsLoaded()
foreach (ZigbeeNetwork *network, m_zigbeeManager->zigbeeNetworks()) {
if (network->state() == ZigbeeNetwork::StateRunning) {
foreach (ZigbeeNode *node, network->nodes()) {
// Ignore the coordinator node
if (node->shortAddress() == 0x0000)
continue;
if (!m_nodeHandlers.contains(node)) {
qCDebug(dcZigbeeResource()) << "Node" << node << "is not yet handled by any plugin. Trying to find a suitable plugin.";
onZigbeeNodeAdded(network->networkUuid(), node);
@ -199,6 +203,10 @@ void ZigbeeHardwareResourceImplementation::onZigbeeNetworkChanged(ZigbeeNetwork
// been installed now, such nodes might be handled by them now.
if (network->state() == ZigbeeNetwork::StateRunning && m_thingsLoaded) {
foreach (ZigbeeNode *node, network->nodes()) {
// Ignore the coordinator node
if (node->shortAddress() == 0x0000)
continue;
if (!m_nodeHandlers.contains(node)) {
onZigbeeNodeAdded(network->networkUuid(), node);
}

View File

@ -299,6 +299,17 @@ void ZigbeeManager::loadZigbeeNetworks()
void ZigbeeManager::checkPlatformConfiguration()
{
/* Example platform configurations
*
* serialPort=/dev/ttymxc2
* baudRate=115200
* backend=nxp
*
* serialPort=/dev/ttyS0
* baudRate=38400
* backend=deconz
*/
QFileInfo platformConfigurationFileInfo(NymeaSettings::settingsPath() + QDir::separator() + "zigbee-platform.conf");
if (platformConfigurationFileInfo.exists()) {
qCDebug(dcZigbee()) << "Found zigbee platform configuration" << platformConfigurationFileInfo.absoluteFilePath();