2166220_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2166220_en-US

2166220_en-US

Communication by I2C in JCOP4.x

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



Smart CardsRe: Communication by I2C in JCOP4.x

Please use default value for parameter I2C_SPI_PARAMS and ATR_I2C_IF_BYTES

Re: Communication by I2C in JCOP4.x

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)

Re: Communication by I2C in JCOP4.x

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.

Re: Communication by I2C in JCOP4.x

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

タグ(1)
評価なし
バージョン履歴
最終更新日:
‎04-07-2026 02:35 AM
更新者: