Skip to content

Commit

Permalink
fix: ZBOSS: fix ZDO bind/unbind commands for groups (#1226)
Browse files Browse the repository at this point in the history
* ZBOSS: fix ZDO bind/unbind commands for groups

* fix lint
  • Loading branch information
kirovilya authored Oct 28, 2024
1 parent bf8b468 commit f2fa9ab
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/adapter/zboss/adapter/zbossAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ export class ZBOSSAdapter extends Adapter {
switch (clusterId) {
case Zdo.ClusterId.NETWORK_ADDRESS_REQUEST:
case Zdo.ClusterId.IEEE_ADDRESS_REQUEST:
case Zdo.ClusterId.BIND_REQUEST: // XXX: according to `FRAMES`, might not support group bind?
case Zdo.ClusterId.UNBIND_REQUEST: // XXX: according to `FRAMES`, might not support group unbind?
case Zdo.ClusterId.BIND_REQUEST:
case Zdo.ClusterId.UNBIND_REQUEST:
case Zdo.ClusterId.LQI_TABLE_REQUEST:
case Zdo.ClusterId.ROUTING_TABLE_REQUEST:
case Zdo.ClusterId.BINDING_TABLE_REQUEST:
Expand All @@ -285,6 +285,17 @@ export class ZBOSSAdapter extends Adapter {
break;
}
}
switch (clusterId) {
case Zdo.ClusterId.BIND_REQUEST:
case Zdo.ClusterId.UNBIND_REQUEST: {
// use fixed size address
const addrType = payload.readUInt8(13); // address type
if (addrType == Zdo.MULTICAST_BINDING) {
payload = Buffer.concat([payload, Buffer.alloc(7)]);
}
break;
}
}

const zdoResponseClusterId = Zdo.Utils.getResponseClusterId(clusterId);
const frame = await this.driver.requestZdo(clusterId, payload, disableResponse || zdoResponseClusterId === undefined);
Expand Down

0 comments on commit f2fa9ab

Please sign in to comment.