JosephHewitt/wardriver_rev3

Stop reading OTA firmware byte-by-byte?

Opened this issue · 0 comments

The updates to A are loaded in chunks into a 4096 buffer one byte at a time:

while (binreader.available()) {
     byte c = binreader.read();
     binbuf[counter] = c;
     counter++;

This can likely be refactored to something like what was recently used for uploading files to WiGLE, eg:

#define CBUFLEN 1024
byte cbuf[CBUFLEN];
while (filereader.available()){
    long bytes_available = filereader.available();
    int toread = CBUFLEN;
    if (bytes_available < CBUFLEN){
      toread = bytes_available;
    }
    
    filereader.read(cbuf, toread);

Check if this increases the OTA update speed. This doesn't need to be done for B since that has other bottlenecks elsewhere.