kkamikakoi / btstack

Automatically exported from code.google.com/p/btstack
0 stars 0 forks source link

sdp_try_respond is static, cannot be called when HCI transport is freed #387

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
r2364 function sdp_try_respond in file sdp.c

it checks if it is capable of sending something before actually sending it, if 
it fails because there are no ACL slots, then it is called again when ACL slots 
are freed (when the L2CAP credits get handed out)

but this does not account for when the HCI transport is busy, if the first 
attempt fails because the HCI transport is busy, there will be no reattempts

one solution is to repeatedly call this function, but this is impossible as it 
is declared static

I suggest that a sdp_server_run function is created, or better yet, each l2cap 
service should have it's own "run" function pointer just like the 
packet_handler function pointer, and have l2cap_run call sdp_server_run

Original issue reported on code.google.com by frank.zhao.main@gmail.com on 16 Feb 2014 at 8:15