Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SerialPortEventListener returns invalid type #84

Open
GoogleCodeExporter opened this issue Nov 7, 2015 · 0 comments
Open

SerialPortEventListener returns invalid type #84

GoogleCodeExporter opened this issue Nov 7, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link


This isn't necessarily a bug, it just looks incredibly weird.

In SerialPortEvent the event types look exactly like a bit field:


    public static final int RXCHAR = 1;
    public static final int RXFLAG = 2;
    public static final int TXEMPTY = 4;
    public static final int CTS = 8;
    public static final int DSR = 16;
    public static final int RLSD = 32;
    public static final int BREAK = 64;
    public static final int ERR = 128;
    public static final int RING = 256;

All the values are double previous values.

And yet all the code doesn't examine the value like a bitfield, but like a 
regular field:

    public boolean isRXCHAR() {
        if(eventType == RXCHAR){
            return true;
        }
        else {
            return false;
        }
    }

Maybe not wrong, but just looks a lot like it!

Original issue reported on code.google.com by xpusosto...@gmail.com on 23 May 2015 at 7:54

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant