shimmeringbee / zstack

Implementation of a ZNP and support code designed to interface with Texas Instruments Z-Stack, written in Go.
https://shimmeringbee.io/
Apache License 2.0
27 stars 8 forks source link

Support CC2652 adapter #16

Closed pwood closed 3 years ago

pwood commented 4 years ago

Add support for CC2652 based adapters, these use firmware from Koenkk which is based on Z-Stack 3.X.0, because this supporst Zigbee 3.0 there are some differences to the initialisation of the adapter. To do this, we will need to:

CC2531

(*zstack.SysResetInd)(0xc00000b8f0)({
 Reason: (zstack.ResetReason) 0,
 TransportRevision: (uint8) 2,
 ProductID: (uint8) 0,
 MajorRelease: (uint8) 2,
 MinorRelease: (uint8) 6,
 HardwareRevision: (uint8) 3
})

CC2653

(*zstack.SysResetInd)(0xc000204008)({
 Reason: (zstack.ResetReason) 0,
 TransportRevision: (uint8) 2,
 ProductID: (uint8) 1,
 MajorRelease: (uint8) 2,
 MinorRelease: (uint8) 7,
 HardwareRevision: (uint8) 1
})

zStack 1.2.0 is indicated by 0, 3.x.0 is indiciated by 1 and 3.0.x is indiciated by 2. (No not a typo).

Based upon the SysResetInd.ProductID we can switch initialisation behaviour, if the device does not return a valid version, then assume CC2531 behaviour.

Zigbee herdsman implementation can be found here: https://github.com/Koenkk/zigbee-herdsman/blob/master/src/adapter/z-stack/adapter/startZnp.ts