Skip to content

Commit

Permalink
fix: Ember: boost stack config. (#996)
Browse files Browse the repository at this point in the history
* [ember] Boost stack config.

* [ember] Boost stack config.

* [ember] Disable `deviceLeave` trigger on ID conflict.
  • Loading branch information
Nerivec authored Mar 31, 2024
1 parent c36cd6a commit 96b2b13
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
5 changes: 2 additions & 3 deletions src/adapter/ember/adapter/emberAdapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,13 +323,13 @@ const STACK_CONFIGS = {
/** <-> (Default: 10000) @see EzspValueId.TRANSIENT_DEVICE_TIMEOUT */
TRANSIENT_DEVICE_TIMEOUT: 10000,
/** <0-127> (Default: 2) @see EzspConfigId.BINDING_TABLE_SIZE */
BINDING_TABLE_SIZE: 16,// zigpc: 2, Z3GatewayGPCombo: 5, nabucasa: 32
BINDING_TABLE_SIZE: 32,// zigpc: 2, Z3GatewayGPCombo: 5, nabucasa: 32
/** <0-127> (Default: 0) @see EzspConfigId.KEY_TABLE_SIZE */
KEY_TABLE_SIZE: 0,// zigpc: 4
/** <6-64> (Default: 6) @see EzspConfigId.MAX_END_DEVICE_CHILDREN */
MAX_END_DEVICE_CHILDREN: 32,// zigpc: 6, nabucasa: 32, Dongle-E (Sonoff firmware): 32
/** <1-255> (Default: 10) @see EzspConfigId.APS_UNICAST_MESSAGE_COUNT */
APS_UNICAST_MESSAGE_COUNT: 20,// zigpc: 10, darkxst: 20, nabucasa: 20
APS_UNICAST_MESSAGE_COUNT: 32,// zigpc: 10, darkxst: 20, nabucasa: 20
/** <15-254> (Default: 15) @see EzspConfigId.BROADCAST_TABLE_SIZE */
BROADCAST_TABLE_SIZE: 15,// zigpc: 15, Z3GatewayGPCombo: 35 - NOTE: Sonoff Dongle-E fails at 35
/** [1, 16, 26] (Default: 16). @see EzspConfigId.NEIGHBOR_TABLE_SIZE */
Expand Down Expand Up @@ -1088,7 +1088,6 @@ export class EmberAdapter extends Adapter {
debug(`[INIT TC] Current network config=${JSON.stringify(this.networkOptions)}`);
debug(`[INIT TC] Current NCP network: nodeType=${EmberNodeType[nodeType]} params=${JSON.stringify(netParams)}`);

// XXX: should not force a form when it's only a channel change, just change the channel, wait a sec, then continue the logic
if ((npStatus === EmberStatus.SUCCESS) && (nodeType === EmberNodeType.COORDINATOR) && (this.networkOptions.panID === netParams.panId)
&& (equals(this.networkOptions.extendedPanID, netParams.extendedPanId))) {
// config matches adapter so far, no error, we can check the network key
Expand Down
5 changes: 3 additions & 2 deletions src/adapter/ember/ezsp/ezsp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,6 @@ import {
LONG_DEST_FRAME_CONTROL,
MAC_ACK_REQUIRED,
MIN_STUB_APS_SIZE,
NULL_NODE_ID,
SHORT_DEST_FRAME_CONTROL,
STUB_NWK_FRAME_CONTROL,
STUB_NWK_SIZE,
Expand Down Expand Up @@ -5049,8 +5048,10 @@ export class Ezsp extends EventEmitter {
debug(`ezspIdConflictHandler(): callback called with: [id=${id}]`);
console.error(`An ID conflict was detected for network address "${id}". Corresponding devices removed from the network.`);

// XXX: this is currently causing more problems than not doing it, so disabled for now.
// devices should rejoin on ID conflict anyway, so the database isn't out of sync for very long.
// hijacking the event from `ezspTrustCenterJoinHandler`, and forging a DEVICE_LEFT to avoid another event ending up doing the same logic
this.emit(EzspEvents.TRUST_CENTER_JOIN, id, null, EmberDeviceUpdate.DEVICE_LEFT, EmberJoinDecision.NO_ACTION, NULL_NODE_ID);
// this.emit(EzspEvents.TRUST_CENTER_JOIN, id, null, EmberDeviceUpdate.DEVICE_LEFT, EmberJoinDecision.NO_ACTION, NULL_NODE_ID);
}

/**
Expand Down

0 comments on commit 96b2b13

Please sign in to comment.