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.

Maximizing observed packets between 2 broadcasting cc2541

Other Parts Discussed in Thread: CC2541

Hi,

I am trying to achieve the following based on the peripheral-observer project.

I have 2 cc2541 units which broadcast every 50ms (80us) a packet with an incrementing index as a payload (to make sure the other item can observe all packets).

I try to maximize the amount of observed packets, however, i get an average of 6 out of transmitted 10 packets.

in sniffer i see all the 10 packets being transmitted.

does it sound as a hardware limitation? or is there any software parameter i am missing?

IDEA:

I think for example that if i'll be able to sync their advertisement to be:

unitA: 0,50,100,150,200,....

unitB: 25,75,125,175,...

I might get more packets in average.

however, the random 0-10ms which is added to the interval is making my assumption impossible to test.

What do you think about my assumption?

Is it possible to synchronize the advertisements (or am i limited because of that randomness)?

Thanks.

  • Hi,

    Currently, the stack ignores identical advertisements during one scan period, even if you call GAP_SetParamValue(TGAP_FILTER_ADV_REPORTS, TRUE) after DEVICE_INIT is done.

    You should however call that function to pass through multiple non-identical advertisements from a broadcaster to the application.

    You can't get away from the randomness, as it's spec mandated to avoid constant collisions / beating.

    Best regards,
    Aslak
  • Aslak N. said:

    Currently, the stack ignores identical advertisements during one scan period, even if you call GAP_SetParamValue(TGAP_FILTER_ADV_REPORTS, TRUE) after DEVICE_INIT is done.

    I read that in case the payload is changing, the advertised packet will be caught.

    I use:

    uint8 scanRes = DEFAULT_MAX_SCAN_RES;
    GAPRole_SetParameter( GAPOBSERVERROLE_MAX_SCAN_RES, sizeof( uint8 ), &scanRes );
    GAP_SetParamValue( TGAP_FILTER_ADV_REPORTS, FALSE );

    are you sure about what you suggested?

    can you give more information about the stack ignoring the packets although it has different payload....

    how do you set the  scan period?

    GAP_SetParamValue( TGAP_GEN_DISC_SCAN, DEFAULT_SCAN_DURATION );
    GAP_SetParamValue( TGAP_LIM_DISC_SCAN, DEFAULT_SCAN_DURATION )

    ?

  • Hi,

    Heh, I'm sure I was wrong. Of course filter should be FALSE.

    The scan period isn't so interesting, because of the overhead involved in starting a new one. But you are right.

    What you can do to reduce overhead, and increase percentage-wise time listening on the air is to increase the SCAN_WIND and SCAN_INT, default is 10ms/10ms meaning 10ms 100% duty cycle listening per channel (of the three adv channels). If you increase this to 100ms for example, less time is spent switching channels.

    Best regards,
    Aslak
  • hi,
    i am currently increasing an index (which is sent in the payload of the next advertisement).
    the index is updated within the HCI_EXT_AdvEventNoticeCmd (after every advertisement).
    in the sniffer, you can see one advertisement every ~50ms (the adv_interval I chose) with increased payload index - no missing or duplicate packets.

    after adding the following lines:
    uint16 window= 160;
    GAP_SetParamValue( TGAP_GEN_DISC_SCAN_INT, window);
    GAP_SetParamValue( TGAP_GEN_DISC_SCAN_WIND, window);
    GAP_SetParamValue( TGAP_LIM_DISC_SCAN_INT, window);
    GAP_SetParamValue( TGAP_LIM_DISC_SCAN_WIND, window);

    I see many duplicate packets and some missing ones.

    Are those the parameters you were talking about before?
    Can you refer me to information about using these parameters?
  • Hi,

    With a window value of 160, this will yield a 100ms scan interval & window, thus a 100ms at 100% duty cycle as suggested above.
    The parameters are described in gap.h.

    Best wishes