Skip to content
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

Added examples on how to write or read NDEF messages using nfccard-tool #31

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
edited NDEF section in readme
  • Loading branch information
somq committed Jan 7, 2018
commit cf67dfa4189fc4a0ae581fb06d92008c3409cc4c
17 changes: 13 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ This library uses pscslite native bindings [pokusew/node-pcsclite](https://githu
- [Can I use this library in my angular-electron app?](#can-i-use-this-library-in-my-angular-electron-app)
- [Do I have to use Babel in my app too?](#do-i-have-to-use-babel-in-my-app-too)
- [How do I require/import this library?](#how-do-i-requireimport-this-library)
- [Can I read a NDEF formatted tag?](#can-i-read-a-ndef-formatted-tag)
- [How to read or write NDEF messages?](#how-to-read-or-write-ndef-messages)
- [Frequent errors](#frequent-errors)
- [TypeError: NFC is not a constructor](#typeerror-nfc-is-not-a-constructor)
- [Transaction failed error when using `CONNECT_MODE_DIRECT`](#transaction-failed-error-when-using-connect_mode_direct)
Expand Down Expand Up @@ -332,12 +332,21 @@ If you want to import uncompiled source and transpile it yourself (not recommend
import { NFC } from 'nfc-pcsc/src';
```

### Can I read a NDEF formatted tag?
### How to read or write NDEF messages?

**Yes, you can!** You can read raw byte card data with `reader.read` method, and then you can parse it with any NDEF parser, e.g. [TapTrack/NdefJS](https://github.com/TapTrack/NdefJS).
**Yes, you can!** First install nfc-tools:

**Psst!** There is also an example ([ndef.js](/examples/ndef.js)), but it is not finished yet. Feel free to contribute.
```sh
npm install nfc-tools --save
somq marked this conversation as resolved.
Show resolved Hide resolved
```

Then run the example:

```sh
npm run example-ndef
```

Read the doc at https://github.com/somq/nfccard-tool#nfccard-tool

## Frequent errors

Expand Down