ESP8266_AT/YAT4LConf/xts_yat4l_dev_fs.h
// stops on 0x00 (because of TEXTFile)

stops on 0x00 (because of TEXTFile)
stops on 0x00 ( because of TEXTFile )
int yat4l_fs_writeTextFile(char* fileName, char* source, int maxLen) {
    if ( fileName == NULL || source == NULL || maxLen < 0 ) {
        return -1;
    }
    if ( maxLen == 0 ) { return 0; }
    File f = SD.open( fileName, O_CREAT | O_WRITE );
    if ( !f ) {
        return -1;
    }
    f.truncate(0);
    int ch,i;
    for(i=0; i < maxLen; i++) {
        ch = source[i];
        if ( ch <= 0 ) { break; }
        f.write(ch);
        if ( i % 32 == 0 ) { f.flush(); }
    }
    f.flush();
    f.close();
return i;
}
int yat4l_fs_writeTextFile ( char * fileName , char * source , int maxLen ) { if ( fileName == NULL || source == NULL || maxLen < 0 ) { return -1 ; } if ( maxLen == 0 ) { return 0 ; } File f = SD . open ( fileName , O_CREAT | O_WRITE ) ; if ( ! f ) { return -1 ; } f . truncate ( 0 ) ; int ch , i ; for ( i = 0 ; i < maxLen ; i ++ ) { ch = source [ i ] ; if ( ch <= 0 ) { break ; } f . write ( ch ) ; if ( i % 32 == 0 ) { f . flush ( ) ; } } f . flush ( ) ; f . close ( ) ; return i ; }
stops on 0x00 (because of TEXTFile)
stops on 0x00 ( because of TEXTFile )
// erase file content
