• Using the docs:

    https://www.espruino.com/Reference#l_Wif­i_getIP

    and line note L414

    https://github.com/espruino/Espruino/blo­b/master/libs/network/jswrap_wifi.c#L409­

    'An object representing the station IP information, if available immediately (ONLY on ESP8266/ESP32)'

    As I read that, the ONLY reference is for ESP's IF 'available immediately' as a comma separates the detail, delineating the return object.

    If this is specific to ESP's, then the note is in the wrong place as it should stand out for the entire function, but then why have IP detail NOT be available for Espruino WiFi devices then as the build includes that function. Doesn't make sense. As the module WiFi is for Espruino WiFi devices:

    Heading 'Connect to an AP'

    https://www.espruino.com/WiFi

    then that return value should be there for those also.


    EDIT: Attempt as an AP

    >wifi.startAP('EspruinoAP', { password: '0123456789', authMode: 'wpa2' }, function(err) {
    :  if (err) throw err;
    :  console.log("Connected!");
    :});
    =undefined
    Connected!
    >wifi
    ={
      connect: function (a,b,c) { ... },
      disconnect: function (a) { ... },
      startAP: function (a,b,c) { ... },
      stopAP: function (a) { ... },
      scan: function (a) { ... },
      getIP: function (a) { ... },
      setIP: function (a,b) { ... },
      getAPIP: function (a) { ... },
      setAPIP: function (a,b) { ... },
      setHostname: function (a,b) { ... },
      ping: function (a,b) { ... },
      turbo: function (a,b) { ... },
      debug: function () { ... },
      at: {
        debug: function (a) { ... },
        cmd: function (a,b,c) { ... },
        write: function (a) { ... },
        cmdReg: function (a,b,c,d,e) { ... },
        registerLine: function (a,b) { ... },
        unregisterLine: function (a) { ... },
        register: function (a,b) { ... },
        unregister: function (a) { ... },
        isBusy: function () { ... },
        getData: function (a,b) { ... }
       }
     }
    >wifi.getIP()
    =undefined
    Uncaught Error: Function "a" not found!
     at line 1 col 165
    ...ce(15,-1);else if("OK"==d){a(null,b);return}return h}
                                  ^
    in function "c" called from line 1 col 25
    g=void 0;var b;c&&(b=c(a))?(g=e,c=b):clearTimeout(d);­void 0=...
                            ^
    in function "g" called from line 2 col 4
    g(f)}b=b.substr(a+1);if(p&&d)return q("");"\n"==b[0]&&(b=b.s...
       ^
    in function called from system
    Uncaught Error: Function "a" not found!
     at line 1 col 15
    if(void 0===d)a("Timeout");else{if("+CIFSR:STAIP­"==d.substr(...
                  ^
    in function "c" called from line 1 col 15
    g=void 0;c&&c();void 0===g&&0<k.length&&f.cmd.apply(f,k.shif.­..
                  ^
    in function called from system
    > 
    
About

Avatar for Robin @Robin started