Why Scan Window and Scan Interval Params in Connection Request Params

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Why Scan Window and Scan Interval Params in Connection Request Params

ソリューションへジャンプ
4,486件の閲覧回数
nidhintomy
Contributor IV

Hi

I tested BLE Central with different values in .scanInterval and .scanWindow params of gapConnectionRequestParameters_t structure. And this change value affected connection establishment time.

But this structure is only used after we found a device in Device Discovery Procedure and try to connect to it.

                /* Connect with the previously scanned peer device */
                if (mFoundDeviceToConnect)
                {
                    (void)App_Connect(&gConnReqParams, BleApp_ConnectionCallback);
                }

 

The actual scan window and interval are in gapScanningParameters_t structure. And this is used for scanning.

Then how the .scanInterval and .scanWindow params of gapConnectionRequestParameters_t structure affect scanning?

Thanks in Advance
Nidhin

ラベル(1)
  • KW

0 件の賞賛
返信
1 解決策
4,433件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @nidhintomy ,

We discover devices via scanning, but when the device is found, we need to initiate the connection.

The connection procedure also needs to scan the advertising package first, then initiate the connection request, so gap connection request need the parameters scanInterval and .scanWindow .

Gavin_Jia_0-1685508802901.png

 

Best regards,

Gavin

 

元の投稿で解決策を見る

6 返答(返信)
4,465件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @nidhintomy

Hope you are doing well!

In your case, you found that changing the values of the scan interval and scan window parameters affects the connection establishment time. This is because the connection establishment time is determined by the time it takes for the central device to find the peripheral device and connect to it. Since the scan interval and scan window parameters affect how often the central device scans for advertisement packets, connection establishment time is also somewhat affected.

 

Best regards,

Gavin

0 件の賞賛
返信
4,449件の閲覧回数
nidhintomy
Contributor IV

Hi @Gavin_Jia 

I am fine. Thanks for reply.

Here my question was about importance of setting scan interval and scan window parameters in connection request parameter. We already set scan interval and scan window parameters in scan request parameters. Then why we need to set it again in connection request parameter.

E.g., In frdmkw38_adv_ext_central_bm project/source/app_config.c line no.54&55 set scan interval and scan window parameters in scan request parameters. In line no.64&65 set scan interval and scan window parameters in connection request parameters.

Best Regards,
Nidhin

 

0 件の賞賛
返信
4,434件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @nidhintomy ,

We discover devices via scanning, but when the device is found, we need to initiate the connection.

The connection procedure also needs to scan the advertising package first, then initiate the connection request, so gap connection request need the parameters scanInterval and .scanWindow .

Gavin_Jia_0-1685508802901.png

 

Best regards,

Gavin

 

4,419件の閲覧回数
nidhintomy
Contributor IV

Hi @Gavin_Jia 

That means if i set .scanInterval and .scanWindow in scan req params as 500ms and set .scanInterval and .scanWindow in connection req params as 1000ms, then the device will scan at 500ms until peripheral device found. After it will scan at 1000ms until device get connected.

So what if the connection failed, is device going to scan at 1000ms ?

Best Regards,
Nidhin

0 件の賞賛
返信
4,367件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @nidhintomy ,

If the connection failed, it will scan until connect to the scanned device. So in my opinion, it will be 500ms. And you can test it as well.

 

Best regards,

Gavin

4,352件の閲覧回数
nidhintomy
Contributor IV

Hi @Gavin_Jia 

Thanks for your help.

0 件の賞賛
返信