AbstractSerialMeasuringDevice.java 文件源码

java
阅读 19 收藏 0 点赞 0 评论 0

项目:tellervo 作者:
/**
 * Get a vector of all the ports identified on this computer
 * 
 * @return
 */

public static Vector enumerateSerialPorts() {
    Enumeration ports = CommPortIdentifier.getPortIdentifiers();
    Vector portStrings = new Vector();

    while(ports.hasMoreElements()) {
        CommPortIdentifier currentPort = (CommPortIdentifier)ports.nextElement();

        if(currentPort.getPortType() != CommPortIdentifier.PORT_SERIAL)
            continue;

        portStrings.add(new String(currentPort.getName()));
    }

    return portStrings;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号