public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
* Set Tmin and Tmax for inquiry?
@ 2009-03-18 15:06 Ilya Rubtsov
  2009-03-18 20:42 ` Ilya Rubtsov
  0 siblings, 1 reply; 5+ messages in thread
From: Ilya Rubtsov @ 2009-03-18 15:06 UTC (permalink / raw)
  To: linux-bluetooth

Hi

I'm developing an application for bluecasting. So period of periodic 
inquire is important for me.
AFAIK, inquire process takes 10.24 seconds (Bluetooth 2.0). But if I use 
StartDiscovery method in python script, then I see this in hcidump:

< HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
   max 24 min 16 lap 0x9e8b33 len 8 num 0

and I get "Inquiry Complete" event every ~24-30 second. But if I use 
'hcitool spinq', then I see:

< HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
   max 24 min 16 lap 0x9e8b33 len 8 num 0

and "Inquiry Complete" event takes place every ~13-15 seconds. And in 
both cases all remote devices is being founded, so I don't see any 
reason for longer inquiring. AFAIK HCID internally sets Tmin and Tmax 
parameters, but is there any way to affect to its 'decision'?

P.S. Excuse me for my English :(

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Set Tmin and Tmax for inquiry?
  2009-03-18 15:06 Set Tmin and Tmax for inquiry? Ilya Rubtsov
@ 2009-03-18 20:42 ` Ilya Rubtsov
  2009-03-18 23:26   ` Carles Cufi
  0 siblings, 1 reply; 5+ messages in thread
From: Ilya Rubtsov @ 2009-03-18 20:42 UTC (permalink / raw)
  To: linux-bluetooth

Oops. Mistake. Right is: 'max 24 min 16 lap 0x9e8b33 len 8 num 0' 
(StartDiscovery) and 'max 16 min 10 lap 0x9e8b33 len 8 num 0' (hcitool)

Ilya Rubtsov пишет:

> Hi
>
> I'm developing an application for bluecasting. So period of periodic 
> inquire is important for me.
> AFAIK, inquire process takes 10.24 seconds (Bluetooth 2.0). But if I 
> use StartDiscovery method in python script, then I see this in hcidump:
>
> < HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
>   max 24 min 16 lap 0x9e8b33 len 8 num 0
>
> and I get "Inquiry Complete" event every ~24-30 second. But if I use 
> 'hcitool spinq', then I see:
>
> < HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
>   max 24 min 16 lap 0x9e8b33 len 8 num 0
>
> and "Inquiry Complete" event takes place every ~13-15 seconds. And in 
> both cases all remote devices is being founded, so I don't see any 
> reason for longer inquiring. AFAIK HCID internally sets Tmin and Tmax 
> parameters, but is there any way to affect to its 'decision'?
>
> P.S. Excuse me for my English :(


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Set Tmin and Tmax for inquiry?
  2009-03-18 20:42 ` Ilya Rubtsov
@ 2009-03-18 23:26   ` Carles Cufi
  2009-03-18 23:40     ` Ilya Rubtsov
  0 siblings, 1 reply; 5+ messages in thread
From: Carles Cufi @ 2009-03-18 23:26 UTC (permalink / raw)
  To: Ilya Rubtsov; +Cc: linux-bluetooth

Hi Ilya,

The hcitool application uses the HCI library function hci_send_req()  
to send a periodic inquiry request to the controller. The max and min  
periods are hardcoded to 16 and 10 respectively, and there is no user  
option to change those. In the case of your python script I can't tell  
you for sure because I haven't looked at the code of the python BlueZ  
bindings, but if the API call it presents to you has no Tmin and Tmax  
that means it's hardcoded there too. The bluetoothd (formerly called  
hcid) has absolutely nothing to do with the hcitool since this tool  
bypasses it completely. For python, you should look at the code for  
the bindings and find out how the API implementation handles your call.

--
Carles

On Mar 18, 2009, at 9:42 PM, Ilya Rubtsov wrote:

