[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:markku.pirila@xxxxxxx.fi]
> Sent: 09 October 2001 13:46
> To: Peter Kjellerstedt; bluetooth-dev@xxxxxxx.com
> Subject: RE: [bluetooth-dev] Still can't read rfcomm !
> 
> Thanks Peter for Your answer,
> 
> At 13:21 9.10.2001 +0200, Peter Kjellerstedt wrote:
> > > -----Original Message-----
> 
> >.........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.
> 
> Yes, I have allready done that with terminal applications.
> 
> >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.
> 
> Why do we have the stack if we must use system calls? I 
> tought that stack would make the system invisible to programmer.

Well, those system calls are the most basic ones, and have nothing
to do with the stack. The interface the stack provides is the
/dev/ttyBTx files (and a couple of ioctls for more advanced usage).
This is the same interface you would get if you connected two
computers using a serial cable, only that then you would use
/dev/ttyS0 instead of /dev/ttyBT0.

> What for are functions like rfcomm_receive_data() or 
> rfcomm_send_data() (in rfcomm.c/rfcomm.h)?

They are used inside the stack and only accessible from
within the kernel.

> B.R.
> 
> Markku Pirila

//Peter
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com