[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bluetooth-dev] Help : Connection to upper layer


     I am trying to understand how upper layer applications (for example
minicom) connects to openBT Bluetooth stack?

     From the log file, I can see the following

BT (driver) bt_open on line 0
BT (driver) Registering tty on line 0 (mincom)
BT (driver) bt_set_termios - forwarding to serial driver
last message repeated 3 times
BT (driver) bt_flush_buffer, ignored
BT (driver) bt_set_termios - forwarding to serial driver
BT (driver) bt_set_termios - forwarding to serial driver
BT DATA |X|<-- 1 [0]

   I do not know how to write a device driver for Linux.  The following are
my questions :

1.) After registering to line 0, what other functions do minicom called in
openBT Bluetooth stack?  (one of them is bt_set_termios)

2.) In bt_set_termios, one of the parameters is struct termios
*old_termios.  Where does the openBT obtain *old_termios?  I can see that
is eventually used to set sertty->driver.set_termios(sertty, old_termios).
So, it should be important to the operation of openBT.

3.) I can trace that data from upper layer application will be passed down
to openBT through the function bt_write_top.  For data passing from openBT
to upper layer application, it will reach bt_receive_top.  Can someone
explain to me the following instructions in bt_receive_top:
   upper_tty = GET_UPPERTTY(line);
   if (upper_tty)
       upper_tty->ldisc.receive_buf(upper_tty, data, NULL, len);
      return -1;
  return 0;

Thanks and your help is very much appreciated.

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