This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

peripheral + observer : scanning problem.

Other Parts Discussed in Thread: CC2540

I am using CC2540 ( peripheral  + observer ) and stack 1.4

In test, the broadcasting device is sending out data every 100msec.

 

When my device is not connected to centeral device, scanning is well working.

interval : 1sec

DEFAULT_SCAN_DURATION : 100msec

=> OK

 

When my device is connected to centeral device (BTOOL or phone),  scanning is not working.

(GAP_DEVICE_INFO_EVENT is not recevied)

the interval is 5sec.

if DEFAULT_SCAN_DURATION is smaller than about 2000msec , GAP_DEVICE_INFO_EVENT is not recevied

if DEFAULT_SCAN_DURATION is bigger than about 2000msec , GAP_DEVICE_INFO_EVENT is recevied =>OK

 

1. I want  3sec interval  and 200msec duration for battery.

    I don't know why if my device is connected to central device , I can't receive scanning data from broadcaster.

2. I don't know the role of TGAP_GEN_DISC_SCAN_INT and TGAP_GEN_DISC_SCAN_WIND.

    I am using  the DEFAULT_SCAN_DURATION for duration and

                       the OSAL timer (GAPObserverRole_StartDiscovery) for interval.

 

Please help me.

 

  • If your connection interval is faster than your scan window, scanning will not work because the device will not be able to scan without missing connection events. You might want to try tweaking your parameters.


    One way to actually verify what the CC254x is doing is to have a setup with an oscilloscope such as is described in this app note: http://www.ti.com/lit/an/swra347a/swra347a.pdf. By doing this you can clearly see the connection events and scanning events as they occur.

  • Thank you for your answer.

    I still have questions.

    The point of my question is the relation of DEFAULT_SCAN_DURATION and connection.

     

    I checked sleep mode timing by GPIO test port and oscilloscope.

    Please check attatched file.

     0385.the wave form.xlsx

    1. in adversting mode,   

        scan is always working well.   

        the sleep timing is working as my configuration (scan window, interval, duration)

     

    2. in connection mode (if DEFAULT_SCAN_DURATION is 3000)

       scan is always working well.   

       the sleep timing is working as my configuration (scan window, interval, duration)

     

    3. in connection mode (if DEFAULT_SCAN_DURATION is 1000)   

        scan works somtimes and fail sometims.   

        the sleep timing works irregularly.

        please tell me the relation of DEFAULT_SCAN_DURATION and connection.

     

    my seettings are as follows:

    the advertise interval is 1000msec.   

    GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MIN, 1600);   

    GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MAX, 1600 );

    the connection interval is 2000msec.          

    DEFAULT_DESIRED_MIN_CONN_INTERVAL =  200          

    DEFAULT_DESIRED_MAX_CONN_INTERVAL = 1600          

    DEFAULT_ENABLE_UPDATE_REQUEST = TRUE

    the scan window timing is 200msec.

    the scan interval timing is 300msec.     

    #define TIME_SCAN_INT          (300/0.625)     

    #define TIME_SCAN_WIND          (200/0.625)  

    GAP_SetParamValue ( TGAP_GEN_DISC_SCAN_INT,  TIME_SCAN_INT);  

    GAP_SetParamValue  (TGAP_GEN_DISC_SCAN_WIND, TIME_SCAN_WIND);  

    GAP_SetParamValue ( TGAP_LIM_DISC_SCAN_INT,  TIME_SCAN_INT);  

    GAP_SetParamValue  (TGAP_LIM_DISC_SCAN_WIND, TIME_SCAN_WIND);

    GAP_SetParamValue ( TGAP_CONN_SCAN_INT,  TIME_SCAN_INT);  

    GAP_SetParamValue  (TGAP_CONN_SCAN_WIND, TIME_SCAN_WIND);

    the interval of GAPObserverRole_StartDiscovery() is 5sec.

  • how to only listen for advertising packets, and receive payload data?

    http://e2e.ti.com/support/wireless_connectivity/f/538/p/345382/1242144.aspx#1242144