• No problem :)

    The idea is eventually the Bangle.js-specific Gadgetbridge app for Android will run the App Loader website internally. It should then be able to run the AGPS upload code in the background (maybe at midnight?).

    Wow, that is complex. Is it possible, may be via the GB, or another way, just to download a content from an URL?

    I guess it would make a lot of sense to detect the chunks of data in the ble_epo_offline.bin file and instead split the data into those blocks? That way we'd have a nice pause between transmission of each

    I believe it would work better than just relying on 128 bytes chunks. Because end of previous message and beginning of next one can be inside a chunk.
    And CASIC doc states in 2.5 CASIC message exchange, that app should not send next message before it receives ACK.
    Though I do not trust Zhongke anymore :), and it can be Ok to send without awaiting for ACK, I just believe it makes sense to wait for it.

    Regarding a pause. I am really missing it. Tried to implement sleep() in C, but got an error

    Uncaught Error: 'E.InlineC' calls should have been replaced by the Espruino tools before upload
    
  • Regarding a pause. I am really missing it.

    there are promises, setTimeout (just google 'javascript sleep') or in this case you can send next message in ack/nack handler of previous message?

    Tried to implement sleep() in C

    To make fastest sleep ever? You can shoot yourself in the foot much easier in javascript via for or while loop, or even digitalPulse, no need for inline C to block everything.

    Uncaught Error: 'E.InlineC' calls should have been replaced

    this needs to run gcc behind scenes, you are probably copy pasting directly to console or directly upload file or compiler in WebIDE does not work for some reason.

  • there are promises, setTimeout (just google 'javascript sleep')

    promises are too cumbersome (for me :)). setTimeout is not blocking current "thread". Though it is possible to issue multiple growing timeouts for each message.

    or in this case you can send next message in ack/nack handler of previous message?

    That is exactly what I've done. And this is the best way. Better than a "pause".

    To make fastest sleep ever? You can shoot yourself in the foot much easier in javascript via for or while loop, or even digitalPulse, no need for inline C to block everything.

    while loop will eat energy. Sleep supposed to halt CPU. Yes in case of single threaded it will stop everything. Question - will it stop UARTs?

    this needs to run gcc behind scenes, you are probably copy pasting directly to console

    yes :(. Understood.

About

Avatar for fanoush @fanoush started