[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [bluetooth-dev] Still can't read rfcomm !
> -----Original Message-----
> From: Markku Pirilä [mailto:firstname.lastname@example.org]
> Sent: 09 October 2001 13:01
> To: Anders Torbjörn Johansson; email@example.com
> Subject: RE: [bluetooth-dev] Still can't read rfcomm !
> Hi everyone,
> At 17:10 8.10.2001 +0200, Anders Torbjörn Johansson wrote:
> >RFCOMM provides virtual serialports over bluetooth. This
> >means that after a connection is done you can place an
> >application on top of which use ttyBT0 - 6 (depending on
> >which TTY you connected). Your application works like any
> >application that use a standard tty, you can write/read
> >data from it. With the control TTY (ttyBTC) you can send
> >IOCTL:s to connect/disconnect the connection etc.
> So far looks like it's what I need....
> >Have a look in btd.c located under apps/bluetooth/experimental
> >to get a basic idea how a server handling incoming RFCOMM
> >requests and the starts a PPP server etc works.
> ...but now I have to say that I found no clear clue to read,
> poll and write ttyBTx even less how to use controll signals.
The simplest (one way) example:
After having started bti on both ends, run 'cat /dev/ttyBT0' on one
end and on the other end run 'echo "Hello world!" >/dev/ttyBT0'.
This should send the string "Hello world!" over the connection,
and write it out on the receiving end.
/dev/ttyBTx behave like files. You can open them, read and
write to them, and close them. Whatever you write on one
end will appear to be read from the other end.
> Perhaps I have language barrier either with english or with
> C/C++ (or both!?).
You will need to understand the open(), read(), write() and select()
system calls to effectively write your own application to
send data directly over RFCOMM.
> My source set is extracted from openbt-20010530.tar.gz
> packet. Is the file btd.c, located under
> apps/bluetooth/experimental, possibly changed since that?
There has been _a lot_ of changes since that.
> Best regards,
> Markku Pirila
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to firstname.lastname@example.org