Testing Conditions on Port Bytes - ignoring certain bits?
You need to use boolean arithmetic.  Use the AND operator (&amp;) to combine the incoming value AND the "mask" value (the value of the bits you do care about) and see if it equals the mask bit:

byte wanted = 0b11001110; // 207
byte incoming = 223; // for example 11011111

if ((wanted &amp; incoming) == wanted) {
    // whatever
}


The AND operator compares each bit of the bytes in turn.  If they are BOTH 1 then the result is 1. Otherwise the result is 0.  So the above gives:

wanted:    11001110
incoming:  11011111
AND:       11001110


And the result matches "wanted". If you had some other value for incoming it could look like this:

wanted:    11001110
incoming:  01011011
AND:       01001010


And you can see that the result doesn't match.