package com.bgycc.smartcanteen.qrcode;

import java.io.IOException;

public interface IQRCodeScan {
    /**
     * 串口是否有数据
     *
     * @return <br/>
     * true => 串口有数据
     * false => 串口没有数据
     */
    boolean available();

    /**
     * 读取串口数据,该方法会阻塞当前线程
     *
     * @return 从串口读取的字节
     */
    String scan() throws IOException;

    /**
     * 关闭串口
     */
    void close();
}