@Test public void shutdown() throws Exception { System.out.println("--- " + Thread.currentThread().getStackTrace()[1].getMethodName()); ZigBeeDongleEzsp dongle = new ZigBeeDongleEzsp(null); TestUtilities.setField(ZigBeeDongleEzsp.class, dongle, "serialPort", Mockito.mock(ZigBeePort.class)); TestUtilities.setField(ZigBeeDongleEzsp.class, dongle, "frameHandler", Mockito.mock(EzspProtocolHandler.class)); dongle.shutdown(); }
@Override public void shutdown() { logger.debug("EZSP Dongle: Shutdown"); if (frameHandler == null) { logger.debug("EZSP Dongle: Shutdown frameHandler is null"); return; } frameHandler.setClosing(); if (mfglibListener != null) { mfglibListener = null; } if (pollingTimer != null) { pollingTimer.cancel(true); } if (executorService != null) { executorService.shutdownNow(); } frameHandler.close(); serialPort.close(); frameHandler = null; }
ZigBeeDongleEzsp implements ZigBeeTransportTransmit, ZigBeeTransportFirmwareUpdate, EzspFrameHandler { @Override public void shutdown() { logger.debug("EZSP Dongle: Shutdown"); if (frameHandler == null) { logger.debug("EZSP Dongle: Shutdown frameHandler is null"); return; } frameHandler.setClosing(); if (mfglibListener != null) { mfglibListener = null; } if (pollingTimer != null) { pollingTimer.cancel(true); } if (executorService != null) { executorService.shutdownNow(); } frameHandler.close(); serialPort.close(); frameHandler = null; } }
ZigBeeDongleEzsp implements ZigBeeTransportTransmit, ZigBeeTransportFirmwareUpdate, EzspFrameHandler { @Override public void shutdown() { logger.debug("EZSP Dongle: Shutdown"); if (frameHandler == null) { logger.debug("EZSP Dongle: Shutdown frameHandler is null"); return; } frameHandler.setClosing(); if (mfglibListener != null) { mfglibListener = null; } if (pollingTimer != null) { pollingTimer.cancel(true); } if (executorService != null) { executorService.shutdownNow(); } frameHandler.close(); serialPort.close(); frameHandler = null; } ZigBeeDongleEzsp(final ZigBeePort serialPort);  ZigBeeDongleEzsp(final ZigBeePort serialPort, final EmberSerialProtocol protocol); }
ZigBeeDongleEzsp implements ZigBeeTransportTransmit, ZigBeeTransportFirmwareUpdate, EzspFrameHandler { @Override public void shutdown() { logger.debug("EZSP Dongle: Shutdown"); if (frameHandler == null) { logger.debug("EZSP Dongle: Shutdown frameHandler is null"); return; } frameHandler.setClosing(); if (mfglibListener != null) { mfglibListener = null; } if (pollingTimer != null) { pollingTimer.cancel(true); } if (executorService != null) { executorService.shutdownNow(); } frameHandler.close(); serialPort.close(); frameHandler = null; } ZigBeeDongleEzsp(final ZigBeePort serialPort);  ZigBeeDongleEzsp(final ZigBeePort serialPort, final EmberSerialProtocol protocol); void setEmberNcpResetProvider(EmberNcpResetProvider resetProvider); Integer updateDefaultConfiguration(EzspConfigId configId, Integer value); EzspDecisionId updateDefaultPolicy(EzspPolicyId policyId, EzspDecisionId decisionId); EmberMfglib getEmberMfglib(EmberMfglibListener mfglibListener); @Override void setDefaultProfileId(int defaultProfileId); @Override void setDefaultDeviceId(int defaultDeviceId); @Override ZigBeeStatus initialize(); @Override ZigBeeStatus startup(boolean reinitialize); void setPollRate(int pollRate); @Override void shutdown(); void passLoopbackMessages(boolean passLoopbackMessages); EmberNcp getEmberNcp(); EmberCbkeProvider getEmberCbkeProvider(); @Override IeeeAddress getIeeeAddress(); @Override Integer getNwkAddress(); @Override void sendCommand(final int msgTag, final ZigBeeApsFrame apsFrame); @Override void setZigBeeTransportReceive(ZigBeeTransportReceive zigbeeTransportReceive); @Override void setNodeDescriptor(IeeeAddress ieeeAddress, NodeDescriptor nodeDescriptor); @Override void handlePacket(EzspFrame response); @Override void handleLinkStateChange(final boolean linkState); @Override ZigBeeChannel getZigBeeChannel(); @Override ZigBeeStatus setZigBeeChannel(ZigBeeChannel channel); @Override int getZigBeePanId(); @Override ZigBeeStatus setZigBeePanId(int panId); @Override ExtendedPanId getZigBeeExtendedPanId(); @Override ZigBeeStatus setZigBeeExtendedPanId(ExtendedPanId extendedPanId); @Override ZigBeeStatus setZigBeeNetworkKey(final ZigBeeKey key); @Override ZigBeeKey getZigBeeNetworkKey(); @Override ZigBeeStatus setTcLinkKey(ZigBeeKey key); @Override ZigBeeKey getTcLinkKey(); @Override void updateTransportConfig(TransportConfig configuration); @Override String getVersionString(); @Override boolean updateFirmware(final InputStream firmware, final ZigBeeTransportFirmwareCallback callback); void bootloadComplete(); @Override String getFirmwareVersion(); @Override boolean cancelUpdateFirmware(); Map<String, Long> getCounters(); }
ZigBeeDongleEzsp implements ZigBeeTransportTransmit, ZigBeeTransportFirmwareUpdate, EzspFrameHandler { @Override public void shutdown() { logger.debug("EZSP Dongle: Shutdown"); if (frameHandler == null) { logger.debug("EZSP Dongle: Shutdown frameHandler is null"); return; } frameHandler.setClosing(); if (mfglibListener != null) { mfglibListener = null; } if (pollingTimer != null) { pollingTimer.cancel(true); } if (executorService != null) { executorService.shutdownNow(); } frameHandler.close(); serialPort.close(); frameHandler = null; } ZigBeeDongleEzsp(final ZigBeePort serialPort);  ZigBeeDongleEzsp(final ZigBeePort serialPort, final EmberSerialProtocol protocol); void setEmberNcpResetProvider(EmberNcpResetProvider resetProvider); Integer updateDefaultConfiguration(EzspConfigId configId, Integer value); EzspDecisionId updateDefaultPolicy(EzspPolicyId policyId, EzspDecisionId decisionId); EmberMfglib getEmberMfglib(EmberMfglibListener mfglibListener); @Override void setDefaultProfileId(int defaultProfileId); @Override void setDefaultDeviceId(int defaultDeviceId); @Override ZigBeeStatus initialize(); @Override ZigBeeStatus startup(boolean reinitialize); void setPollRate(int pollRate); @Override void shutdown(); void passLoopbackMessages(boolean passLoopbackMessages); EmberNcp getEmberNcp(); EmberCbkeProvider getEmberCbkeProvider(); @Override IeeeAddress getIeeeAddress(); @Override Integer getNwkAddress(); @Override void sendCommand(final int msgTag, final ZigBeeApsFrame apsFrame); @Override void setZigBeeTransportReceive(ZigBeeTransportReceive zigbeeTransportReceive); @Override void setNodeDescriptor(IeeeAddress ieeeAddress, NodeDescriptor nodeDescriptor); @Override void handlePacket(EzspFrame response); @Override void handleLinkStateChange(final boolean linkState); @Override ZigBeeChannel getZigBeeChannel(); @Override ZigBeeStatus setZigBeeChannel(ZigBeeChannel channel); @Override int getZigBeePanId(); @Override ZigBeeStatus setZigBeePanId(int panId); @Override ExtendedPanId getZigBeeExtendedPanId(); @Override ZigBeeStatus setZigBeeExtendedPanId(ExtendedPanId extendedPanId); @Override ZigBeeStatus setZigBeeNetworkKey(final ZigBeeKey key); @Override ZigBeeKey getZigBeeNetworkKey(); @Override ZigBeeStatus setTcLinkKey(ZigBeeKey key); @Override ZigBeeKey getTcLinkKey(); @Override void updateTransportConfig(TransportConfig configuration); @Override String getVersionString(); @Override boolean updateFirmware(final InputStream firmware, final ZigBeeTransportFirmwareCallback callback); void bootloadComplete(); @Override String getFirmwareVersion(); @Override boolean cancelUpdateFirmware(); Map<String, Long> getCounters();  }