本文整理匯總了Java中me.legrange.panstamp.ModemException類的典型用法代碼示例。如果您正苦於以下問題:Java ModemException類的具體用法?Java ModemException怎麽用?Java ModemException使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ModemException類屬於me.legrange.panstamp包,在下文中一共展示了ModemException類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: toString
import me.legrange.panstamp.ModemException; //導入依賴的package包/類
@Override
public String toString() {
String txt;
try {
Network gw = getNetwork();
SwapModem sm = gw.getSWAPModem();
switch (sm.getType()) {
case SERIAL:
txt = String.format("Serial Network - %4x", gw.getNetworkId());
break;
case TCP_IP:
txt = String.format("TCP/IP Network - %4x", gw.getNetworkId());
break;
default:
txt = String.format("%4x", gw.getNetworkId());
}
} catch (ModemException ex) {
Logger.getLogger(NetworkNode.class.getName()).log(Level.SEVERE, null, ex);
txt = "Network";
}
return txt;
}
示例2: stopNetwork
import me.legrange.panstamp.ModemException; //導入依賴的package包/類
private void stopNetwork() {
logger.debug("stopNetwork()");
try {
network.close();
network = null;
logger.info("Closed panStamp network");
} catch (ModemException e) {
logger.error("Error closing panStamp network: " + e.getMessage(), e);
}
}
示例3: disconnect
import me.legrange.panstamp.ModemException; //導入依賴的package包/類
private void disconnect() throws ModemException {
nw.close();
}