This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding/Initializing Application Objects with ZCL/AF while OSAL system is running?

Other Parts Discussed in Thread: Z-STACK

Hello,

I've followed the Z-Stack Home Developer's Guide's "One OSAL Task per many Application Objects" application design and all is working fine.

The single task initialization performs:

  1. initialization of variables specific for the corresponding Application Object
  2. initialization and registration of the Application Object with the AF layer by executing:
    1. zclHA_Init
    2. zclGeneral_RegisterCmdCallbacks
    3. zcl_registerAttrList
    4. afRegister
  3. registration with the applicable OSAL or HAL system services (e.g. RegisterForKeys)

Post task initialization, the OSAL system is started and runs indefinitely without problem.

So here's the question...

I would like to (if possible) be able to do all the above and then, while the system is running, register additional Application Objects with the AF layer (all of step 2 above) on the fly.  Furthermore, I'd like to be able to unregister Application Objects such that the system behaves as if they never existed.

Is this possible?

The reason I'd like to do this is because my project has 2 pieces of hardware: let's call them the base and the module.  When the base starts up, I'd like for it to execute steps 1-3 effectively exposing all the Application Objects that exist within the base hardware.  Then, when the hardware module connects, I'd like for the base hardware to register the Application Objects that exist on the module.  Furthermore, if the module detaches, I'd like the base to unregister all the module Application Objects such that the system is running just like it was before the module became available (attached).  In reality, the Application Objects do not exist in the base firmware -- they are communicated to the base from the module.  However, for simplification purposes, let's ignore this and assume the all the Application Objects exist in the base firmware and all that the act of connecting the module to the base triggers an event within the base that indicates this special group of Application Objects (that is always initialized and available for the base firmware) should be registered, or unregistered if the module is disconnected.

My fallback solution is that when the module attaches, I just restart the entire OSAL system which would include physically resetting the CC2530ZNP.  Though, I am wondering if there is a better solution, as ideally I would be able to register these objects without disconnecting and rejoining the ZigBee network.

For example, can I just restart the OSAL system but leave the CC2530ZNP on the network?

Or, can I just register and unregister Application Objects at will while the OSAL system is running?

Or, something else?

Please advise best practices.

Thanks in advance,

Jeff