F
Florian Zierer
Hi there,
I am developing an application for a mobile device and have to receive
data via bluetooth and the serial port profile.
I am currently programming in c#. The device is a Windows Mobile 6
device. (Moto Q 9h)
I can receive data but the problem is it is way too slow.
I get a data package with 6 byte every 8ms but when reading it, the
ReadBuffer fills more and more.
Later I should receive twice as much data.
I wanted to use
serialPort.ReadLine() to get each packet each own. (5 byte data + 1 newline)
I tried it with the serialPort.DataReceived eventhandler but I get a lot
of messages like
The Thread ... has stopped with code 0.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread '<Kein Name>' (0x9ed3e02) hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
where are all these messages from? The gui does no more respond.. I even
can't stop the application via the debugging controls from VS2005. I
have to restart the device to make it run once again.
I also tried to handle all the data aquisition with a worker thread wich
polls the comport and handles incoming data but it is also way to slow
and the gui does not respond anymore.
Any hints on how to improve my program?
The serial port is running with
private SerialPort serialPort;
private int baudRate = 57600;
private Parity parity = Parity.None;
private int dataBits = 8;
private StopBits stopBits = StopBits.One;
Thanks in advance
Flo
I am developing an application for a mobile device and have to receive
data via bluetooth and the serial port profile.
I am currently programming in c#. The device is a Windows Mobile 6
device. (Moto Q 9h)
I can receive data but the problem is it is way too slow.
I get a data package with 6 byte every 8ms but when reading it, the
ReadBuffer fills more and more.
Later I should receive twice as much data.
I wanted to use
serialPort.ReadLine() to get each packet each own. (5 byte data + 1 newline)
I tried it with the serialPort.DataReceived eventhandler but I get a lot
of messages like
The Thread ... has stopped with code 0.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread '<Kein Name>' (0x9ed3e02) hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
Der Thread 0x9ed3e02 hat mit Code 0 (0x0) geendet.
where are all these messages from? The gui does no more respond.. I even
can't stop the application via the debugging controls from VS2005. I
have to restart the device to make it run once again.
I also tried to handle all the data aquisition with a worker thread wich
polls the comport and handles incoming data but it is also way to slow
and the gui does not respond anymore.
Any hints on how to improve my program?
The serial port is running with
private SerialPort serialPort;
private int baudRate = 57600;
private Parity parity = Parity.None;
private int dataBits = 8;
private StopBits stopBits = StopBits.One;
Thanks in advance
Flo