Re: Bluetooth connection problem

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



You don't use two COM ports for reading/writing. One port will be for a
client connection to another device, the other will be for an inbound server
connection. Once you have opened a client connection to a remote device you
use the same port for both reading and writing.

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://www.peterfoot.net

"Tutankamon" <Tutankamon@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:5C63A4FD-468C-4CFE-B4BD-D2D448471B01@xxxxxxxxxxxxxxxx
> Hi
>
> I am working on a program for a windows mobile 2003 based pocket pc, and i
> am having problems with the bluetooth communication.
>
> From what i understand, writing and reading from the bluetooth device of
> the
> Pocket PC is just a reading and writng to a Comm Port, one for writing and
> the other one for reading (in this case 7 and 8).
>
> I do this using the library corell.dll as follows:
>
> Four functions are imported form the library corell.dll,
> the functions are:
> - CreateFile()-Opens a connection to a COM port.
> - ReadFile()-Reads data from a COM port.
> - WriteFile()-Writes data to a COM port.
> - CloseHandle()-Closes a COM port.
>
> Now, when send data thru the port i receive it on the other bluetooth
> device
> (a bluetooth to serial converter), but when I include the routine to read
> the
> data the program locks up and i have to reset the Pocket PC.
>
> I can't see the mistake, or i don't know if i am going in the wrong
> direction,
>
> Thatnks in advance.
>
> Tutankamon


.



Relevant Pages

  • Re: PPC 2003 Thread
    ... // Create a read thread for reading data from the communication port. ... DWORD dwError; ... >> not get signaled and the Kernel Tracker tool shows that my main thread is ...
    (microsoft.public.windowsce.embedded.vc)
  • Serial port :bytesAvailable
    ... I am reading binary data from a serial port (it is actually ... have no problem reading data, I am reading data from an eye ...
    (comp.soft-sys.matlab)
  • Re: EAGAIN mystery on accept()
    ... Thanks a real lot Michael for reading my mail. ... lsof showed this to be the only process with a socket on this port ... > In an earlier post you said that tcpdump showed no incoming packets. ... > interface that you're not sniffing, ...
    (comp.unix.solaris)
  • Re: Possibly OT: sending email from shell scripts on cygwin
    ... written by email experts I expect if I went to a mail NG with this I'd ... you by reading your Thunderbird config files" or something :-). ... wrt the info on port 25 being for outgoing and 110 being for incoming ... before I copied my cygwin environment off it. ...
    (comp.unix.shell)
  • Re: Write to file handle
    ... > port is reading) to a log file continuously .Can anybody help me how to do ... That's used for opening a file for reading ... use lexical filehandles, ... > #The line below declares it and ties it to the file handle INFILE ...
    (perl.beginners)