本文整理汇总了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();
}