Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
New Developer
Posts: 13
Registered: ‎10-07-2013
My Device: Q10
My Carrier: HKCSL

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

Tried last night using the NFC tool to read the octopus card (as well as a few other cards from Japan/Taiwan), tag info cannot be read and nothing happens when the cards were placed next to the NFC sensor. As Simon said earlier and from Sony's website, Octopus card is using Felica technology (though I cannot identify which chipset it uses). Is BB's NFC api support reading information from Felica chipsets?
Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

The story is a bit more complicated Here's the list of supported Tags: https://developer.blackberry.com/native/documentation/core/com.qnx.doc.nfc/topic/manual/c_nfcdevguid...

 

As I understand it, an Octopus card is a Felica card using JIS: X6319-4 at the bottom of the NFC stack. JIS: X6319-4 is in fact the same as NFC Forum “F” ISO 18092. On BlackBerry 10 we can currently support Felica (Non-secure) ONLY as an NFC Type-3 NDEF tag in reader/writer mode. We can’t talk to it in Reader/Writer mode when it’s formatted as anything other than a Type-3 NDEF tag as you would probably want to do if the tag was formatted as an Octopus card with stored value.

 

I certainly know that BlackBerry Product Management is aware of this as being an important use case since many transport cards in Asia are based on Felica. I've also contacted NFC Product Management to ascertain the latest status of their thinking on this use case and I'll let you know if there's any updates.

New Developer
Posts: 13
Registered: ‎10-07-2013
My Device: Q10
My Carrier: HKCSL

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

Thanks John. Just for further sharing, I used the TagInfo app to read an octopus card a moment ago, it showed the card to have a Felica RC-S915 chipset in it.
Retired
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

On Oyster card:

 

I think you'll struggle reading Oyster cards... at least the ones we have in London. These are Mifare DESFire EV1 cards I think and whilst we support them, you won't have the crypto keys needed to access their data.

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
New Developer
Posts: 13
Registered: ‎10-07-2013
My Device: Q10
My Carrier: HKCSL

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

You mean all information about the card are encrypted on Oyster cards? Seems that's different from the case of Octopus, which the remaining balance of the card can be read (as seen in the TagInfo app). Out of curiosity, any idea what sort of data are stored on Oyster? Any server call available to retrieve informations from backend (read only)?
Retired
Posts: 571
Registered: ‎06-25-2010
My Device: Z10
My Carrier: Vodafone

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

I think so but I'm not 100% sure. I looked into Oyster card briefly last year and came away with the impression that you could do nothing with them from an app unless you have the DES keys. I couldn't find any documentation either and google found little more than discussions like the one we're having now.

--------------------------------------------------------------------------------------------
Feel free to press the like button on the right side if you liked my attempts to help :-)
And please mark posts as solved if you think I found the solution or set you on its path. Thanks!
Follow me on Twitter: @mdwrim
Highlighted
Retired
Posts: 170
Registered: ‎09-06-2010
My Device: None
My Carrier: None

Re: Native NFC smartcard reader app (Octopus/Oyster card, etc)

Right! Finally got to the bottom of this.

 

The good news is that Felica support for reading and writing NFC targets is indeed in 10.2.0!!!

 

The way that you use it is as follows. Felica is ISO18092 so you register to be notified of a Felica target being presented using:

 

nfc_register_tag_readerwriter(TAG_TYPE_ISO_18092);

 and one a Felica card is presented you interact with it via APDUs using:

 

nfc_tag_transceive(..., TAG_TYPE_ISO_18092,...);

 It's exactly the same pattern as used for interacting with a ISO14443-3 target where you'd use:

 

nfc_register_tag_readerwriter(TAG_TYPE_ISO_14443_3);
 
// ... and 
 
nfc_tag_transceive(target, TAG_TYPE_ISO_14443_3,...);

 

or an ISO15693-3 target using

 

nfc_register_tag_readerwriter(TAG_TYPE_ISO_15693_3);
 
// ... and 
 
nfc_tag_transceive(target, TAG_TYPE_ISO_15693_3,...);

 The public documentation (https://developer.blackberry.com/native/reference/core/nfc_libref/topic/nfc_tag_transceive.html) seems to have the fact that you can use ISO 18092 on this function missing. This documentation is generated via annotations in the associated header files and you can see that ISO 18092 support is correctly documented in "nfc.h":

 

/**
 * @brief Write a command to one of the following connections: ISO 14443,
 *        ISO 15693, or ISO 18092.
 * @details This function writes a command to one of the following connections:
 *          ISO 14443, ISO 15693, or ISO 18092.
 *
 * @param tag The tag returned from the @c nfc_get_target() function.
 * @param type The type of tag to write to. This must be
 *             @c #TAG_TYPE_ISO_14443_3, @c #TAG_TYPE_ISO_15693_3, or
 *             @c #TAG_TYPE_ISO_18092.
 * @param command A pointer to the buffer holding the command to be sent.
 * @param command_length The length of the command buffer.
 * @param response A pointer to a preallocated response buffer.
 * @param max_response_length The length of the preallocated response buffer.
 *                            The maximum length cannot be larger than the size
 *                            of @c NFC_TRANSCEIVE_RESPONSE_MAX_BUFFER_LENGTH.
 * @param response_length The length of the response copied into the response
 *                        buffer.
 *
 * @return @c #NFC_RESULT_SUCCESS, or one of the following:
 *         - @c #NFC_RESULT_INVALID_PARAMETER: A parameter is invalid.
 *         - @c #NFC_RESULT_SERVICE_CONNECTION_ERROR: The application is not
 *           connected to the NFC system.
 *         - @c #NFC_RESULT_OUT_OF_MEMORY: The system memory available for
 *           the NFC system to complete this operation is insufficient.
 *         - @c #NFC_RESULT_OPERATION_NOT_SUPPORTED: The operation is not
             supported.
 */
NFC_API nfc_result_t nfc_tag_transceive(const nfc_target_t *tag,
                                        nfc_tag_type_t type,
                                        const uchar_t *command,
                                        size_t command_length,
                                        uchar_t *response,
                                        size_t max_response_length,
                                        size_t *response_length);

 So, it looks like this change to the API hasn't found it's way correctly to the web doumentation -- this is what has caused the confusion but this will be fixed :-).

 

That means you should be able to communicate with an Octopus card if you know the correct format of APDUs to send to the card! Let me know how you get on!