Reading Usart to a Buffer
Hi, I'm trying to read from Usart2 RX and store the data to a Buffer (as a long string) and then send the buffer out using Usart1, but I want to keep the buffer (string) do to some working with it at a later point. but for some reason i'm only seeing 1 byte out to Usart1.
I'm using the following code, I'm probably missing somthing simple or trying to do something thats not possible?
Serial comms:
Usart2 data = +CMT: "+xxxxxxxxxxxxx","xxxxxxxxxxxxx","15/08/13","15:38:02"+4",17\r\nTextMessage\r\n
Usart1 output = +
I'm using the following code, I'm probably missing somthing simple or trying to do something thats not possible?
Serial comms:
Usart2 data = +CMT: "+xxxxxxxxxxxxx","xxxxxxxxxxxxx","15/08/13","15:38:02"+4",17\r\nTextMessage\r\n
Usart1 output = +
- Code: Select all
dim b as string(256)
dim nxtStr as ushort = 0
while Uart2.DataAvailable = true
b(nxtStr) = Uart2.Readbyte()
nxtStr += 1
end while
for i as ushort = 0 to nxtStr
Uart.Write(b(i),13,10)
next