This is what the IDE Is using to connect to the bangle and download a file. Maybe the app will have to talk to bangle a bit, to respond with a connection request after the bangle initiates ??. Im not sure if it matters who initiates the connection, need further advice. Essentially its just reading a file and everything that it prints out, is the file contents, which gets sent over the serial/Uart.
Espruino.Core.Utils.executeStatement(`(function(filename) {
var f = require("Storage").open(filename,"r");
var d = f.read(INSERT_CHUNK_SIZE_HERE);
while (d!==undefined) {
console.log(btoa(d));
d = f.read(INSERT_CHUNK_SIZE_HERE);
}
})(INSERT_FILE_NAME_HERE);`
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
This is what the IDE Is using to connect to the bangle and download a file. Maybe the app will have to talk to bangle a bit, to respond with a connection request after the bangle initiates ??. Im not sure if it matters who initiates the connection, need further advice. Essentially its just reading a file and everything that it prints out, is the file contents, which gets sent over the serial/Uart.