Newer
Older
mbed-os / TEST_APPS / testcases / nfc / mobileapi.md

NFC test SDK comparison

A comparison of the SDKs exposed to manage NFC tags on Android IOs and Python module PyNFC.

Overview

A comparison which analyses NFC use cases on mobile, as background to the test case design/implementation in the commissioning workflow :NFC-Bluetooth-pairing application.

Comparison

From the lowest level, each programmer interface has a definition for Errors, Link, NDEF, Tags and Sessions. Note: Comparisons are high level and use past experience and old docs.

IOS (objective C)

  1. Errors: are a struct with 3 members:
    int:value,
    struct:string:usererror
    struct:string:localized
  2. isodep:not supported
  3. NDEF support parameters withpayload
    and Typename,
  4. Tags:Are an Object representing tag
  5. Sessions are managed using Delegate &callbacks

Android (Java)

  1. Errors:thrown as IOException with cause and message, there are no returned error datas
  2. isodep:get/set communication parameters and RAW.
  3. NDEF: Includes SNEP
  4. Tags :(3)A,(3)B,(4)F,V and isoDep layer
  5. Sessions Intents and Actions, runtime registration of PendingIntent() allows hooking using tag filters

pynfc (python)

  1. Errors :raises Exceptions nfc.clf.Error and others per class
  2. isodep:get/set communication parameters and RAW.
  3. NDEF: full implementation and types. Includes SNEP
  4. Tags :1,2,(3)A,(3)B,(4)F isoDep layer
  5. Sessions :using delegate class callbacks

Observe

Negative test cases would be better designed around the user cases, than around the implementations, base error conditions at the API layer look more like

  • UnsupportedTarget
  • Communication
  • Protocol
  • (w) Transmission
  • (w) Timeout
  • (w) BrokenLink
  • ValueError

Valuable test data cases shall be for valid and boundary cases for the smartposter NDEF record:

  • uri – URI string ASCII only
  • title – Smart poster title(s), (additional internationalizations with IANA codes not tested)
  • icons – omitted
  • action – The recommended action , a string