Additional Documentation Request

Posted on
  • @Gordon,

    Few of the functions defined in the Espruino reference define limits for the parameters. For example setTimeout does not specify a valid range for the timeout. I would expect hardware limits the max timeout or perhaps code handles values larger than hardware bounds, but the documentation does not provide users such knowledge.

    It looks as though the parameter range for many functions may not matter. For example serial.write takes a string, I assume as large as can be stored, and streams it out.

    If would be helpful to add more parameter information as code evolves and changes get made to functions. In the interim, do you have any words of wisdom, gotchas, etc. regarding parameter constraints in general.

  • Thanks - I'll bear that in mind.

    In general, I try hard to ensure that there are no real limits to the values you can supply - so you can set a timeout 50 years in the future if you want to :)

    All I'd say is if you're passing strings, sometimes Espruino needs to allocate memory for a return value or buffer, so if you're passing in a huge string and there's not at least the same amount of free memory, don't be surprised it it fails.

    Otherwise, it should be ok - if you encounter anything odd, let us know and I can try and update the docs for those specific functions.

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

Additional Documentation Request

Posted by Avatar for CanyonCasa @CanyonCasa

Actions