FAST_READ with ACR1255U - ios

I'm currently using this NFC reader ACR1255 to reads NTAG213 with an text ndef on it on an iOS app
I'm currently doing 2 read commands for 16 bytes each (because i know the size of my ndef message) but i find it not really reliable
While reading the NTAG213 doc I found the FAST_READ command but I can't seem to use it ?
I'm kinda new at NFC and it's a pretty mess for me I'm not sure i'm doing something wrong ?
For the moment i'm sending this apdu to read: "FF B0 00 04 10" and "FF B0 00 04 10" and concat the result and I got my ndef message
But for the FAST_READ I try this : "FF 3A 04 00 00" and I receive "6A 81" for function not supported.
Is there a protocol compatibily I didn't see ? Or someone has an idea ?

Seems like your end index is incorrect, it should be 4 or more.
Working example.

Related

Finding the documentation for parsing data found in BLE Advertising Respones

This is not a programming related question. It's a question about where to find the right documentation.
If this is not the right place to ask, please let me know and I'll move the question
I'm working on a C++-Deamon for parsing recieved BLE Advertising Packages (like hcidump from bleuz). For this I'm focusing on parsing only LE Advertising Report events (Bluetooth Core Specification 7.7.65.2, S. 2382 ff)
E. g: I need to extract the local name and the 16-bit UUID. This information can be found (if broadcasted) in the field "data".
I can extract the data part from the Advertising Event Packet (since it's described in the Core Specification how these packages are arranged) but I can't parse the data. I wasn't able to find a description of the codes used in this data frame.
I also went through the Core Specification Supplement, but I couldn’t find the corresponding codes. I only found some examples:
See Site 26: Apparently the byte 0x09 indicates that the following n bytes are the broadcasted name of the BLE-Device.
Or Site 25: 0x03 seems to indicate that a "Complete list of 16-bit Service UUIDs" is following.
So far I gained my knowledge about this by just going throught these (incomplete) list of examples I found and from looking at the source code of hcidump.c.
Now the question is: Where can I find the official complete list to those bytes/codes?
Just an example of the package content I revieve:
Respone: 04 3E 1C 02 01 04 01 55 19 19 E4 8D FE 10 0F 09 54 65 73 74
20 49 50 53 50 20 6E 6F 64 65 C5
It should be able to extract the following data
HCI Event: LE Meta Event (0x3e) plen 28
LE Advertising Report
SCAN_RSP - Scan Response (4)
bdaddr FE:8D:E4:19:19:55 (Random)
Complete local name: 'Test IPSP node'
RSSI: -61
After going throught the whole Bluetooth SIG, I finally found the site where these codes are described:
https://www.bluetooth.com/specifications/assigned-numbers/generic-access-profile/

Determine Card Number from ATR in Swift

I am using an ACS card reader. I have a contactless VISA card. By reading the card I get the following hex ATR information:
3B 6E 00 00 80 31 80 66 B1 A3 01 01 21 0A 83 00 90 00
From the above ATR, how I can detect the card number and type?
You can't.
That ATR (answer-to-reset) does not contain such information. In fact, since your card is a contactless card (ISO/IEC 14443-4), it does not even have an ATR, but an ATS (answer-to-select), which is the contactless "equivalent" (at least in terms of contained information) of an ATR.
Instead, you would need to exchange APDUs (ISO/IEC 7816-4) with your card to get further information from it. Since you refer to VISA, your card probably speaks the EMV protocol for contactless cards (see http://www.emvco.com/).
ATR = Answer to reset, is hex string getting from the card as a response of Reset command sent by the IFD/Card_Reader. It tells about card properties like-
- card speed
- protocol (T=0, T=1) supported by card
- etc..
If you need to get the card number/ PAN from the card you need to fire Read_Record command to get the value from the card. Sequence will be like:-
Fire PPSE command ( if your card support PPSE installed in it)
Contactless PPSE:
00A404000E325041592E5359532E444446303100 // ppse command
it will give you the AID of application installed in the card, in your case it will be
A0 00 00 00 03 10 10 //VISA AID
Select application
00 a4 04 00 07 A0 00 00 00 03 10 10 00
then Fire GPO command , it will give you AFL detail. Next you need to fire Read Record command and search for PAN Tag ( 5A).
this SO post can be useful for you..hope this information helps you to get the card number/PAN as you are looking for.

Write data to NTAG213

Hi in my iOS app I'm trying to use the ACR1255U, I want to write to a NTAG213 card some data,I found a way by using APDU command. I found a list of APDU command here, so the command to update binary for ACR1255U it's the follow:
FF D6 00 P1 Lc DATA (P1 --> starting block to update, Lc --> number of bytes)
so for example if I want to write A003, I generate the following NSString:
FF D6 00 04 04 41 30 30 33
but sometimes when I try to write it to a card it works perfectly and sometimes it fails, but I've no idea why... The command is correct and I'm using the SDK inserted in demo app that I download from here.
Does anyone has an idea about why sometimes it works and sometimes it doesn't work?
Thank you
It happen in the demo app and in my app

Parsing variable byte length message

I'd like to parse a proprietary message with the following format. The messages are of variable length from 8bytes to 16 bytes. If the message is more than 8 bytes, it is put into multi packet message.
Byte0 Byte1 Byte2 Byte3 Byte4 Byte5 Byte6 Byte7-14 Byte15
Header Header Flags SlaveID Sequence Command Command Data Chksum
I send these messages to a device and expect a response from said device with similar format. I know what the messages are supposed to say, but I'm really struggling to find a away to parse the data in real time and display the information in somesort of GUI framework. Currently, I'm planning on dumping the data into a .txt/.csv file and post-processing with matlab.
I'm a hardware guy. This is not my strong suit.
Example:
Command, Reponse
0xAC 04 01 01 00 8C 01 01 chksum
0x04 AC 83 01 00 8C 01 01 0B D9 chksum
0x8c01 command to test power supply 0x01
Device echos the command and power supply it was checking and also returns the bit-shifted value of the power supply voltage 0x0BD9

Unexpected binary sequences in Postscript generated by Canon printer driver

We are having issues with the Postscript code generated by the "Canon iR-ADV C5235/5240 PS3" printer driver. We print a test document (3 A4 pages of Lorem Ipsum text) and get the following Postscript output in the Windows spool directory:
http://files.etvdzs.info/original.ps
We have tried various Postscript viewers/converters, and they are unable to handle this file. The reason is that the file contains sections of binary data at the beginning and end, and also the following byte sequence at position 0x1060b:
cd ca 10 02 00 1a 00 01 82 6f ff ff 00 00 00 00 00 00 00 00 01
If we remove these three binary sequences, we get the resulting file, which works fine in most Postscript viewers/converters we have tried:
http://files.etvdzs.info/cleaned.ps
Has anybody else encountered similar issues with Canon printer drivers? Does anybody know what these binary sequences signify, or what format they are in?
The binary sequences are CPCA codes. One can download documentation about the data structures used in CPCA after registering here:
https://www.developersupport.canon.com/user/register
It is then reasonably straightforward to write a program that strips the CPCA codes out of the file. The file can then be loaded successfully by 3rd-party Postscript viewers/converters.

Resources