Give plugins access to the coordinator IEEE address for unicast bindings
This commit is contained in:
parent
527989fe7c
commit
8749789322
@ -118,6 +118,16 @@ ZigbeeNetwork::State ZigbeeHardwareResourceImplementation::networkState(const QU
|
||||
return network->state();
|
||||
}
|
||||
|
||||
ZigbeeAddress ZigbeeHardwareResourceImplementation::coordinatorAddress(const QUuid &networkUuid)
|
||||
{
|
||||
ZigbeeNetwork *network = m_zigbeeManager->zigbeeNetworks().value(networkUuid);
|
||||
if (!network) {
|
||||
qCWarning(dcZigbeeResource()) << "Network" << networkUuid << "not found.";
|
||||
return ZigbeeAddress();
|
||||
}
|
||||
return network->coordinatorNode()->extendedAddress();
|
||||
}
|
||||
|
||||
void ZigbeeHardwareResourceImplementation::setEnabled(bool enabled)
|
||||
{
|
||||
qCDebug(dcZigbeeResource()) << "Set" << (enabled ? "enabled" : "disabled");
|
||||
|
||||
@ -54,6 +54,7 @@ public:
|
||||
void removeNodeFromNetwork(const QUuid &networkUuid, ZigbeeNode *node) override;
|
||||
|
||||
ZigbeeNetwork::State networkState(const QUuid &networkUuid) override;
|
||||
ZigbeeAddress coordinatorAddress(const QUuid &networkUuid) override;
|
||||
|
||||
public slots:
|
||||
bool enable();
|
||||
|
||||
@ -132,6 +132,10 @@ QPair<ZigbeeManager::ZigbeeError, QUuid> ZigbeeManager::createZigbeeNetwork(cons
|
||||
return QPair<ZigbeeManager::ZigbeeError, QUuid>(ZigbeeManager::ZigbeeErrorAdapterNotAvailable, QUuid());
|
||||
}
|
||||
|
||||
// ZigbeeChannelMask testChannelMask = ZigbeeChannelMask(0);
|
||||
// testChannelMask.setChannel(Zigbee::ZigbeeChannel13);
|
||||
// qCWarning(dcZigbee()) << "Using test channel mask" << testChannelMask;
|
||||
|
||||
ZigbeeNetwork *network = buildNetworkObject(QUuid::createUuid(), backendType);
|
||||
network->setChannelMask(channelMask);
|
||||
network->setSerialPortName(serialPort);
|
||||
@ -452,6 +456,7 @@ void ZigbeeManager::addNetwork(ZigbeeNetwork *network)
|
||||
qCDebug(dcZigbee()) << " Model" << endpoint->modelIdentifier();
|
||||
qCDebug(dcZigbee()) << " Version" << endpoint->softwareBuildId();
|
||||
}
|
||||
|
||||
qCDebug(dcZigbee()) << " Input clusters (" << endpoint->inputClusters().count() << ")";
|
||||
foreach (ZigbeeCluster *cluster, endpoint->inputClusters()) {
|
||||
qCDebug(dcZigbee()) << " -" << cluster;
|
||||
|
||||
@ -59,6 +59,7 @@ public:
|
||||
virtual void removeNodeFromNetwork(const QUuid &networkUuid, ZigbeeNode *node) = 0;
|
||||
|
||||
virtual ZigbeeNetwork::State networkState(const QUuid &networkUuid) = 0;
|
||||
virtual ZigbeeAddress coordinatorAddress(const QUuid &networkUuid) = 0;
|
||||
|
||||
signals:
|
||||
void networkStateChanged(const QUuid &networkUuid, ZigbeeNetwork::State state);
|
||||
|
||||
Reference in New Issue
Block a user