zsmartsystems / com.zsmartsystems.zigbee

ZigBee Cluster Library Java framework supporting multiple dongles
Eclipse Public License 1.0
142 stars 88 forks source link

Static EZSP version and multiple NCPs #1149

Open mikomarrache opened 3 years ago

mikomarrache commented 3 years ago

Hi,

The EZSP version used is stored as static variable:

 /**
     * The current version of EZSP being used
     */
    protected static int ezspVersion = EZSP_MIN_VERSION;

When my application initializes multiple NCPs at the same moment, one of the response can't be read because the frame ID can't be found in the map. At some point, the application aborts the initialization and tries again, and the initialization is performed successfully.

Moreover, if multiple NCPs are used and support different EZSP versions, it probably won't work. (Though I didn't test it case to confirm)

Since I'm using NCPs that all support v8, the workaround I used is declare a static initializer block:

static {
        EzspFrame.setEzspVersion(8);
}

Thanks, Mickael

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 3 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.