2007-04-02 11:00:17

by Tushar Paturde

[permalink] [raw]
Subject: [Bluez-users] Usage of fcntl for non blocking mode...

Hi,
I'm getting some problem while using Bluez hci function calls. The pseudo
code is as under:

...
devId = hci_devid(addr);
sock = hci_open_dev(devId);
...
fcntl(sock, F_SETFL, O_NONBLOCK); /** whats the problem ??? */
...
hci_read_local_name(sock, size, name, 0)
....


If I comment call to fcntl() , I get correct name of device by using
hci_read_local_name() function.
But if the call is made to fcntl(), subsequent calls of hci_* function
does not work properly. In fact hci_read_local_name() returns null name.
Any idea what is the problem with usage of fcntl() this way ?

Regards,

Tushar Paturde


Attachments:
(No filename) (612.00 B)
(No filename) (792.00 B)
(No filename) (345.00 B)
(No filename) (164.00 B)
Download all attachments

2007-04-02 12:04:14

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Usage of fcntl for non blocking mode...

Hi Tushar,

> Actually this code is part of bluetooth implementation of jsr82 in
> phonme project.
> Does making non-blocking HCI socket helps in any way for function
> calls such as hci_send_cmd ?. Or is there any other advantage ?

no. It makes no difference. The HCI socket has specific semantics
anyway.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users

2007-04-02 11:51:38

by Tushar Paturde

[permalink] [raw]
Subject: Re: [Bluez-users] Usage of fcntl for non blocking mode...

Actually this code is part of bluetooth implementation of jsr82 in phonme
project.
Does making non-blocking HCI socket helps in any way for function calls such
as hci_send_cmd ?. Or is there any other advantage ?


Regards,
Tushar



On 4/2/07, Marcel Holtmann <[email protected]> wrote:
>
> Hi Tushar,
>
> I never tried to have a non-blocking HCI socket. And I have no idea why
> you actually need it. It is better to use the D-Bus API anyway.
>
> Regards
>
> Marcel
>
>
>
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share
> your
> opinions on IT & business topics through brief surveys-and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Bluez-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/bluez-users
>



--
Tushar Paturde


Attachments:
(No filename) (1.01 kB)
(No filename) (1.58 kB)
(No filename) (345.00 B)
(No filename) (164.00 B)
Download all attachments

2007-04-02 11:03:16

by Marcel Holtmann

[permalink] [raw]
Subject: Re: [Bluez-users] Usage of fcntl for non blocking mode...

Hi Tushar,

> I'm getting some problem while using Bluez hci function calls. The
> pseudo code is as under:
>
> ...
> devId = hci_devid(addr);
> sock = hci_open_dev(devId);
> ...
> fcntl(sock, F_SETFL, O_NONBLOCK); /** whats the problem ??? */
> ...
> hci_read_local_name(sock, size, name, 0)
> ....
>
>
> If I comment call to fcntl() , I get correct name of device by using
> hci_read_local_name() function.
> But if the call is made to fcntl(), subsequent calls of hci_*
> function does not work properly. In fact hci_read_local_name()
> returns null name.
> Any idea what is the problem with usage of fcntl() this way ?

I never tried to have a non-blocking HCI socket. And I have no idea why
you actually need it. It is better to use the D-Bus API anyway.

Regards

Marcel



-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Bluez-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-users