@Test public void networkStateUpdated() { System.out.println("--- " + Thread.currentThread().getStackTrace()[1].getMethodName()); SmartEnergyClient extension = new SmartEnergyClient(Mockito.mock(ZigBeeCbkeProvider.class)); ZigBeeNetworkManager networkManager = Mockito.mock(ZigBeeNetworkManager.class); Mockito.when(networkManager.getNotificationService()).thenReturn(new NotificationService()); assertEquals(ZigBeeStatus.SUCCESS, extension.extensionInitialize(networkManager)); SmartEnergyStatusCallback listener = Mockito.mock(SmartEnergyStatusCallback.class); extension.addListener(listener); extension.networkStateUpdated(ZigBeeNetworkState.ONLINE); extension.networkStateUpdated(ZigBeeNetworkState.OFFLINE); }
@Override public void networkStateUpdated(ZigBeeNetworkState state) { switch (state) { case ONLINE: discoveryStart(); break; case OFFLINE: discoveryStop(); break; default: break; } }
SmartEnergyClient implements ZigBeeNetworkExtension, ZigBeeCommandListener, ZigBeeNetworkNodeListener,
        ZigBeeNetworkStateListener { @Override public void networkStateUpdated(ZigBeeNetworkState state) { switch (state) { case ONLINE: discoveryStart(); break; case OFFLINE: discoveryStop(); break; default: break; } } }
SmartEnergyClient implements ZigBeeNetworkExtension, ZigBeeCommandListener, ZigBeeNetworkNodeListener,
        ZigBeeNetworkStateListener { @Override public void networkStateUpdated(ZigBeeNetworkState state) { switch (state) { case ONLINE: discoveryStart(); break; case OFFLINE: discoveryStop(); break; default: break; } } SmartEnergyClient(ZigBeeCbkeProvider cbkeProvider); }
SmartEnergyClient implements ZigBeeNetworkExtension, ZigBeeCommandListener, ZigBeeNetworkNodeListener,
        ZigBeeNetworkStateListener { @Override public void networkStateUpdated(ZigBeeNetworkState state) { switch (state) { case ONLINE: discoveryStart(); break; case OFFLINE: discoveryStop(); break; default: break; } } SmartEnergyClient(ZigBeeCbkeProvider cbkeProvider); @Override ZigBeeStatus extensionInitialize(ZigBeeNetworkManager networkManager); @Override ZigBeeStatus extensionStartup(); @Override void extensionShutdown(); ZigBeeCbkeProvider getCbkeProvider(); boolean setCryptoSuite(ZigBeeCryptoSuites requestedCryptoSuite); void addListener(final SmartEnergyStatusCallback listener); void removeListener(final SmartEnergyStatusCallback listener); void setKeepAlivePeriod(int timeout); Calendar getLastKeepAlive(); ZigBeeStatus startKeyExchange(ZigBeeEndpointAddress endpoint); @Override void commandReceived(ZigBeeCommand command); @Override void networkStateUpdated(ZigBeeNetworkState state); SmartEnergyClientState getDiscoveryState(); @Override void nodeAdded(ZigBeeNode node); @Override void nodeUpdated(ZigBeeNode node); }
SmartEnergyClient implements ZigBeeNetworkExtension, ZigBeeCommandListener, ZigBeeNetworkNodeListener,
        ZigBeeNetworkStateListener { @Override public void networkStateUpdated(ZigBeeNetworkState state) { switch (state) { case ONLINE: discoveryStart(); break; case OFFLINE: discoveryStop(); break; default: break; } } SmartEnergyClient(ZigBeeCbkeProvider cbkeProvider); @Override ZigBeeStatus extensionInitialize(ZigBeeNetworkManager networkManager); @Override ZigBeeStatus extensionStartup(); @Override void extensionShutdown(); ZigBeeCbkeProvider getCbkeProvider(); boolean setCryptoSuite(ZigBeeCryptoSuites requestedCryptoSuite); void addListener(final SmartEnergyStatusCallback listener); void removeListener(final SmartEnergyStatusCallback listener); void setKeepAlivePeriod(int timeout); Calendar getLastKeepAlive(); ZigBeeStatus startKeyExchange(ZigBeeEndpointAddress endpoint); @Override void commandReceived(ZigBeeCommand command); @Override void networkStateUpdated(ZigBeeNetworkState state); SmartEnergyClientState getDiscoveryState(); @Override void nodeAdded(ZigBeeNode node); @Override void nodeUpdated(ZigBeeNode node);  }