
' ============================================================
'  This example sends the file line by line
'  It works also with short buffers
' ============================================================

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


Label SendFileToCOM
	Variable String FileName
	Variable String FileString
	'
	COM DiscardOutBuffer
	'
	Load FileString FileName
	
	v2 = Len(FileString)
	For v1 = 1 To v2 Step 32
		s1 = Mid(FileString, v1, 32)
		s1  = Replace(s1, CRLF, "{{{CRLF}}}")
		COM WriteString s1 + CRLF
	Next
	Wait Seconds 1
	COM WriteString "{{{FileEndMarker}}}" + CRLF
Return


'WATCH COM_Status
