zigbee-herdsman 0.36.0 → 0.36.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.release-please-manifest.json +1 -1
- package/CHANGELOG.md +15 -0
- package/dist/adapter/ember/adapter/emberAdapter.d.ts +0 -15
- package/dist/adapter/ember/adapter/emberAdapter.d.ts.map +1 -1
- package/dist/adapter/ember/adapter/emberAdapter.js +31 -128
- package/dist/adapter/ember/adapter/emberAdapter.js.map +1 -1
- package/dist/adapter/ember/adapter/endpoints.d.ts +5 -3
- package/dist/adapter/ember/adapter/endpoints.d.ts.map +1 -1
- package/dist/adapter/ember/adapter/endpoints.js +4 -0
- package/dist/adapter/ember/adapter/endpoints.js.map +1 -1
- package/dist/adapter/ember/enums.d.ts +12 -14
- package/dist/adapter/ember/enums.d.ts.map +1 -1
- package/dist/adapter/ember/enums.js +12 -14
- package/dist/adapter/ember/enums.js.map +1 -1
- package/dist/adapter/ember/types.d.ts +9 -9
- package/dist/adapter/ember/types.d.ts.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.36.2](https://github.com/Koenkk/zigbee-herdsman/compare/v0.36.1...v0.36.2) (2024-03-08)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* Ember: Reworked multicast registration on coordinator ([#959](https://github.com/Koenkk/zigbee-herdsman/issues/959)) ([1f9ada9](https://github.com/Koenkk/zigbee-herdsman/commit/1f9ada9ba7a45417118a27140434ceb6c8feef6e))
|
|
9
|
+
|
|
10
|
+
## [0.36.1](https://github.com/Koenkk/zigbee-herdsman/compare/v0.36.0...v0.36.1) (2024-03-07)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* Ember: fix coordinator-only permit join ([#958](https://github.com/Koenkk/zigbee-herdsman/issues/958)) ([836f35c](https://github.com/Koenkk/zigbee-herdsman/commit/836f35c534f8f958570d3e1cf6ef8edf35bde573))
|
|
16
|
+
* Ember: ZDO Match logging for req/rsp ([#956](https://github.com/Koenkk/zigbee-herdsman/issues/956)) ([8ed75ff](https://github.com/Koenkk/zigbee-herdsman/commit/8ed75ffd68366ae7b183995ececc32ffd4485820))
|
|
17
|
+
|
|
3
18
|
## [0.36.0](https://github.com/Koenkk/zigbee-herdsman/compare/v0.35.3...v0.36.0) (2024-03-05)
|
|
4
19
|
|
|
5
20
|
|
|
@@ -52,11 +52,6 @@ export declare class EmberAdapter extends Adapter {
|
|
|
52
52
|
*/
|
|
53
53
|
private networkCache;
|
|
54
54
|
private defaultApsOptions;
|
|
55
|
-
/**
|
|
56
|
-
* Mirrors the NCP multicast table. null === not in use.
|
|
57
|
-
* Index 0 is Green Power and must always remain there.
|
|
58
|
-
*/
|
|
59
|
-
private multicastTable;
|
|
60
55
|
constructor(networkOptions: TsType.NetworkOptions, serialPortOptions: TsType.SerialPortOptions, backupPath: string, adapterOptions: TsType.AdapterOptions, logger?: LoggerStub);
|
|
61
56
|
/**
|
|
62
57
|
* Emitted from @see Ezsp.ezspStackStatusHandler
|
|
@@ -217,16 +212,6 @@ export declare class EmberAdapter extends Adapter {
|
|
|
217
212
|
* Called right after a NCP reset, right before the creation of endpoints.
|
|
218
213
|
*/
|
|
219
214
|
private onNCPPostReset;
|
|
220
|
-
/**
|
|
221
|
-
* Handle changes in groups that needs to be propagated to the NCP multicast table.
|
|
222
|
-
*
|
|
223
|
-
* XXX: Since Z2M doesn't explicitly check-in downstream when groups are created/removed, we look at outgoing genGroups commands.
|
|
224
|
-
* If the NCP doesn't know about groups, it can miss messages from some devices (remotes for example), so we add it...
|
|
225
|
-
*
|
|
226
|
-
* @param commandId
|
|
227
|
-
* @param groupId
|
|
228
|
-
*/
|
|
229
|
-
private onGroupChange;
|
|
230
215
|
/**
|
|
231
216
|
* Clear the cached network values (set to invalid values).
|
|
232
217
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"emberAdapter.d.ts","sourceRoot":"","sources":["../../../../src/adapter/ember/adapter/emberAdapter.ts"],"names":[],"mappings":";AAOA,OAAO,EAAC,OAAO,EAAE,MAAM,EAAC,MAAM,OAAO,CAAC;AACtC,OAAO,EAAC,UAAU,EAAC,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAC,MAAM,EAAuB,MAAM,iBAAiB,CAAC;AAC7D,OAAO,EAAC,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAa,MAAM,cAAc,CAAC;AAExE,OAAO,EAMH,cAAc,EACjB,MAAM,cAAc,CAAC;AAkBtB,OAAO,EASH,kBAAkB,EAgBrB,MAAM,UAAU,CAAC;AAClB,OAAO,EAGH,UAAU,EACV,kBAAkB,EAElB,YAAY,EAIZ,sBAAsB,EACtB,WAAW,EACX,UAAU,EAKb,MAAM,UAAU,CAAC;AAiFlB,MAAM,MAAM,YAAY,GAAG;IAEvB,KAAK,EAAE,UAAU,CAAC;IAClB,UAAU,EAAE,sBAAsB,CAAC;IACnC,MAAM,EAAE,kBAAkB,CAAC;CAE9B,CAAC;AAuCF;;;;;GAKG;AACH,KAAK,iBAAiB,GAAG;IACrB,WAAW,EAAE,UAAU,CAAC;IACxB,GAAG,EAAE,YAAY,CAAC;IAClB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;CAChC,CAAC;AAyLF;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,OAAO;IACrC,2BAA2B;IAC3B,SAAgB,WAAW,EAAE,SAAS,GAAG,SAAS,CAAC;IACnD,iEAAiE;IACjE,OAAO,CAAC,gBAAgB,CAAS;IAEjC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAO;IAC5B,OAAO,CAAC,OAAO,CAAkD;IAEjE,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoB;IACjD,OAAO,CAAC,QAAQ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,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA4D9F,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IA2BlD,8BAA8B,CAAC,QAAQ,EAAE,QAAQ,EAAE,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAwCtF,6BAA6B,CAAC,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC;IAmE3F,sBAAsB,IAAI,OAAO,CAAC,IAAI,CAAC;IA4BpD,OAAO,CAAC,iBAAiB;CAS5B"}
|
|
@@ -160,7 +160,7 @@ const STACK_CONFIGS = {
|
|
|
160
160
|
/** <0-255> (Default: 0) @see EzspConfigId.SOURCE_ROUTE_TABLE_SIZE */
|
|
161
161
|
SOURCE_ROUTE_TABLE_SIZE: 200, // Z3GatewayGPCombo: 100, darkxst: 200
|
|
162
162
|
/** <1-250> (Default: 8) @see EzspConfigId.MULTICAST_TABLE_SIZE */
|
|
163
|
-
MULTICAST_TABLE_SIZE: 16, // darkxst: 16
|
|
163
|
+
MULTICAST_TABLE_SIZE: 16, // darkxst: 16, NOTE: should always be at least enough to register FIXED_ENDPOINTS multicastIds
|
|
164
164
|
},
|
|
165
165
|
"zigbeed": {
|
|
166
166
|
ADDRESS_TABLE_SIZE: 128,
|
|
@@ -239,11 +239,6 @@ class EmberAdapter extends __1.Adapter {
|
|
|
239
239
|
*/
|
|
240
240
|
networkCache;
|
|
241
241
|
defaultApsOptions;
|
|
242
|
-
/**
|
|
243
|
-
* Mirrors the NCP multicast table. null === not in use.
|
|
244
|
-
* Index 0 is Green Power and must always remain there.
|
|
245
|
-
*/
|
|
246
|
-
multicastTable;
|
|
247
242
|
constructor(networkOptions, serialPortOptions, backupPath, adapterOptions, logger) {
|
|
248
243
|
super(networkOptions, serialPortOptions, backupPath, adapterOptions, logger);
|
|
249
244
|
// TODO config, should be fine like this for now?
|
|
@@ -512,8 +507,6 @@ class EmberAdapter extends __1.Adapter {
|
|
|
512
507
|
this.interpanLock = false;
|
|
513
508
|
this.networkCache = (0, initters_1.initNetworkCache)();
|
|
514
509
|
this.defaultApsOptions = (enums_2.EmberApsOption.RETRY | enums_2.EmberApsOption.ENABLE_ROUTE_DISCOVERY | enums_2.EmberApsOption.ENABLE_ADDRESS_DISCOVERY);
|
|
515
|
-
// always at least length==1 because of allowed MULTICAST_TABLE_SIZE range
|
|
516
|
-
this.multicastTable = new Array(STACK_CONFIGS[this.stackConfig].MULTICAST_TABLE_SIZE).fill(null);
|
|
517
510
|
this.ezsp.once(ezsp_1.EzspEvents.ncpNeedsResetAndInit, this.onNcpNeedsResetAndInit.bind(this));
|
|
518
511
|
}
|
|
519
512
|
/**
|
|
@@ -648,6 +641,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
648
641
|
* Register fixed endpoints and set any related multicast entries that need to be.
|
|
649
642
|
*/
|
|
650
643
|
async registerFixedEndpoints() {
|
|
644
|
+
let mcTableIdx = 0;
|
|
651
645
|
for (const ep of endpoints_1.FIXED_ENDPOINTS) {
|
|
652
646
|
if (ep.networkIndex !== 0x00) {
|
|
653
647
|
debug(`Multi-network not currently supported. Skipping endpoint ${JSON.stringify(ep)}.`);
|
|
@@ -658,7 +652,8 @@ class EmberAdapter extends __1.Adapter {
|
|
|
658
652
|
if (epStatus !== enums_2.EzspStatus.SUCCESS) {
|
|
659
653
|
// check to see if ezspAddEndpoint needs to be called
|
|
660
654
|
// if ezspInit is called without NCP reset, ezspAddEndpoint is not necessary and will return an error
|
|
661
|
-
const status = (await this.ezsp.ezspAddEndpoint(ep.endpoint, ep.profileId, ep.deviceId, ep.deviceVersion, ep.inClusterList,
|
|
655
|
+
const status = (await this.ezsp.ezspAddEndpoint(ep.endpoint, ep.profileId, ep.deviceId, ep.deviceVersion, ep.inClusterList.slice(), // copy
|
|
656
|
+
ep.outClusterList.slice()));
|
|
662
657
|
if (status === enums_2.EzspStatus.SUCCESS) {
|
|
663
658
|
debug(`Registered endpoint "${ep.endpoint}" with status=${enums_2.EzspStatus[status]}.`);
|
|
664
659
|
}
|
|
@@ -669,19 +664,17 @@ class EmberAdapter extends __1.Adapter {
|
|
|
669
664
|
else {
|
|
670
665
|
debug(`Endpoint "${ep.endpoint}" already registered.`);
|
|
671
666
|
}
|
|
672
|
-
|
|
673
|
-
const
|
|
674
|
-
multicastId
|
|
667
|
+
for (const multicastId of ep.multicastIds) {
|
|
668
|
+
const multicastEntry = {
|
|
669
|
+
multicastId,
|
|
675
670
|
endpoint: ep.endpoint,
|
|
676
671
|
networkIndex: ep.networkIndex,
|
|
677
672
|
};
|
|
678
|
-
const status = (await this.ezsp.ezspSetMulticastTableEntry(
|
|
673
|
+
const status = (await this.ezsp.ezspSetMulticastTableEntry(mcTableIdx++, multicastEntry));
|
|
679
674
|
if (status !== enums_2.EmberStatus.SUCCESS) {
|
|
680
|
-
throw new Error(`Failed to register group "
|
|
675
|
+
throw new Error(`Failed to register group "${multicastId}" in multicast table with status=${enums_2.EmberStatus[status]}.`);
|
|
681
676
|
}
|
|
682
|
-
|
|
683
|
-
this.multicastTable[0] = gpMulticastEntry;
|
|
684
|
-
debug(`Registered multicast table entry: ${JSON.stringify(gpMulticastEntry)}.`);
|
|
677
|
+
debug(`Registered multicast table entry: ${JSON.stringify(multicastEntry)}.`);
|
|
685
678
|
}
|
|
686
679
|
}
|
|
687
680
|
}
|
|
@@ -1060,93 +1053,6 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1060
1053
|
this.requestQueue.startDispatching();
|
|
1061
1054
|
this.watchdogCountersHandle = setInterval(this.watchdogCounters.bind(this), WATCHDOG_COUNTERS_FEED_INTERVAL);
|
|
1062
1055
|
}
|
|
1063
|
-
/**
|
|
1064
|
-
* Handle changes in groups that needs to be propagated to the NCP multicast table.
|
|
1065
|
-
*
|
|
1066
|
-
* XXX: Since Z2M doesn't explicitly check-in downstream when groups are created/removed, we look at outgoing genGroups commands.
|
|
1067
|
-
* If the NCP doesn't know about groups, it can miss messages from some devices (remotes for example), so we add it...
|
|
1068
|
-
*
|
|
1069
|
-
* @param commandId
|
|
1070
|
-
* @param groupId
|
|
1071
|
-
*/
|
|
1072
|
-
async onGroupChange(commandId, groupId) {
|
|
1073
|
-
switch (commandId) {
|
|
1074
|
-
case cluster_1.default.genGroups.commands.add.ID: {
|
|
1075
|
-
// check if group already in multicast table, should not happen...
|
|
1076
|
-
const existingIndex = this.multicastTable.findIndex((e) => ((e != null) && (e.multicastId === groupId)));
|
|
1077
|
-
if (existingIndex == -1) {
|
|
1078
|
-
// find first unused index
|
|
1079
|
-
const newEntryIndex = this.multicastTable.findIndex((e) => (!e));
|
|
1080
|
-
if (newEntryIndex != -1) {
|
|
1081
|
-
const newEntry = {
|
|
1082
|
-
multicastId: groupId,
|
|
1083
|
-
endpoint: endpoints_1.FIXED_ENDPOINTS[0].endpoint,
|
|
1084
|
-
networkIndex: endpoints_1.FIXED_ENDPOINTS[0].networkIndex,
|
|
1085
|
-
};
|
|
1086
|
-
const status = (await this.ezsp.ezspSetMulticastTableEntry(newEntryIndex, newEntry));
|
|
1087
|
-
if (status !== enums_2.EmberStatus.SUCCESS) {
|
|
1088
|
-
console.error(`Failed to register group "${groupId}" in multicast table at index "${newEntryIndex}" with status=${enums_2.EmberStatus[status]}.`);
|
|
1089
|
-
}
|
|
1090
|
-
else {
|
|
1091
|
-
debug(`Registered multicast table entry: ${JSON.stringify(newEntry)}.`);
|
|
1092
|
-
}
|
|
1093
|
-
// always assume "it worked" to keep sync with Z2M first, NCP second, otherwise trouble might arise... should always work anyway
|
|
1094
|
-
this.multicastTable[newEntryIndex] = newEntry;
|
|
1095
|
-
}
|
|
1096
|
-
else {
|
|
1097
|
-
console.warn(`Coordinator multicast table is full (max: ${STACK_CONFIGS[this.stackConfig].MULTICAST_TABLE_SIZE}). `
|
|
1098
|
-
+ `Some devices in new groups may not work properly, including in group "${groupId}". `
|
|
1099
|
-
+ `If that happens, please remove groups to be below the limit. `
|
|
1100
|
-
+ `Removed groups are only removed from coordinator after a Zigbee2MQTT restart.`);
|
|
1101
|
-
}
|
|
1102
|
-
}
|
|
1103
|
-
else {
|
|
1104
|
-
debug(`Added group "${groupId}", but local table says it is already registered at index "${existingIndex}". Skipping.`);
|
|
1105
|
-
}
|
|
1106
|
-
break;
|
|
1107
|
-
}
|
|
1108
|
-
// NOTE: Can't remove groups, since we watch from command exec to group members, that would trigger from any removed member,
|
|
1109
|
-
// even though the group might still exist...
|
|
1110
|
-
// Leaving this here (since it's done...), just in case we get better notifications for groups from upstream.
|
|
1111
|
-
// case Cluster.genGroups.commands.remove.ID: {
|
|
1112
|
-
// const entryIndex = this.multicastTable.findIndex((e) => ((e != null) && (e.multicastId === groupId)));
|
|
1113
|
-
// // just in case, never remove GP at i zero, should never be the case...
|
|
1114
|
-
// if (entryIndex > 0) {
|
|
1115
|
-
// const entry = this.multicastTable[entryIndex];
|
|
1116
|
-
// entry.endpoint = 0;// signals "not in use" in the stack
|
|
1117
|
-
// const status = (await this.ezsp.ezspSetMulticastTableEntry(entryIndex, entry));
|
|
1118
|
-
// if (status !== EmberStatus.SUCCESS) {
|
|
1119
|
-
// console.error(`Failed to remove multicast table entry at index "${entryIndex}" for group "${groupId}".`);
|
|
1120
|
-
// } else {
|
|
1121
|
-
// debug(`Removed multicast table entry at index "${entryIndex}".`);
|
|
1122
|
-
// }
|
|
1123
|
-
// // always assume "it worked" to keep sync with Z2M first, NCP second, otherwise trouble might arise... should always work anyway
|
|
1124
|
-
// this.multicastTable[entryIndex] = null;
|
|
1125
|
-
// } else {
|
|
1126
|
-
// debug(`Removed group "${groupId}", but local table did not have a reference to it.`);
|
|
1127
|
-
// }
|
|
1128
|
-
// break;
|
|
1129
|
-
// }
|
|
1130
|
-
// case Cluster.genGroups.commands.removeAll.ID: {
|
|
1131
|
-
// // this can create quite a few NCP calls, but hopefully shouldn't happen often
|
|
1132
|
-
// // always skip green power at i==0
|
|
1133
|
-
// for (let i = 1; i < this.multicastTable.length; i++) {
|
|
1134
|
-
// const entry = this.multicastTable[i];
|
|
1135
|
-
// if (entry != null) {
|
|
1136
|
-
// entry.endpoint = 0;// signals "not in use" in the stack
|
|
1137
|
-
// const status = (await this.ezsp.ezspSetMulticastTableEntry(i, entry));
|
|
1138
|
-
// if (status !== EmberStatus.SUCCESS) {
|
|
1139
|
-
// console.error(`Failed to remove multicast entry at index "${i}" with status=${EmberStatus[status]}.`);
|
|
1140
|
-
// } else {
|
|
1141
|
-
// debug(`Removed multicast table entry at index "${i}".`);
|
|
1142
|
-
// }
|
|
1143
|
-
// }
|
|
1144
|
-
// this.multicastTable[i] = null;
|
|
1145
|
-
// }
|
|
1146
|
-
// break;
|
|
1147
|
-
// }
|
|
1148
|
-
}
|
|
1149
|
-
}
|
|
1150
1056
|
//---- START Events
|
|
1151
1057
|
//---- END Events
|
|
1152
1058
|
//---- START Cache-enabled EZSP wrappers
|
|
@@ -1646,7 +1552,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1646
1552
|
this.zdoRequestBuffalo.writeListUInt16(inClusters);
|
|
1647
1553
|
this.zdoRequestBuffalo.writeUInt8(outClusters.length);
|
|
1648
1554
|
this.zdoRequestBuffalo.writeListUInt16(outClusters);
|
|
1649
|
-
debug(`~~~> [ZDO
|
|
1555
|
+
debug(`~~~> [ZDO MATCH_DESCRIPTORS_REQUEST target=${target} profile=${profile} inClusters=${inClusters} outClusters=${outClusters}]`);
|
|
1650
1556
|
return this.sendZDORequestBuffer(target, zdo_1.MATCH_DESCRIPTORS_REQUEST, options);
|
|
1651
1557
|
}
|
|
1652
1558
|
/**
|
|
@@ -1671,7 +1577,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1671
1577
|
this.zdoRequestBuffalo.writeIeeeAddr(target);
|
|
1672
1578
|
this.zdoRequestBuffalo.writeUInt8(reportKids ? 1 : 0);
|
|
1673
1579
|
this.zdoRequestBuffalo.writeUInt8(childStartIndex);
|
|
1674
|
-
debug(`~~~> [ZDO
|
|
1580
|
+
debug(`~~~> [ZDO NETWORK_ADDRESS_REQUEST target=${target} reportKids=${reportKids} childStartIndex=${childStartIndex}]`);
|
|
1675
1581
|
return this.sendZDORequestBuffer(consts_2.EMBER_RX_ON_WHEN_IDLE_BROADCAST_ADDRESS, zdo_1.NETWORK_ADDRESS_REQUEST, enums_2.EmberApsOption.SOURCE_EUI64);
|
|
1676
1582
|
}
|
|
1677
1583
|
/**
|
|
@@ -1697,7 +1603,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1697
1603
|
this.zdoRequestBuffalo.writeUInt16(target);
|
|
1698
1604
|
this.zdoRequestBuffalo.writeUInt8(reportKids ? 1 : 0);
|
|
1699
1605
|
this.zdoRequestBuffalo.writeUInt8(childStartIndex);
|
|
1700
|
-
debug(`~~~> [ZDO
|
|
1606
|
+
debug(`~~~> [ZDO IEEE_ADDRESS_REQUEST target=${target} reportKids=${reportKids} childStartIndex=${childStartIndex}]`);
|
|
1701
1607
|
return this.sendZDORequestBuffer(target, zdo_1.IEEE_ADDRESS_REQUEST, options);
|
|
1702
1608
|
}
|
|
1703
1609
|
/**
|
|
@@ -1713,7 +1619,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1713
1619
|
this.zdoRequestBuffalo.writeUInt16(discoveryNodeId);
|
|
1714
1620
|
this.zdoRequestBuffalo.writeUInt8(reportKids ? 1 : 0);
|
|
1715
1621
|
this.zdoRequestBuffalo.writeUInt8(childStartIndex);
|
|
1716
|
-
debug(`~~~> [ZDO
|
|
1622
|
+
debug(`~~~> [ZDO IEEE_ADDRESS_REQUEST targetNodeIdOfRequest=${targetNodeIdOfRequest} discoveryNodeId=${discoveryNodeId} `
|
|
1717
1623
|
+ `reportKids=${reportKids} childStartIndex=${childStartIndex}]`);
|
|
1718
1624
|
return this.sendZDORequestBuffer(targetNodeIdOfRequest, zdo_1.IEEE_ADDRESS_REQUEST, options);
|
|
1719
1625
|
}
|
|
@@ -1753,7 +1659,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1753
1659
|
this.zdoRequestBuffalo.setPosition(zdo_1.ZDO_MESSAGE_OVERHEAD);
|
|
1754
1660
|
this.zdoRequestBuffalo.writeUInt16(target);
|
|
1755
1661
|
this.zdoRequestBuffalo.writeUInt8(targetEndpoint);
|
|
1756
|
-
debug(`~~~> [ZDO
|
|
1662
|
+
debug(`~~~> [ZDO SIMPLE_DESCRIPTOR_REQUEST target=${target} targetEndpoint=${targetEndpoint}]`);
|
|
1757
1663
|
return this.sendZDORequestBuffer(target, zdo_1.SIMPLE_DESCRIPTOR_REQUEST, options);
|
|
1758
1664
|
}
|
|
1759
1665
|
/**
|
|
@@ -1828,7 +1734,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1828
1734
|
* @returns The tag used on the message.
|
|
1829
1735
|
*/
|
|
1830
1736
|
async emberBindRequest(target, source, sourceEndpoint, clusterId, type, destination, groupAddress, destinationEndpoint, options) {
|
|
1831
|
-
debug(`~~~> [ZDO
|
|
1737
|
+
debug(`~~~> [ZDO BIND_REQUEST target=${target} source=${source} sourceEndpoint=${sourceEndpoint} clusterId=${clusterId} type=${type} `
|
|
1832
1738
|
+ `destination=${destination} groupAddress=${groupAddress} destinationEndpoint=${destinationEndpoint}]`);
|
|
1833
1739
|
return this.emberSendZigDevBindRequest(target, zdo_1.BIND_REQUEST, source, sourceEndpoint, clusterId, type, destination, groupAddress, destinationEndpoint, options);
|
|
1834
1740
|
}
|
|
@@ -1862,7 +1768,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1862
1768
|
* @returns The tag used on the message.
|
|
1863
1769
|
*/
|
|
1864
1770
|
async emberUnbindRequest(target, source, sourceEndpoint, clusterId, type, destination, groupAddress, destinationEndpoint, options) {
|
|
1865
|
-
debug(`~~~> [ZDO
|
|
1771
|
+
debug(`~~~> [ZDO UNBIND_REQUEST target=${target} source=${source} sourceEndpoint=${sourceEndpoint} clusterId=${clusterId} type=${type} `
|
|
1866
1772
|
+ `destination=${destination} groupAddress=${groupAddress} destinationEndpoint=${destinationEndpoint}]`);
|
|
1867
1773
|
return this.emberSendZigDevBindRequest(target, zdo_1.UNBIND_REQUEST, source, sourceEndpoint, clusterId, type, destination, groupAddress, destinationEndpoint, options);
|
|
1868
1774
|
}
|
|
@@ -1880,7 +1786,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1880
1786
|
* ::EMBER_NETWORK_DOWN or ::EMBER_NETWORK_BUSY.
|
|
1881
1787
|
*/
|
|
1882
1788
|
async emberActiveEndpointsRequest(target, options) {
|
|
1883
|
-
debug(`~~~> [ZDO
|
|
1789
|
+
debug(`~~~> [ZDO ACTIVE_ENDPOINTS_REQUEST target=${target}]`);
|
|
1884
1790
|
return this.emberSendZigDevRequestTarget(target, zdo_1.ACTIVE_ENDPOINTS_REQUEST, options);
|
|
1885
1791
|
}
|
|
1886
1792
|
/**
|
|
@@ -1900,7 +1806,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1900
1806
|
* ::EMBER_NETWORK_DOWN or ::EMBER_NETWORK_BUSY.
|
|
1901
1807
|
*/
|
|
1902
1808
|
async emberPowerDescriptorRequest(target, options) {
|
|
1903
|
-
debug(`~~~> [ZDO
|
|
1809
|
+
debug(`~~~> [ZDO POWER_DESCRIPTOR_REQUEST target=${target}]`);
|
|
1904
1810
|
return this.emberSendZigDevRequestTarget(target, zdo_1.POWER_DESCRIPTOR_REQUEST, options);
|
|
1905
1811
|
}
|
|
1906
1812
|
/**
|
|
@@ -1919,7 +1825,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1919
1825
|
* ::EMBER_NETWORK_DOWN or ::EMBER_NETWORK_BUSY.
|
|
1920
1826
|
*/
|
|
1921
1827
|
async emberNodeDescriptorRequest(target, options) {
|
|
1922
|
-
debug(`~~~> [ZDO
|
|
1828
|
+
debug(`~~~> [ZDO NODE_DESCRIPTOR_REQUEST target=${target}]`);
|
|
1923
1829
|
return this.emberSendZigDevRequestTarget(target, zdo_1.NODE_DESCRIPTOR_REQUEST, options);
|
|
1924
1830
|
}
|
|
1925
1831
|
/**
|
|
@@ -1940,7 +1846,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1940
1846
|
* ::EMBER_NETWORK_DOWN or ::EMBER_NETWORK_BUSY.
|
|
1941
1847
|
*/
|
|
1942
1848
|
async emberLqiTableRequest(target, startIndex, options) {
|
|
1943
|
-
debug(`~~~> [ZDO
|
|
1849
|
+
debug(`~~~> [ZDO LQI_TABLE_REQUEST target=${target} startIndex=${startIndex}]`);
|
|
1944
1850
|
return this.emberTableRequest(zdo_1.LQI_TABLE_REQUEST, target, startIndex, options);
|
|
1945
1851
|
}
|
|
1946
1852
|
/**
|
|
@@ -1961,7 +1867,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1961
1867
|
* ::EMBER_NETWORK_DOWN or ::EMBER_NETWORK_BUSY.
|
|
1962
1868
|
*/
|
|
1963
1869
|
async emberRoutingTableRequest(target, startIndex, options) {
|
|
1964
|
-
debug(`~~~> [ZDO
|
|
1870
|
+
debug(`~~~> [ZDO ROUTING_TABLE_REQUEST target=${target} startIndex=${startIndex}]`);
|
|
1965
1871
|
return this.emberTableRequest(zdo_1.ROUTING_TABLE_REQUEST, target, startIndex, options);
|
|
1966
1872
|
}
|
|
1967
1873
|
/**
|
|
@@ -1983,7 +1889,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
1983
1889
|
* ::EMBER_NETWORK_DOWN or ::EMBER_NETWORK_BUSY.
|
|
1984
1890
|
*/
|
|
1985
1891
|
async emberBindingTableRequest(target, startIndex, options) {
|
|
1986
|
-
debug(`~~~> [ZDO
|
|
1892
|
+
debug(`~~~> [ZDO BINDING_TABLE_REQUEST target=${target} startIndex=${startIndex}]`);
|
|
1987
1893
|
return this.emberTableRequest(zdo_1.BINDING_TABLE_REQUEST, target, startIndex, options);
|
|
1988
1894
|
}
|
|
1989
1895
|
/**
|
|
@@ -2022,7 +1928,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
2022
1928
|
this.zdoRequestBuffalo.setPosition(zdo_1.ZDO_MESSAGE_OVERHEAD);
|
|
2023
1929
|
this.zdoRequestBuffalo.writeIeeeAddr(deviceAddress);
|
|
2024
1930
|
this.zdoRequestBuffalo.writeUInt8(leaveRequestFlags);
|
|
2025
|
-
debug(`~~~> [ZDO
|
|
1931
|
+
debug(`~~~> [ZDO LEAVE_REQUEST target=${target} deviceAddress=${deviceAddress} leaveRequestFlags=${leaveRequestFlags}]`);
|
|
2026
1932
|
return this.sendZDORequestBuffer(target, zdo_1.LEAVE_REQUEST, options);
|
|
2027
1933
|
}
|
|
2028
1934
|
/**
|
|
@@ -2046,7 +1952,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
2046
1952
|
this.zdoRequestBuffalo.setPosition(zdo_1.ZDO_MESSAGE_OVERHEAD);
|
|
2047
1953
|
this.zdoRequestBuffalo.writeUInt8(duration);
|
|
2048
1954
|
this.zdoRequestBuffalo.writeUInt8(authentication);
|
|
2049
|
-
debug(`~~~> [ZDO
|
|
1955
|
+
debug(`~~~> [ZDO PERMIT_JOINING_REQUEST target=${target} duration=${duration} authentication=${authentication}]`);
|
|
2050
1956
|
return this.sendZDORequestBuffer(target, zdo_1.PERMIT_JOINING_REQUEST, options);
|
|
2051
1957
|
}
|
|
2052
1958
|
//---- END Ember ZDO
|
|
@@ -2097,8 +2003,8 @@ class EmberAdapter extends __1.Adapter {
|
|
|
2097
2003
|
profileID: ep.profileId,
|
|
2098
2004
|
ID: ep.endpoint,
|
|
2099
2005
|
deviceID: ep.deviceId,
|
|
2100
|
-
inputClusters: ep.inClusterList,
|
|
2101
|
-
outputClusters: ep.outClusterList,
|
|
2006
|
+
inputClusters: ep.inClusterList.slice(), // copy
|
|
2007
|
+
outputClusters: ep.outClusterList.slice(), // copy
|
|
2102
2008
|
};
|
|
2103
2009
|
}),
|
|
2104
2010
|
});
|
|
@@ -2328,8 +2234,8 @@ class EmberAdapter extends __1.Adapter {
|
|
|
2328
2234
|
return enums_2.EmberStatus.SUCCESS;
|
|
2329
2235
|
}
|
|
2330
2236
|
};
|
|
2331
|
-
// NOTE: can't ZDO PJ on coordinator, so if network address is null or zero (coordinator), using local permit join
|
|
2332
2237
|
if (networkAddress) {
|
|
2238
|
+
// specific device that is not `Coordinator`
|
|
2333
2239
|
return new Promise((resolve, reject) => {
|
|
2334
2240
|
this.requestQueue.enqueue(async () => {
|
|
2335
2241
|
this.checkInterpanLock();
|
|
@@ -2356,7 +2262,7 @@ class EmberAdapter extends __1.Adapter {
|
|
|
2356
2262
|
});
|
|
2357
2263
|
}
|
|
2358
2264
|
else {
|
|
2359
|
-
//
|
|
2265
|
+
// coordinator-only, or all
|
|
2360
2266
|
return new Promise((resolve, reject) => {
|
|
2361
2267
|
this.requestQueue.enqueue(async () => {
|
|
2362
2268
|
this.checkInterpanLock();
|
|
@@ -2365,8 +2271,9 @@ class EmberAdapter extends __1.Adapter {
|
|
|
2365
2271
|
console.error(`[ZDO] Failed pre joining request for "${networkAddress}" with status=${enums_2.EmberStatus[pjStatus]}.`);
|
|
2366
2272
|
return pjStatus;
|
|
2367
2273
|
}
|
|
2274
|
+
// local permit join if `Coordinator`-only requested, else local + broadcast
|
|
2368
2275
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2369
|
-
const [status, apsFrame, messageTag] = (await this.emberPermitJoining(seconds,
|
|
2276
|
+
const [status, apsFrame, messageTag] = (await this.emberPermitJoining(seconds, (networkAddress === consts_2.ZIGBEE_COORDINATOR_ADDRESS) ? false : true));
|
|
2370
2277
|
if (status !== enums_2.EmberStatus.SUCCESS) {
|
|
2371
2278
|
console.error(`[ZDO] Failed permit joining request with status=${enums_2.EmberStatus[status]}.`);
|
|
2372
2279
|
return status;
|
|
@@ -2732,10 +2639,6 @@ class EmberAdapter extends __1.Adapter {
|
|
|
2732
2639
|
return enums_2.EmberStatus.MESSAGE_TOO_LONG; // queue will reject
|
|
2733
2640
|
}
|
|
2734
2641
|
}
|
|
2735
|
-
// track group changes in NCP multicast table
|
|
2736
|
-
if (apsFrame.clusterId === cluster_1.default.genGroups.ID) {
|
|
2737
|
-
await this.onGroupChange(command.ID, zclFrame.Payload.groupid);
|
|
2738
|
-
}
|
|
2739
2642
|
debug(`~~~> [ZCL to=${networkAddress} apsFrame=${JSON.stringify(apsFrame)} header=${JSON.stringify(zclFrame.Header)}]`);
|
|
2740
2643
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2741
2644
|
const [status, messageTag] = (await this.ezsp.send(enums_2.EmberOutgoingMessageType.DIRECT, networkAddress, apsFrame, data, 0, // alias
|