Facebook
From Szymon, 5 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 246
  1. void WriteBuffered(char * ftpfile) {
  2.  
  3.   file.open(ftpfile, O_RDONLY);  
  4.   uint32_t dataLength = file.fileSize();
  5.   Serial.println (dataLength);
  6.  
  7.   uint32_t m;
  8.   size_t n;
  9.   while((m = file.read(clientBuf, bufferSize))>0) {
  10.     n = dclient.write(clientBuf, m);
  11.     while (n != m) {
  12.       delay(100);
  13.       n = dclient.write(clientBuf, m);
  14.     }
  15.   }
  16. }