* [Bluez-devel] About socket interface
@ 2008-07-24 18:08 Jui-Hao Chiang
2008-07-24 18:18 ` Nick Pelly
0 siblings, 1 reply; 4+ messages in thread
From: Jui-Hao Chiang @ 2008-07-24 18:08 UTC (permalink / raw)
To: bluez-devel
Hi,
I have a question about the user socket interface.
When I run the scotest -d, I know it will basically call sco_sock_accept in sco.c
Inside it, there is a wait queue and try to find a new socket.
The accept() will be notified when there is a new connection coming from another
client.
My question is: how the bluez notify the user socket "accept()"? Can anyone tell
me where the event is generated and finally notify user socket accept()? Just
need a keyword.
Hope this time someone can answer me. maybe I am keeping asking stupid question
so that nobody wants to answer it.
Bests
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-devel] About socket interface
2008-07-24 18:08 [Bluez-devel] About socket interface Jui-Hao Chiang
@ 2008-07-24 18:18 ` Nick Pelly
2008-07-24 18:46 ` Jui-Hao Chiang
0 siblings, 1 reply; 4+ messages in thread
From: Nick Pelly @ 2008-07-24 18:18 UTC (permalink / raw)
To: BlueZ development
[-- Attachment #1.1: Type: text/plain, Size: 1336 bytes --]
The HCI event that triggers this is the Connection Request Event 0x04,
probably handled in hci_event.c
2008/7/25 Jui-Hao Chiang <windtracekimo@gmail.com>:
> Hi,
> I have a question about the user socket interface.
> When I run the scotest -d, I know it will basically call sco_sock_accept in
> sco.c
> Inside it, there is a wait queue and try to find a new socket.
> The accept() will be notified when there is a new connection coming from
> another
> client.
> My question is: how the bluez notify the user socket "accept()"? Can anyone
> tell
> me where the event is generated and finally notify user socket accept()?
> Just
> need a keyword.
>
> Hope this time someone can answer me. maybe I am keeping asking stupid
> question
> so that nobody wants to answer it.
>
> Bests
>
>
> -------------------------------------------------------------------------
> This SF.Net email is sponsored by the Moblin Your Move Developer's
> challenge
> Build the coolest Linux based applications with Moblin SDK & win great
> prizes
> Grand prize is a trip for two to an Open Source event anywhere in the world
> http://moblin-contest.org/redirect.php?banner_id=100&url=/
> _______________________________________________
> Bluez-devel mailing list
> Bluez-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/bluez-devel
>
[-- Attachment #1.2: Type: text/html, Size: 1890 bytes --]
[-- Attachment #2: Type: text/plain, Size: 363 bytes --]
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
[-- Attachment #3: Type: text/plain, Size: 164 bytes --]
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-devel] About socket interface
2008-07-24 18:18 ` Nick Pelly
@ 2008-07-24 18:46 ` Jui-Hao Chiang
2008-07-25 2:14 ` Jui-Hao Chiang
0 siblings, 1 reply; 4+ messages in thread
From: Jui-Hao Chiang @ 2008-07-24 18:46 UTC (permalink / raw)
To: bluez-devel
Nick Pelly <npelly <at> gmail.com> writes:
>
> The HCI event that triggers this is the Connection Request Event 0x04,
probably handled in hci_event.c
Thanks for the response. But I haven't seen any code inside hci_event_packet to
notify the user socket. (Maybe I am blind..)
In scotest program, there is a debug message below accept(), so that I know when
it is returned from the accept() call.
>>From my tracing, I thought the user accept() will eventually wait inside
sco_sock_accept(), which keeps itself in the wait queue. And I guess the
function return of sco_sock_accept will eventually executing the next line of
accept() in user program (printing the message). But the accept() returns
earlier than the sco_sock_accept() as the following message.
hci_event_packet: hci0 evt 0x4 <== the SCO connection request comes !!!!
hci_conn_request_evt: hci0 Connection request: EE:E9:63:67:11:00 type 0x0
sco_connect_ind: hdev hci0, bdaddr EE:E9:63:67:11:00
hci_conn_add: hci0 dst EE:E9:63:67:11:00
hci_usb_notify: hci0 evt 1
hci_conn_add_sysfs: conn d45db800
.... (omit..)
hci_event_packet: hci0 evt 0x1b
__recv_frame: hci0 type 4 data dfa75670 count 6
__recv_frame: new packet len 6
hci_rx_task: hci0
hci_event_packet: hci0 evt 0xf
hci_cs_link_ctl: hci0 ocf 0x9
hci_cs_link_ctl: hci0 Command status: ogf LINK_CTL ocf 9 status 0
scotest[5844]: Connect from 00:11:67:63:E9:EE [handle 2, class 0x080104]
<=== user accept() Has returned !!!!
scotest[5844]: Receiving ...
.... (omit..)
bt_accept_unlink: sk f53e1800 state 1
sco_sock_accept: new socket f53e1800 <== sco_sock_accept() will return !!!!
Jui-Hao
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Bluez-devel] About socket interface
2008-07-24 18:46 ` Jui-Hao Chiang
@ 2008-07-25 2:14 ` Jui-Hao Chiang
0 siblings, 0 replies; 4+ messages in thread
From: Jui-Hao Chiang @ 2008-07-25 2:14 UTC (permalink / raw)
To: bluez-devel
I just observed that
when user socket is listening.
The debug message following the listen() function will be printed before the
message in sco_sock_listen().
So... I guess it's because the "printk in kernel" and "syslog in user space" are
running asynchronously in /var/log/messages.
Jui-Hao
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Bluez-devel mailing list
Bluez-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/bluez-devel
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-07-25 2:14 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-24 18:08 [Bluez-devel] About socket interface Jui-Hao Chiang
2008-07-24 18:18 ` Nick Pelly
2008-07-24 18:46 ` Jui-Hao Chiang
2008-07-25 2:14 ` Jui-Hao Chiang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox