This program demonstrates how to use a MicroNFCBoard as a peripheral from any mbed target and blink the board's LEDs.

Dependencies:   MicroNFCBoardAPI mbed

Fork of MicroNFCBoardAPI_Blink by AppNearMe Official

Files at this revision

API Documentation at this revision

Comitter:
AppNearMe
Date:
Thu May 14 16:43:09 2015 +0000
Parent:
0:e6bbb5a92267
Commit message:
Initial commit

Changed in this revision

MicroNFCBoardAPI.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/MicroNFCBoardAPI.lib	Fri Apr 24 13:01:12 2015 +0000
+++ b/MicroNFCBoardAPI.lib	Thu May 14 16:43:09 2015 +0000
@@ -1,1 +1,1 @@
-http://developer.mbed.org/teams/AppNearMe/code/MicroNFCBoardAPI/#1d246e0872c6
+http://developer.mbed.org/teams/AppNearMe/code/MicroNFCBoardAPI/#9b0733b8fa95
--- a/main.cpp	Fri Apr 24 13:01:12 2015 +0000
+++ b/main.cpp	Thu May 14 16:43:09 2015 +0000
@@ -30,51 +30,4 @@
         wait_ms(200);
         b = !b;
     }
-    
-    //Start polling
-    while(true)
-    {
-        printf("Poll\r\n");
-        nfc.startPolling();
-        
-        while( nfc.polling() );
-        
-        if( nfc.type2() )
-        {
-            printf("Connected to type 2 tag\r\n");
-        }
-        else if( nfc.p2p() )
-        {
-            printf("Connected in P2P mode\r\n");
-        }
-        
-        bool ndefRead = false;
-        bool ndefReadingStarted = false;
-        while( nfc.connected() )
-        {
-            if( !ndefReadingStarted && nfc.ndefReadable() )
-            {
-              printf("Reading tag\r\n");
-              ndefReadingStarted = true;
-              nfc.ndefRead();
-            }
-            if( !ndefRead && nfc.ndefPresent() )
-            {
-                printf("Got message\r\n");
-                char buf[512];
-                if( nfc.readNdefUri(buf, sizeof(buf)) )
-                {
-                  printf("Got URI: %s\r\n", buf);
-                }
-                if( nfc.readNdefText(buf, sizeof(buf)) )
-                {
-                  printf("Got Text: %s\r\n", buf);
-                }
-                ndefRead = true;
-            }
-        }
-        
-        printf("Disconnected\r\n");
-    }
 }
- 
\ No newline at end of file