flushing a widicom bluetooth serial port

  • Thread starter Thread starter colin
  • Start date Start date
C

colin

Hi,

Im having a tiresome amount of trouble with using a bluetooth serial link.

The receiving end is a bluetooth-rs232 module conected to my embeded system.

The PC has a little usb bluetooth dongle, ive tried a another dongle with
widicom software
as I was having problems with the IVT bluesoleil software.
that seems to have got rid of some other problems,
but I stil find that every now and then my buffer isnt getting flushed.

im using a std IO.Ports.SerialPort data item picked of the form design
toolbar to access the port.
im using BaseStream.Flush() to flush the port
it all seems to work ok but
once in a while it gets in a state where it doesnt seem to flush the port
properly.
i send a command but it doesnt get sent,
when I send another command it nudges the other one and they both arrive.
always one command on its own never gets through.
once the serial port is closed and reopened it sorts itself out.

it usually gets into this state when im starting/stopping the program to
debug/modify it.

am I using the right data items/functions,
or is there something specific with bluetooth wich I need to use to flush it
?

does it make any difference what character I use to mark my end of message ?

it seems to be receiving messages back ok.


thanks
Colin =^.^=
 
Colin,

Instead of trying to access the bluetooth dongle through the serial
ports, have you thought of using a Socket connection? This is the way
bluetooth is typically accessed. You can use the OpenNETCF assemblies to
help create a socket connection to the dongle, and interact with it that
way:

http://www.opennetcf.org/CategoryView.aspx?category=Home

Much easier, IMO, and hopefully, for you as well.
 
Nicholas Paldino said:
Colin,

Instead of trying to access the bluetooth dongle through the serial
ports, have you thought of using a Socket connection? This is the way
bluetooth is typically accessed. You can use the OpenNETCF assemblies to
help create a socket connection to the dongle, and interact with it that
way:

http://www.opennetcf.org/CategoryView.aspx?category=Home

Much easier, IMO, and hopefully, for you as well.

hmm thats interesting il have to have a look at that latter,
but the embeded device I am using at the other end only has a serial port,
and the bluetooth to rs232 module at that end apears as a serial port on the
PC.

This I assumed would be the easiest way to do it,
another option would be to have 2 blutooth<->rs232 modules and not need the
bluetooth drivers on the pc at all.
just pure rs232.

openeing a rs232 port is easy for me as I know how to do it,
and its fairly simple,
I would have to learn how to open a bluetooth device through a socket and
set everything up to access the serial part of it.
and it might be specific to particular dongle/driver/software etc.

The commands arnt sent that often and the eror rate is very low so I havnt
implmeneted any recovry for the commands.
would be unwelcome work to implement this,
although maybe I should ...

thanks
Colin =^.^=
 
Back
Top