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

[bluetooth-dev] problem BT_UPPERCONNECTED ..!



Sir,
    I have a problem in closing the ttyBTx device when
there is a disconnect event.Even when I close the
descriptor the status shows BT_UPPERCONNECTED and not
BT_INACTIVE.Iam sure Iam getting the correct "line"
value,but still...for all next connections i get an
error Line busy (even after closing)
bt_register_tty: Line busy
   Iam opening the file and closing the descriptor
when the read returns 0 as follows: Could you please
tell me the correct way for closing the device
  Thank you. 

OPEN:
if ((fd = open(AP_bt_ttys[line].tty, O_RDWR |
O_NOCTTY)) < 0)
              {
                perror("open");
              }
           AP_bt_ttys[line].fd = fd;

CLOSE:
if ((nb_read = read(fd, buff, AP_BUFF_SIZE)) <= 0)
    {
           close(fd);
     }  

After 2 connections:
[BT Interface]
line[0] state: BT_ACTIVE
line[1] state: BT_ACTIVE
line[2] state: BT_INACTIVE
line[3] state: BT_INACTIVE
line[4] state: BT_INACTIVE
line[5] state: BT_INACTIVE
line[6] state: BT_INACTIVE
BT CTRL state: BT_UPPERCONNECTED [2 open]

After 2 disconnections:
[BT Interface]
line[0] state: BT_UPPERCONNECTED
line[1] state: BT_UPPERCONNECTED
line[2] state: BT_INACTIVE
line[3] state: BT_INACTIVE
line[4] state: BT_INACTIVE
line[5] state: BT_INACTIVE
line[6] state: BT_INACTIVE
BT CTRL state: BT_UPPERCONNECTED [1 open]



__________________________________
Do you Yahoo!?
Yahoo! Hotjobs: Enter the "Signing Bonus" Sweepstakes
http://hotjobs.sweepstakes.yahoo.com/signingbonus
-
To unsubscribe from this list: send the line "unsubscribe bluetooth-dev" in
the body of a message to majordomo@xxxxxxx.com