To communcation JCOP4.x by I2C, please find example code for reference
Please also check items as folllwing in advance.
1. Confirm base OS support I2C
2. Check parameter configuration
I2C_SPI_PARAMS
ATR_I2C_IF_BYTES
Please use default value for parameter I2C_SPI_PARAMS and ATR_I2C_IF_BYTES
The code was helpful, but has an error in it in I2CTester.java:
This section should be -
case I2C_TRANSFER:
//The communications configuration needs to be set up for each call of the API.
//All TLV TAGS to do this must be present in the input buffer
len = I2cMaster.i2cMaster(buf, ISO7816.OFFSET_CDATA, len, buf, (short)0, (short)225);
apdu.setOutgoingAndSend((short) (0), len);
(e.g. the output length should match the return length from the I2CMaster.i2cMaster call, and the buffer length shouldn't be set by the length of the incoming command, but should be closer to the length of the APDU buffer)
Here's the fixed I2C_Tester.java file. For some unknown reason, this forum doesn't support uploads of .java files - so I added a .c at the end. Save the file, remove the .c and you should be able to compile this.
This fixes a few bugs in the sample code provided by NXP.
For some reason, the code I sent didn't upload. Let me try again. This is corrected I2C_Tester.java - but .java files aren't supported as uploads for some reason so this is here as .txt