protected void readFrame() {
        readInputStream();

        if (receiveError) {
            // EatAnError
            receiveError = false;
            eventCount++;
            state = ReadFrameState.idle;
            activity = true;
        }

        if (!receivedValidFrame) {
            if (state == ReadFrameState.idle)
                idle();

            if (state == ReadFrameState.preamble)
                preamble();

            if (state == ReadFrameState.header)
                header();

            if (state == ReadFrameState.headerCrc)
                headerCrc();

            if (state == ReadFrameState.data)
                data();

            if (state == ReadFrameState.dataCrc)
                dataCrc();
        }
    }