Question about L2CAP sockets
Hello together,
I'm currently recoding some functions to provide Flow Control mechanism on the L2CAP layer. Incoming Configuration Requests, Configuration Responses and Information Requests are mostly done. Now I try to do the corresponding work for an incoming Information Response. In order to keep track of the results (let's say I sent an info request about supported flow control) I need to store those results somewhere from where I can use them for a reasonable configuration request (if the remote peer doesn't support Flow Control, then we don't need request any Flow Control options any more). I thought these pieces of information belong to the corresponding socket, but now I have quite some trouble to access the socket struct from l2cap_information_rsp() as the only informational field I have is the l2cap_conn struct.
So is there a way to obtain the socket just from the connection struct?
My only idea is to use the function:
static inline struct *l2cap_get_chan_by_ident(struct l2cap_chan_list *l, u8 ident)
as we have two candidate fields -- rx_ident and tx_ident -- in our connection struct. But I don't know if that might work.
Is there anybody who may help me out a bit with the l2cap stuff?
Martin
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel
Am Montag, den 13.03.2006, 10:45 +0100 schrieb Martin R=F6hricht:
Quoted 7 lines
So is there a way to obtain the socket just from the connection struct? =20
My only idea is to use the function:
static inline struct *l2cap_get_chan_by_ident(structl2cap_chan_list*l, u8 ident)
as we have two candidate fields --rx_identandtx_ident-- in our connection struct. But I don't know if that might work.
I think I managed to use the right function arguments. My current solution looks like this:
static inline int l2cap_information_rsp(struct l2cap_conn *conn, struct l2cap_cmd_hdr *cmd, u8 *data)
{
[...]
struct sock *sk;
[...]
if (!(sk =3D l2cap_get_chan_by_ident(&conn->chan_list, cmd->ident)))
return 0;
[...]
l2cap_pi(sk)->info_mtu =3D __le16_to_cpup((__le16 *) rsp->data);
[...]
}I tried to test this with two Siemens mobilephones (S55 and S75) and a Windows XP machine, but none of them seems to make use of any information requests at all ...=20
Perhaps somebody knows of a device that tries to inform itself about it's remote partner before sending requests?
Martin
-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Bluez-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bluez-devel