-
Notifications
You must be signed in to change notification settings - Fork 178
NFC Documentation #691
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NFC Documentation #691
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to move any architecture content to create the technology page.
}; | ||
``` | ||
|
||
#### NFC controller |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If these are separate APIs, they should each get their own page and description.
A detailed design document is available [within the Mbed OS source tree](https://github.com/ARMmbed/mbed-os/docs/design-documents/nfc/nfc_design.md). It details the rationale behind the API design. | ||
|
||
[explorenfc_nucleo]: explorenfc_nucleo.jpg | ||
[n_mark]: n_mark.png |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Query: Do we have an example created for NFC?
|
||
Mbed OS supports the card emulation mode, either through the use of a controller or NFC EEPROM. | ||
|
||
NFC support is available for the NXP PN512 transceiver. In terms of NFC EEPROMs, a driver for the ST M24SR EEPROM series is available - we also provide a [porting guide](https://os.mbed.com/contributing/connectivity/NFCEEPROMDriver.html) to add support for other NFC EEPROMs. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's remove the first part of this, so what we support doesn't quickly become out of date.
|
||
### Getting started with NFC and example | ||
|
||
NFC examples are available on [GitHub](https://github.com/ARMmbed/mbed-os-example-nfc) and demonstrate how to create NFC tags that you can be read from and write to using a phone. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Delete extra word.
|
||
### Design | ||
|
||
A detailed design document is available [within the Mbed OS source tree](https://github.com/ARMmbed/mbed-os/docs/design-documents/nfc/nfc_design.md). It details the rationale behind the API design. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This link is broken, and I can't seem to find where to go to replace it. Could you please point me to the right one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's this one - the link above will become valid once the PR is merged in :)
https://github.com/donatieng/mbed-os/blob/nfc-spec/docs/design-documents/nfc/nfc_design.md
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is really good content here. I'd love to see this is the technology section.
The docs is looking good. Also, would be nice to update the photo "explorenfc_nucleo.jpg" as it looks a bit messy with many cables and can't see much details on the NFC shield. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These look really good, @donatieng
I left a few comments for you to address.
|
||
An application can extend capabilities of `SimpleMessageParser` by adding new record parsers (`mbed::nfc::ndef::RecordParser`) at runtime. | ||
|
||
[](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/FIXME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Add correct link after code merges.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you think it makes sense to add this code at it is, or should we let users import it?
Maybe this code is already available in the mbed-os-example-nfc application?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We do not have any parsing in our examples yet plus 60 lines of well focused code that demonstrate the API are different than an example which just solves a specific use case with the whole NFC API.
Technology examples and API demonstrations are different beasts.
} | ||
``` | ||
|
||
[](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/FIXME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Add correct link after code merges.
|
||
### NFC controller class reference | ||
|
||
[](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/FIXME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Add correct link after code merges.
|
||
### NFC EEPROM class reference | ||
|
||
[](http://os-doc-builder.test.mbed.com/docs/development/mbed-os-api-doxy/FIXME) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note to self: Add correct link after code merges.
@@ -0,0 +1,106 @@ | |||
### NDEF API |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I love this file. Nice work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's Copyright @pan- :)
@@ -0,0 +1,49 @@ | |||
## NFC controller | |||
|
|||
To use an NFC controller, you must initiate the instance with a driver instance, an event queue and a scratch buffer for NDEF messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This tells us how to use it but doesn't say what it is. Could we add a sentence saying what this is and when/why you'd want to use it?
@@ -0,0 +1,28 @@ | |||
## NFC EEPROM | |||
|
|||
To use an NFC controller, you must initiate the instance with a driver instance, an event queue and a scratch buffer for NDEF messages. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure how this sentence about an NFC controller ties in to this page about NFC EEPROM. Could we say what NFC EEPROM is, what it stands for and when/why you'd want to use it?
Note to self: Fix Doxy links after code merges, and upload images after doc merges. |
@donatieng Could you also resolve the merge conflicts when you're finished with your changes? |
using mbed::nfc::ndef::common::SimpleMessageParser; | ||
|
||
void parse_ndef_message(const Span<const uint8_t> &buffer) { | ||
SimpleMessageParser parser; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the purpose of these functions?
Are they included in Mbed OS, or something that a developer will need to copy & paste in their application?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The line above the code it is indicated that mbed::nfc::ndef::common::SimpleMessageParser
is part of the API provided.
The code just demonstrate how to use this class to parse an NDEF message.
using mbed::nfc::ndef::common::URI; | ||
|
||
size_t build_ndef_message(const Span<uint8_t> &buffer) { | ||
MessageBuilder builder(buffer); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same question for this function.
Is this included in Mbed OS or should the developer include this code in their app?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same as above, it is explicitly that mbed::nfc::ndef::MessageBuilder
is part of the API mbed OS provide.
It just demonstrate how an application can create an NDEF message.
Make initial copy edits.
Fix minor grammar nits.
Copy edit for consistent capitalization across docs.
Copy edit file for consistent capitalization across docs.
Copy edit for image formatting.
Copy edit for minor formatting and grammar nits.
Change passive to active voice.
Copy edit for active voice.
@donatieng Thanks for making those changes 👍 |
Note to self: Add pages to .json after merging. |
@donatieng I can't find the APIs in the Doxygen. Could you please help me? |
Fix missing link.
Fix missing link.
Add missing links.
This is the associated docs PR for ARMmbed/mbed-os#7822