Avatar for AntiCat

AntiCat

Member since Feb 2015 • Last active Jun 2018
  • 13 conversations
  • 77 comments

Most recent activity

  • in The Place for Patreon Patrons
    Avatar for AntiCat

    It works now - thank your for resolving the issue so quickly.

  • in The Place for Patreon Patrons
    Avatar for AntiCat

    I'm using a Mac, WebIDE version is 0.68.6 and a Puck with the latest travis build 1v98+1.

  • in The Place for Patreon Patrons
    Avatar for AntiCat

    I've a pretty large application consisting of 5 modules (loaded with require) and a main.
    I've enabled "Save on Send" and set "Minification" as well as "Module Minification" to "Closure Simple".

    The upload kind of succeeds but the execution fails with

    >Uncaught InternalError: NRF ERROR 9
     at line 1 col 7573
    ...bounce:50,repeat:!0})});\n");load();
    

    Further more the saved code is garbage:

    dump();
    // Code saved with E.setBootCode
    ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿ...
    
    require("Storage").read(".bootcde");
    ="\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF....
    

    If reduce my code size by deleting functions, everything turns back to normal.

    Can this be fixed? I'm also happy with a solution where I upload the modules and the main separately.

  • in ESP8266
    Avatar for AntiCat

    I vote for handling undefined and missing the same way. Default function parameters are implemented in javascript using a check for undefined - an example:

    function multiply(a, b) {
      b = (typeof b !== 'undefined') ?  b : 1;
      return a * b;
    }
    

    Source: https://developer.mozilla.org/en-US/docs­/Web/JavaScript/Reference/Functions/Defa­ult_parameters

    I believe adding a distinction between undefined and missing breaks the spec too.

  • in ESP8266
    Avatar for AntiCat

    @MaBe The documentation to setTimeout states:

    Returns An ID that can be passed to
    clearTimeout

    To answer your question calling a function without an argument is identical to calling it with undefined

  • in Puck.js, Pixl.js and MDBT42
    Avatar for AntiCat

    .removed

  • in Puck.js, Pixl.js and MDBT42
    Avatar for AntiCat

    I'll open a pull request for NFCTag.js on the weekend.

    About downloading arbitrary data using NFC:
    It's generic and works for text, images, js... for this reason the data is wrapped in a NDEF MIME Record. Andoird features an API for wrap und unwrap.

    Wrap and unwrap is missing from Pucks JS-Engine, namely:

    • Parse and skip NDEF Message Header. (Usually 2 or 4 bytes)
    • Parse and skip NDEF MIME-Record Header. (Here length greatly depends on the payload type string e.g. "text/javascript" is already 15 bytes on it's own.)

    If there is interest I would invest some time into a MIME record wrap unwrap module.

    • 7 comments
    • 377 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for AntiCat

    Yes, iPhone 7, 8, X with iOS11 (released in September 2017) feature a NFC reader API for NDEF records. (No write support and no arbitrary tag type support, just NDEF read.)

    I'd like to have NFCTag.js listed. Should I open a pull request?
    Since NFCTag.js implements write support, it opens up additional possibilities. In theory you could download code to a Puck using NFC...

    I've come up with an additional example:

    var data = new Uint8Array(16+768);
    data.set("\xE1\x11\x60\x00", 0x0C);
    var tag = require("NFCTag").create(data);
    

    This code creates an empty tag with 768 bytes of writable storage.

    The data can be initialized with an Android App, i.e.
    https://play.google.com/store/apps/detai­ls?id=com.nxp.nfc.tagwriter

Actions