Where can I find the actual bangle.js file/code?

Posted on
  • Sorry to bother you with that question, but after all the search on github (quite limited IMO) I could not find the actual (most likely named like) bangle.js and/or espruino.js files.
    I am trying to build a standalone workspace with VSCode and/or Webstorm?
    Glad for any hint in the right direction. Thank you.

  • Hi!

    It's not clear to me what you mean. Could you describe in more detail? Do you want to look at the firmware code?

  • I mean the functionality that supplies E. (the object that defines Espruino general logic) and Bangle. (the object that defines Bangle specific functionality like eg GPS)
    Where is the code for that defined?

  • I mean the functionality that supplies E. (the object that defines Espruino general logic)

    E is
    https://github.com/espruino/Espruino/blob/master/src/jswrap_espruino.c#L44
    Bangle is
    https://github.com/espruino/Espruino/blob/master/libs/banglejs/jswrap_bangle.c

    However I fail to see how it is supposed to be related or how it could help you with right direction for "standalone workspace with VSCode and/or Webstorm"

  • @papam have you come across the espruino tutorials and examples? https://www.espruino.com/Tutorials

    They are helpful 😇

    Edit: There is also a vscode extension: https://forum.espruino.com/conversations/392441/

  • If you want to find out where something specific is defined, to find out how it works, to play with it to improve the documentation, you can just find it at https://www.espruino.com/Reference#software then in the title you'll see an icon like ⇒ - click that and it will take you to the exact place in the code where the function is defined.

    But in many cases (especially for E. and Bangle.) the code is probably not JS, but C

  • But in many cases (especially for E. and Bangle.), the code is probably not JS, but C

    Yes, that is where I tripped. Thank you
    Though, does there have to be some wrapper around it then?
    Edit: Else, how would the Web-IDE make helpful code-sensitive suggestions?

  • how would the Web-IDE make helpful code-sensitive suggestions?

    The IDE works off a file that describes every function (https://www.espruino.com/json/espruino.json) - the file is automatically generated from the /*JSON ... */ comments which are in the C code above the function itself (they are also used for adding the function into Espruino itself)

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

Where can I find the actual bangle.js file/code?

Posted by Avatar for papam @papam

Actions