NFC vCard

Posted on
of 2
/ 2
  • I don't have time to look into this properly right now, but as a sanity check does NRF.nfcURL("") work fine for you, so you're sure you can read the Pixl normally?

    It's just the VCARD code that is the issue?

  • Hello @Gordon, thank you for your response.

    It's just the VCARD code that is the issue?

    That is correct. nfcURL works without issue and can be read with multiple devices.

  • Ok, thanks. Does it work on other readers, for example Android?

    @AntiCat did mention in­929/ that you need to add that extra bit of code for iPhone. Did you give that one a try?

  • Does it work on other readers, for example Android?

    Yes, the NRF.nfcURL(...) was tested with and Android tablet and older Android phone as well.

    @AntiCat did mention in­929/ that you need to add that extra bit of code for iPhone. Did you give that one a try?

    Yes. But I will be the first to say it's not clear to me what order to perform this. If you combine the code samples, it does not work - but I do not expect it to either. It has to be something so simple that I am missing:

    var data = new Uint8Array(16+872);
    data.set("\x00\x00\xE1\x10\x6D\x00\x03\x­00\xFE\x00", 0x0A);
    var tag = require("NFCTag").create(data);
    var vcard = require("NFCvCard").create("BEGIN:VCARD\­n"+
                                         "FN:John Doe\n"+
                                         "TEL;WORK;VOICE:(111) 555-1212\n"+

    Maybe @AntiCat could post the full code used to get it working so I can copy/paste it on my end and see similar results?

  • Sat 2019.11.02

    'I have provided what I thought was everything you asked for'

    I re-read the posts starting with the #8 original inquiry. The requests are there in plain sight. It is quite possible @Tesseract-Developer that I over estimated the troubleshooting skill level using the environment within the WebIDE. Tackling a local module usually isn't a first step introduction. Maybe too much detail was missed going between posts, perhaps?

    As Gordon pointed out in #26 for the next week next no time is available and for the two weeks following that, will be super busy, so his ability to apply 'nitty-gritty' debugging will be virtually non-existent. While we wait, how well are you able to debug? One course of action could be to cut-n-paste the individual module functions into your own code, and wrap those with try/catch statements or use the WebIDE debugger.

    The response to test in post #26 further suggests the hunch I had still stands.

    We still need more information to narrow down where to look. If what I suspect isn't the case, we may be at the step #29 request. If taking a peek reveals what I suspect, then we may need one or more additional steps. In either case, any onlooker will require this detail to avoid back-n-forth requests for the additional detail. I'm prepared to avail myself this weekend to get the basics out of the way.

    As I pointed out in #22 I'm now at a dis-advantage without a device to test, so I'll be relying on the feedback provided me, and what I discovered last week.

    I also inquired about:

    ref: #10 #11 #13 #15 ' I attempted to simply change the "NFCvCard" to "NFCTag" '
    'Could this now be bad information perhaps?'

    I was looking for your explanation here. To me it seems the text string are reversed, based on the code snippet provided in #29.

    Lets start with answering that so we are all on the same page, and we'll just handle one item at a time to eliminate possible confusion along the way.

  • I'm not 100% sure, but maybe if you edited the NFCvCard as follows:

    NFCvCard.prototype.publish = function(data) {
      //wrap vCard using template data
      this._record = new Uint8Array(C.HEADER.length + data.length + C.TERM_TLV.length);
      this._record.set(C.HEADER, 0);
      this._record.set(data, C.HEADER.length);
      this._record.set(C.TERM_TLV, C.HEADER.length + data.length);
      //inject NDEF Message length
      this._record[C.ML_OFFSET] = C.RECORD_HEADER_LEN + data.length;
      //inject payload length
      this._record[C.PL_LSB_OFFSET] = data.length;
      this._record.set("\x00\x00\xE1\x10\x6D\x­00\x03\x00\xFE\x00", 0x0A);
      //publish new vCard

    but that's a total guess I'm afraid

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview

NFC vCard

Posted by Avatar for AntiCat @AntiCat