Since I put the code in ZDO_STATE_CHANGE, you have to turn on both ZED and ZC at the same time to trigger EZ-mode at the same time. In this way, they would bind each other. If you only turn off and on either one, another one won't invoke EZ-mode so the binding won't happen.