adds the ability to also configure NDEF record during NDEF applet installation. Needed if we want to ship with tap-to-down feature

This commit is contained in:
Michele Balistreri 2018-11-13 14:29:50 +03:00
parent c5a398e05e
commit 2ebb131d8e
1 changed files with 8 additions and 0 deletions

View File

@ -47,6 +47,14 @@ public class NDEFApplet extends Applet {
* @param bLength length of the installation parameters
*/
public NDEFApplet(byte[] bArray, short bOffset, byte bLength) {
short c9Off = (short)(bOffset + bArray[bOffset] + 1); // Skip AID
c9Off += (short)(bArray[c9Off] + 1); // Skip Privileges and parameter length
short dataLen = Util.makeShort((byte) 0x00, bArray[c9Off++]);
if ((dataLen > 2) && ((short)(dataLen - 2) == Util.makeShort(bArray[c9Off], bArray[(short)(c9Off + 1)]))) {
Util.arrayCopyNonAtomic(bArray, c9Off, SharedMemory.ndefDataFile, (short) 0, dataLen);
}
register(bArray, (short) (bOffset + 1), bArray[bOffset]);
}