The aim of this lab class is to learn the basics about how to read and write NFC tags using libnfc and our. You will develop two small applicatons: The “PIT coin administrator” and the “PIT coin withdrawer”. You will acquire detailed knowledge on how to solve the exercise by attending the tech talk given by Sebastian.

Preparations

Before coming to this lab class you should

  • Read about the specifications of our NFC readers
  • Install the NFC drivers
  • Install the¬†libnfc 1.6.0-rc1 library and read about it.

All of the above information and software can be accessed from the PIT Lab blog here.

Exercise

PIT coin administrator

This application should initialize a tag by writing a PIT coin header, ID number, name, email address, and initial PIT coin amount to it. If you want, you can also choose different method (without a real user interface) to reset and/or add PIT coins to the tag. The important thing is that you have a way of doing it.

PIT coin withdrawer

This application automatically

  • withdraws 1 PIT coin from the existing PIT coin amount stored on a PIT coin NFC tag placed on the NFC reader/writer, and
  • displays the current PIT coin amount on the screen after the withdrawal has been effected.

If you want, you can combine the above two applications into one. The important thing is that you provide a solution both for filling up the PIT coin amount stored on the tag, and for putting the system in a state such that it reduces the amount one notch every time the tag is placed on the reader.

72 Responses to “Lab Class #7 - “PIT coin” NFC tag read and write exercise”


  1. 1 scas March 30, 2012 at 08:28

    So, basically there is a daemon (nfc-eventd) which can check if a tag has been inserted or removed, and an action can be taken. But, when it checks for a reader and gets it’s functionality, you cannot use another tool to read/write on the tag.
    * COMMENT:
    * There are no way in libnfc API to detect if a card is present or not
    * so the way we proceed is to look for an tag
    * Any ideas will be welcomed
    */

  2. 2 David Thomas March 30, 2012 at 09:30

    For a hint on what commands to send the card, have a look at the ACR122PCSCScriptingTool that came with the ACS SDK - there’s a sample script.

    We had luck using a C# PC/SC API from SpringCard (http://www.springcard.com/solutions/pcsc.html), though the licence isn’t particularly friendly and we’ll be using Java for the mandatory assignment.

  3. 3 jenc March 30, 2012 at 10:29

    Hi

    You can also read about the commands in this document (see datasheet(pdf) link).

    See under mifare classic commands (chapter 10).

    http://www.nxp.com/products/identification_and_security/smart_card_ics/mifare_smart_card_ics/mifare_classic/MF1S503x.html

  4. 4 scas April 1, 2012 at 19:22

    Here is a nice tutorial how to use Java SmartCardio API in order to read a MIFARE Classic tag.
    Hope it helps!
    http://ieatbinary.com/2009/02/11/reading-mifare-1k-card-using-java-in-linux/

  5. 5 sbut April 10, 2012 at 09:12

    regarding 64 bit Windows:

    the ACS SDK is 32 bit only, but can be made to work on 64bit:

    * create a shortcut
    * rightclick on it,
    * go to properties, click in target,
    * add -32biteverything at the end of the line

  6. 6 clyn April 14, 2012 at 13:39

    For java on Windows 7 x64 the Jacspcsc.dll doesn’t work (because it’s compiled for 32bit I guess) so you can use the java smartcardio package instead
    http://download.oracle.com/javase/6/docs/jre/api/security/smartcardio/spec/javax/smartcardio/package-summary.html

    Reference:
    http://stackoverflow.com/questions/6226999/acr122-usb-sdk-jni-calls-to-winscard-dll

    If you want to use some other programming language on windows you might have luck with http://sourceforge.net/apps/trac/libusb-win32/wiki/libusbwin32_examples

    Tip: you can only read/write binary data to Mifare Ultralight tags but on the other hand they don’t require authentication.

  1. 1 www.viberforpc.net Trackback on December 31, 2012 at 05:44
  2. 2 Get the facts Trackback on March 15, 2013 at 00:17
  3. 3 sub zero appliance repair Trackback on March 15, 2013 at 03:02
  4. 4 seo firm Trackback on March 15, 2013 at 06:16
  5. 5 www.fishermanbook.com Trackback on March 15, 2013 at 08:18
  6. 6 dishwasher repair Trackback on March 15, 2013 at 10:04
  7. 7 maytag refrigerator repair Trackback on March 15, 2013 at 17:27
  8. 8 braggersboard.com Trackback on March 15, 2013 at 18:23
  9. 9 please click for source Trackback on March 15, 2013 at 18:48
  10. 10 electrical services dallas Trackback on March 15, 2013 at 19:23
  11. 11 just click the following internet page Trackback on March 15, 2013 at 19:53
  12. 12 appliance repair northridge Trackback on March 15, 2013 at 20:06
  13. 13 click through the up coming web site Trackback on March 15, 2013 at 20:10
  14. 14 electrical repair Trackback on March 15, 2013 at 21:43
  15. 15 click through the up coming page Trackback on March 15, 2013 at 21:58
  16. 16 dryer repair Trackback on March 15, 2013 at 22:19
  17. 17 Read More Trackback on March 16, 2013 at 00:39
  18. 18 appliance repair in los angeles Trackback on March 16, 2013 at 00:59
  19. 19 keep reading Trackback on March 16, 2013 at 01:10
  20. 20 http://facebookwater.com/ Trackback on March 16, 2013 at 02:12
  21. 21 frigidaire repair Trackback on March 16, 2013 at 02:19
  22. 22 similar web-site Trackback on March 16, 2013 at 02:22
  23. 23 Recommended Web site Trackback on March 16, 2013 at 02:38
  24. 24 air conditioning repair Trackback on March 16, 2013 at 03:24
  25. 25 Going At this website Trackback on March 16, 2013 at 03:29
  26. 26 please click the up coming document Trackback on March 17, 2013 at 08:17
  27. 27 Recommended Site Trackback on March 17, 2013 at 08:46
  28. 28 visit the up coming post Trackback on March 17, 2013 at 09:02
  29. 29 Read More At this website Trackback on March 17, 2013 at 09:16
  30. 30 linked internet page Trackback on March 17, 2013 at 09:21
  31. 31 Click This Link Trackback on March 17, 2013 at 09:45
  32. 32 simply click the next website page Trackback on March 17, 2013 at 10:29
  33. 33 buy twitter accounts Trackback on March 22, 2013 at 12:41
  34. 34 seo for small business Trackback on March 26, 2013 at 17:33
  35. 35 phen 375 Trackback on April 3, 2013 at 05:03
  36. 36 1ml syringe Trackback on April 7, 2013 at 02:02
  37. 37 medicine Trackback on April 7, 2013 at 02:16
  38. 38 Hydrapeel Melbourne Trackback on April 15, 2013 at 05:45
  39. 39 smart circle directv Trackback on April 19, 2013 at 08:08
  40. 40 best appliance repair charleston Trackback on April 19, 2013 at 08:29
  41. 41 smart circle directv braves Trackback on April 19, 2013 at 09:16
  42. 42 affordable appliance repair st petersburg Trackback on April 19, 2013 at 09:40
  43. 43 top appliance repair tampa Trackback on April 19, 2013 at 10:57
  44. 44 top appliance repair clearwater Trackback on April 19, 2013 at 11:38
  45. 45 car wash business Trackback on April 19, 2013 at 11:41
  46. 46 best appliance repair st petersburg Trackback on April 19, 2013 at 12:28
  47. 47 neuroma Trackback on April 19, 2013 at 12:54
  48. 48 appliance repair Houston rates Trackback on April 19, 2013 at 13:06
  49. 49 affordable atlanta seo company Trackback on April 19, 2013 at 14:31
  50. 50 rep management Trackback on April 19, 2013 at 14:43
  51. 51 appliance repair chicago Trackback on April 19, 2013 at 15:31
  52. 52 appliance repair charleston cost Trackback on April 19, 2013 at 16:07
  53. 53 Kristen Howe Chemistry Video Trackback on April 19, 2013 at 16:15
  54. 54 affordable appliance repair Houston Trackback on April 19, 2013 at 16:20
  55. 55 tips for Trackback on April 19, 2013 at 16:40
  56. 56 online brand building Trackback on April 19, 2013 at 17:26
  57. 57 affordable appliance repair chicago Trackback on April 19, 2013 at 18:45
  58. 58 appliance repair clearwater cost Trackback on April 19, 2013 at 18:52
  59. 59 best atlanta seo company Trackback on April 19, 2013 at 19:21
  60. 60 smart circle directv international Trackback on April 19, 2013 at 22:45
  61. 61 smart circle directv coupons Trackback on April 20, 2013 at 11:34
  62. 62 appliance repair clearwater rates Trackback on April 21, 2013 at 15:17
  63. 63 best appliance repair tampa Trackback on April 21, 2013 at 22:20
  64. 64 weight loss blog Trackback on May 4, 2013 at 05:52
  65. 65 major appliance parts Trackback on May 4, 2013 at 10:42
  66. 66 ge glass top stoves Trackback on May 6, 2013 at 11:11

Leave a Reply

You must login to post a comment.