ZigBeeSerialPort.java 文件源码

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

项目:org.openhab.binding.zigbee 作者:
@Override
public void serialEvent(SerialPortEvent event) {
    if (event.getEventType() == SerialPortEvent.DATA_AVAILABLE) {
        try {
            synchronized (bufferSynchronisationObject) {
                int recv;
                while ((recv = inputStream.read()) != -1) {
                    buffer[end++] = recv;
                    if (end >= maxLength) {
                        end = 0;
                    }
                }
            }
        } catch (IOException e) {
        }

        synchronized (this) {
            this.notify();
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号