
' =============================================================
'  This example sends all the file with a single buffer
'  It could not work if file-length is more then buffer-length
' =============================================================

FileName = "FileToSend.csv"
COM Open 12 115200
Gosub SendFileToCOM
Stop


Label SendFileToCOM
	Variable String FileName
	Variable String FileString
	'
	COM DiscardOutBuffer
	'
	Load FileString FileName
	COM WriteString "{{{FileStartMarker}}}" + CRLF
	Wait Seconds 0.2
	'
	FileString = Replace(FileString, CRLF, "{{{CRLF}}}")
	FileString = Replace(FileString, CR,   "{{{CRLF}}}")
	FileString = Replace(FileString, LF,   "{{{CRLF}}}")
	COM WriteString FileString + CRLF
Return


'WATCH COM_Status