> Oops. Mistake. Right is: 'max 24 min 16 lap 0x9e8b33 len 8 num  
> 0' (StartDiscovery) and 'max 16 min 10 lap 0x9e8b33 len 8 num  
> 0' (hcitool)
>
> Ilya Rubtsov пишет:
>
>> Hi
>>
>> I'm developing an application for bluecasting. So period of  
>> periodic inquire is important for me.
>> AFAIK, inquire process takes 10.24 seconds (Bluetooth 2.0). But if  
>> I use StartDiscovery method in python script, then I see this in  
>> hcidump:
>>
>> < HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
>>  max 24 min 16 lap 0x9e8b33 len 8 num 0
>>
>> and I get "Inquiry Complete" event every ~24-30 second. But if I  
>> use 'hcitool spinq', then I see:
>>
>> < HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
>>  max 24 min 16 lap 0x9e8b33 len 8 num 0
>>
>> and "Inquiry Complete" event takes place every ~13-15 seconds. And  
>> in both cases all remote devices is being founded, so I don't see  
>> any reason for longer inquiring. AFAIK HCID internally sets Tmin  
>> and Tmax parameters, but is there any way to affect to its  
>> 'decision'?
>>
>> P.S. Excuse me for my English :(
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux- 
> bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Set Tmin and Tmax for inquiry?
  2009-03-18 23:26   ` Carles Cufi
@ 2009-03-18 23:40     ` Ilya Rubtsov
  2009-03-19 14:07       ` Carles Cufi
  0 siblings, 1 reply; 5+ messages in thread
From: Ilya Rubtsov @ 2009-03-18 23:40 UTC (permalink / raw)
  To: linux-bluetooth

Thanks for reply. I have talk to Vudentz at #blues and now know that 
both sets of Tmin and Tmax are hardcoded. He also said me that I can use 
software scheduler, so I do.
Also he said that API's interval is longer (min 16, max 24) because 
there is name resolution feature.
So, I wonder - why this feature is not optional? I think not all 
application need name resolution. Another idea (Vudentz's idea) is to 
hardcode min 10 to API - if chip is smart it will able to end work earlier.


Carles Cufi пишет:
> Hi Ilya,
>
> The hcitool application uses the HCI library function hci_send_req() 
> to send a periodic inquiry request to the controller. The max and min 
> periods are hardcoded to 16 and 10 respectively, and there is no user 
> option to change those. In the case of your python script I can't tell 
> you for sure because I haven't looked at the code of the python BlueZ 
> bindings, but if the API call it presents to you has no Tmin and Tmax 
> that means it's hardcoded there too. The bluetoothd (formerly called 
> hcid) has absolutely nothing to do with the hcitool since this tool 
> bypasses it completely. For python, you should look at the code for 
> the bindings and find out how the API implementation handles your call.
>
> -- 
> Carles
>
> On Mar 18, 2009, at 9:42 PM, Ilya Rubtsov wrote:
>
>> Oops. Mistake. Right is: 'max 24 min 16 lap 0x9e8b33 len 8 num 0' 
>> (StartDiscovery) and 'max 16 min 10 lap 0x9e8b33 len 8 num 0' (hcitool)
>>
>> Ilya Rubtsov пишет:
>>
>>> Hi
>>>
>>> I'm developing an application for bluecasting. So period of periodic 
>>> inquire is important for me.
>>> AFAIK, inquire process takes 10.24 seconds (Bluetooth 2.0). But if I 
>>> use StartDiscovery method in python script, then I see this in hcidump:
>>>
>>> < HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
>>>  max 24 min 16 lap 0x9e8b33 len 8 num 0
>>>
>>> and I get "Inquiry Complete" event every ~24-30 second. But if I use 
>>> 'hcitool spinq', then I see:
>>>
>>> < HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
>>>  max 24 min 16 lap 0x9e8b33 len 8 num 0
>>>
>>> and "Inquiry Complete" event takes place every ~13-15 seconds. And 
>>> in both cases all remote devices is being founded, so I don't see 
>>> any reason for longer inquiring. AFAIK HCID internally sets Tmin and 
>>> Tmax parameters, but is there any way to affect to its 'decision'?
>>>
>>> P.S. Excuse me for my English :(
>>
>> -- 
>> To unsubscribe from this list: send the line "unsubscribe 
>> linux-bluetooth" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Set Tmin and Tmax for inquiry?
  2009-03-18 23:40     ` Ilya Rubtsov
@ 2009-03-19 14:07       ` Carles Cufi
  0 siblings, 0 replies; 5+ messages in thread
From: Carles Cufi @ 2009-03-19 14:07 UTC (permalink / raw)
  To: Ilya Rubtsov; +Cc: linux-bluetooth

Hi Ilya,

The fact of name resolution being optional has always been a subject  
of debate. Recently the D-Bus APIs also removed the call for discovery  
without name resolving. If you want pure inquiry (or periodic inquiry)  
without names, you can always use the C APIs, which will allow you to  
do whatever you want with the radio.

--
Carles

On Mar 19, 2009, at 12:40 AM, Ilya Rubtsov wrote:

> Thanks for reply. I have talk to Vudentz at #blues and now know that  
> both sets of Tmin and Tmax are hardcoded. He also said me that I can  
> use software scheduler, so I do.
> Also he said that API's interval is longer (min 16, max 24) because  
> there is name resolution feature.
> So, I wonder - why this feature is not optional? I think not all  
> application need name resolution. Another idea (Vudentz's idea) is  
> to hardcode min 10 to API - if chip is smart it will able to end  
> work earlier.
>
>
> Carles Cufi пишет:
>> Hi Ilya,
>>
>> The hcitool application uses the HCI library function  
>> hci_send_req() to send a periodic inquiry request to the  
>> controller. The max and min periods are hardcoded to 16 and 10  
>> respectively, and there is no user option to change those. In the  
>> case of your python script I can't tell you for sure because I  
>> haven't looked at the code of the python BlueZ bindings, but if the  
>> API call it presents to you has no Tmin and Tmax that means it's  
>> hardcoded there too. The bluetoothd (formerly called hcid) has  
>> absolutely nothing to do with the hcitool since this tool bypasses  
>> it completely. For python, you should look at the code for the  
>> bindings and find out how the API implementation handles your call.
>>
>> -- 
>> Carles
>>
>> On Mar 18, 2009, at 9:42 PM, Ilya Rubtsov wrote:
>>
>>> Oops. Mistake. Right is: 'max 24 min 16 lap 0x9e8b33 len 8 num  
>>> 0' (StartDiscovery) and 'max 16 min 10 lap 0x9e8b33 len 8 num  
>>> 0' (hcitool)
>>>
>>> Ilya Rubtsov пишет:
>>>
>>>> Hi
>>>>
>>>> I'm developing an application for bluecasting. So period of  
>>>> periodic inquire is important for me.
>>>> AFAIK, inquire process takes 10.24 seconds (Bluetooth 2.0). But  
>>>> if I use StartDiscovery method in python script, then I see this  
>>>> in hcidump:
>>>>
>>>> < HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
>>>> max 24 min 16 lap 0x9e8b33 len 8 num 0
>>>>
>>>> and I get "Inquiry Complete" event every ~24-30 second. But if I  
>>>> use 'hcitool spinq', then I see:
>>>>
>>>> < HCI Command: Periodic Inquiry Mode (0x01|0x0003) plen 9
>>>> max 24 min 16 lap 0x9e8b33 len 8 num 0
>>>>
>>>> and "Inquiry Complete" event takes place every ~13-15 seconds.  
>>>> And in both cases all remote devices is being founded, so I don't  
>>>> see any reason for longer inquiring. AFAIK HCID internally sets  
>>>> Tmin and Tmax parameters, but is there any way to affect to its  
>>>> 'decision'?
>>>>
>>>> P.S. Excuse me for my English :(
>>>
>>> -- 
>>> To unsubscribe from this list: send the line "unsubscribe linux- 
>>> bluetooth" in
>>> the body of a message to majordomo@vger.kernel.org
>>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux- 
> bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-19 14:07 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-18 15:06 Set Tmin and Tmax for inquiry? Ilya Rubtsov
2009-03-18 20:42 ` Ilya Rubtsov
2009-03-18 23:26   ` Carles Cufi
2009-03-18 23:40     ` Ilya Rubtsov
2009-03-19 14:07       ` Carles Cufi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox