Skip to content

Commit

Permalink
Merge pull request #13 from ARMmbed/mbed-os-5.10.0-oob
Browse files Browse the repository at this point in the history
Mbed os 5.10.0
  • Loading branch information
pan- authored Sep 26, 2018
2 parents 44b4618 + 2ae5e69 commit a9ffb1b
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 21 deletions.
3 changes: 3 additions & 0 deletions NFC_EEPROM/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,6 @@ Run the build:
mbed compile -t <ARM | GCC_ARM> -m <YOUR_TARGET>
```

# Known issues

* This example doesn't work with IAR 7.80.
2 changes: 1 addition & 1 deletion NFC_EEPROM/mbed-os.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/mbed-os/#3fb5781af180c32a6062f050d59cdf93654b3e9f
https://github.com/ARMmbed/mbed-os/#610e35ddc6d59f153173c1e7b2748cf96d6c9bcd
4 changes: 0 additions & 4 deletions NFC_SmartPoster/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ The smart poster record generated contains:

Verification of the sample application can be seen on any a smartphone with an NFC reader. After running you will be able to read the tag with an NFC tag reader application.

Information about activity is also printed over the serial connection - please have a client open. You may use:

- [Tera Term](https://ttssh2.osdn.jp/index.html.en)

This example is known to work on boards connected to a PN512 shield.

## Building instructions
Expand Down
17 changes: 2 additions & 15 deletions NFC_SmartPoster/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,15 +103,10 @@ class NFCProcess : NFCRemoteInitiator::Delegate, NFCController::Delegate {
/* ------------------------------------------------------------------------
* Implementation of NFCRemoteInitiator::Delegate
*/
virtual void on_connected()
{
printf("Connected\r\n");
}
virtual void on_connected() { }

virtual void on_disconnected()
{
printf("Disconnected\r\n");

// reset the state of the remote initiator
_nfc_remote_initiator->set_delegate(NULL);
_nfc_remote_initiator.reset();
Expand All @@ -120,15 +115,10 @@ class NFCProcess : NFCRemoteInitiator::Delegate, NFCController::Delegate {
_nfc_controller.start_discovery();
}

virtual void parse_ndef_message(const Span<const uint8_t> &buffer)
{
printf("Received an ndef message of size %d\r\n", buffer.size());
}
virtual void parse_ndef_message(const Span<const uint8_t> &buffer) { }

virtual size_t build_ndef_message(const Span<uint8_t> &buffer)
{
printf("Building SmartPoster message\r\n");

// build the smart poster object we want to send
SmartPoster smart_poster(
URI(URI::HTTPS_WWW, span_from_cstr("mbed.com"))
Expand All @@ -151,16 +141,13 @@ class NFCProcess : NFCRemoteInitiator::Delegate, NFCController::Delegate {
*/
virtual void on_discovery_terminated(nfc_discovery_terminated_reason_t reason)
{
printf("Discovery terminated: %u\r\n", reason);
if(reason != nfc_discovery_terminated_completed) {
_nfc_controller.start_discovery();
}
}

virtual void on_nfc_initiator_discovered(const SharedPtr<NFCRemoteInitiator> &nfc_initiator)
{
printf("Initiator discovered\r\n");

// setup the local remote initiator
_nfc_remote_initiator = nfc_initiator;
_nfc_remote_initiator->set_delegate(this);
Expand Down
2 changes: 1 addition & 1 deletion NFC_SmartPoster/mbed-os.lib
Original file line number Diff line number Diff line change
@@ -1 +1 @@
https://github.com/ARMmbed/mbed-os/#3fb5781af180c32a6062f050d59cdf93654b3e9f
https://github.com/ARMmbed/mbed-os/#610e35ddc6d59f153173c1e7b2748cf96d6c9bcd
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Mbed OS NFC examples

This repository contains all Mbed OS NFC examples actively developped and maintained by the Mbed OS team.


# Known issues

The repository is not meant to be imported directly inside the Mbed online compiler. To import one example inside the online compiler, go to https://os.mbed.com/teams/mbed-os-examples/ and import from here the NFC example of your choice.

0 comments on commit a9ffb1b

Please sign in to comment.