public boolean checkState() throws Exception
    {
        boolean result = false;

        this.input = new FileInputStream(this.device.getAbsolutePath());
        this.output = new FileOutputStream(this.device.getAbsolutePath());

        this.output.flush();

        Thread.sleep(this.MAX_INTERVAL * 3);

        System.out.println(input.available());

        this.output.write((byte)Sign.REQUEST);
        this.output.flush();

        Thread.sleep(this.MAX_INTERVAL * 8);
        System.out.println(input.available());
        Integer c = 0;
        input.markSupported();
        ArrayList<Integer> list = new ArrayList<Integer>();
        if ( input.available() > 0)
        {
            while ((c = input.read()) != -1)
                list.add(c);

            if (list.size() > 0)
            {
                if(list.get(0) == Status.ERROR)
                {
                    byte[] command = new byte[2];
                    command[0] = (byte)Status.OK;
                    command[1] = (byte)Sign.REQUEST;
                    this.output.write(command);
                    this.output.flush();
                    result = true;
                }
            }
        }

        this.input.close();
        this.output.close();

        return  result;
    }