JavaPOSWorkingGroup / javapos-contracts

Hosts the interfaces and data types of the UnifiedPOS reference implementation for Java.
Other
8 stars 9 forks source link

RFIDScanner has ambiguous constant values #1

Closed kuniss closed 8 years ago

kuniss commented 8 years ago

While implementing an RFIDScanner JavaPOS Device Service we have encountered a problem in bit related constants. The following yellow marked constants are ambiguous: rfidscanner issue - wrong constants

As they are not bitwise exclusive:

0x00001000 = 01000000000000B
0x00002000 = 10000000000000B
0x00003000 = 11000000000000B

However, this is the intention as we understood from the capability defining these constants: rfidscanner issue - cap definition

Even, we would prefer the term “bitwise or“ instead of “bitwise sum” being mentioned in the standard as the last one would imply a bit carrying operation which was not intended here, we guess.

If we understood right and the committee agrees, we would suggest the following change of the constants in JavaPOS (I just checked: OPOS has the same issue):

public static final int RFID_PR_ISO14443A  = 0x00001000;
public static final int RFID_PR_ISO14443B  = 0x00002000;
public static final int RFID_PR_ISO15693   = 0x00008000; <== '3' changed to '8'
public static final int RFID_PR_ISO180006B = 0x00004000;

In that way we change the constant RFID_PR_ISO15693 only to hold the changes as small as possible.

kuniss commented 8 years ago

Note: This issue has been fixed for JavaPOS releases 1.13 and 1.14. If some one requires this fix for older versions too, please file an issue.