F
Felix
Hi,
I'm writing a smartphone application that connects to a com port for
data. (The com port is a bluetooth outgoing port) The emulator has an
option where you can map Serial Ports on the emulated device to serial
ports on your computer.
I hooked up a serial device to my COM 1 on my desktop and used
Hyperterm to get data from it..All is fine COM1 4800 bps..etc...i'm
able to see data from the serial device.
So I mapped Serial Port 0 on the emulator to Com1 on my desktop and I
created a project in VS. Here is the code:
SerialPort sp = new SerialPort("COM0");
sp.BaudRate = 4800;
sp.Open();
byte[] rawByte = new byte[256];
sp.Read(rawByte, 0, 256);
label1.Text = rawByte.ToString();
Very simple stuff just gets data from the serial port once 256 bytes
and writes them to a label on a form.
No matter what I try I can't get this to work. Has anyone been
successful doing this?
Thank you,
Felix
I'm writing a smartphone application that connects to a com port for
data. (The com port is a bluetooth outgoing port) The emulator has an
option where you can map Serial Ports on the emulated device to serial
ports on your computer.
I hooked up a serial device to my COM 1 on my desktop and used
Hyperterm to get data from it..All is fine COM1 4800 bps..etc...i'm
able to see data from the serial device.
So I mapped Serial Port 0 on the emulator to Com1 on my desktop and I
created a project in VS. Here is the code:
SerialPort sp = new SerialPort("COM0");
sp.BaudRate = 4800;
sp.Open();
byte[] rawByte = new byte[256];
sp.Read(rawByte, 0, 256);
label1.Text = rawByte.ToString();
Very simple stuff just gets data from the serial port once 256 bytes
and writes them to a label on a form.
No matter what I try I can't get this to work. Has anyone been
successful doing this?
Thank you,
Felix