You are reading a single comment by @fanoush and its replies. Click here to read the full conversation.
  • I have written the following function to check for firmware greater than X.Y.Z but its a bit messy.
    Wondering if there is a better way.

        function checkFirmware(maj,min,bld) {
          var major = process.env.VERSION.split(".")[0].split(­"v")[0];
          var minor = process.env.VERSION.split(".")[0].split(­"v")[1];
          var build = process.env.VERSION.split(".")[1];
    
          if (major > maj) return true;
          if (major == 2 && minor > min) return true;
          if (major == 2 && minor == min && build >= bld) return true;
    
          return false;
        }
    

    And then in the App...

          if (!checkFirmware(2,8,187)) {
            g.setColor(1,1,1);
            g.drawString("E-FW", 120, Y_ACTIVITY);
            return;
          }
    

    Also was thinking that the format of the firware version string is a bit odd.
    Why not use major.minor.build instead of major. "v0"minor.build ?

About

Avatar for fanoush @fanoush started