Hello,
I have a small program that receives data on com1 using the receive interrupt
The program calls Debug.print(“test”) twice a second.
When I send data to the port (19200 baud packets of 64 bytes about 20 times a second) I get these
additional prints in the output window. Can you tell me where I can find documentation that explains more about what the things that show up in the output window mean?
thanks,
Peter
using System;
using System.Threading;
using System.IO.Ports;
using System.Text;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
namespace serialTest3
{
public class myTest
{
public static void Main()
{
SerialPort UART = new SerialPort("COM1", 19200);
int read_count = 0;
byte[] rx_byte = new byte[1];
UART.Open();
UART.DataReceived += new SerialDataReceivedEventHandler(UART_DataReceived);
while (true)
{
Debug.Print("test");
Thread.Sleep(500);
}
}
static void UART_DataReceived(Object sender, SerialDataReceivedEventArgs e)
{
SerialPort UART = (SerialPort)sender;
//retrieve number of bytes in the buffer
int bytes = UART.BytesToRead;
//create a byte array to hold the awaiting data
byte[] comBuffer = new byte[bytes];
//read the data and store it
UART.Read(comBuffer, 0, bytes);
//UART.Write(comBuffer, 0, comBuffer.Length);
}
}
}
DEBUG PRINT OUTPUT
test
test
test
test
GC: 2msec 11652 bytes used, 52728 bytes available
Type 0F (STRING ): 72 bytes
Type 11 (CLASS ): 684 bytes
Type 12 (VALUETYPE ): 36 bytes
Type 13 (SZARRAY ): 132 bytes
Type 15 (FREEBLOCK ): 52728 bytes
Type 17 (ASSEMBLY ): 7932 bytes
Type 18 (WEAKCLASS ): 48 bytes
Type 1B (DELEGATE_HEAD ): 144 bytes
Type 1D (OBJECT_TO_EVENT ): 72 bytes
Type 1E (BINARY_BLOB_HEAD ): 252 bytes
Type 1F (THREAD ): 768 bytes
Type 20 (SUBTHREAD ): 96 bytes
Type 21 (STACK_FRAME ): 612 bytes
Type 27 (FINALIZER_HEAD ): 96 bytes
Type 31 (IO_PORT ): 108 bytes
Type 34 (APPDOMAIN_HEAD ): 72 bytes
Type 36 (APPDOMAIN_ASSEMBLY ): 528 bytes
test
test
test
test
test
test
test
test
test
test