NFC
Dependencies: mbed NDefLib X_NUCLEO_NFC01A1
Revision 1:eff1b8998438, committed 2015-12-22
- Comitter:
- giovannivisentini
- Date:
- Tue Dec 22 08:26:13 2015 +0000
- Parent:
- 0:151ae20d098f
- Child:
- 2:0d1d27753045
- Commit message:
- add printf
Changed in this revision
| NDefLib_M24SR.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/NDefLib_M24SR.lib Mon Dec 21 10:17:57 2015 +0000 +++ b/NDefLib_M24SR.lib Tue Dec 22 08:26:13 2015 +0000 @@ -1,1 +1,1 @@ -http://developer.mbed.org/users/giovannivisentini/code/NDefLib_M24SR/#9686f8031e87 +http://developer.mbed.org/users/giovannivisentini/code/NDefLib_M24SR/#94608f7f562b
--- a/main.cpp Mon Dec 21 10:17:57 2015 +0000
+++ b/main.cpp Tue Dec 22 08:26:13 2015 +0000
@@ -53,6 +53,7 @@
pc.printf("System Init done: !\n\r");
//open the i2c session with the nfc chip
if(tag.openSession()){
+ pc.printf("Session open\n\r");
nfcNucleo->getLed1()=1;
//create the NDef message and record
@@ -64,14 +65,18 @@
if(tag.write(msg)){
pc.printf("Tag writed \n\r");
nfcNucleo->getLed2()=1;
- }
+ }else{
+ pc.printf("Error writing \n\r");
+ }//if-else
-
//close the i2c session
- if(!tag.closeSession()){
+ if(tag.closeSession()){
+ pc.printf("Session closed\n\r");
+ nfcNucleo->getLed3()=1;
+ }else{
pc.printf("Error Closing the session\n\r");
- }else
- nfcNucleo->getLed3()=1;
+ }//if-else
+
}else
pc.printf("Error open Session\n\r");
}