This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How to implement "Fast advertising" with SDK 14.10

Hi All

I'd like to implement "Fast advertising" with SDK14.10

Q1: I add some code in advertising_data_set() to do fast advertising, is that correct ?

Q2: If  want to test current consumption under different  conditions (in red box) these conditions is work for test ?

 

thank's 

Louis

  • Louis Wnag said:
    In other words, I can reverse the defined values.

    Yes (though I don't see any use cases where that would make sense).

    I think there is some side effect here -- perhaps you can correct me?

    I am running into some similar concerns in our design based on SDK v16.0.0, S132 v7.0.1 on an nRF52832.

    I wanted to use the slow advertising by default (and completely ignore the fast mode) but when I call the function to initialize the advertisement, it generates an error (INVALID_PARAMS?). It looks like this function 'requires/expects' that fast_mode be enabled and it simply copies over the values from the fast mode regardless of whether or not I chose to enable or disable it.

    In other words, it looks like with the setup I am using, I need to deliberately set up the fast mode and USE SLOW MODE VALUES FOR IT.

    Is that how it is supposed to go down?

    Cheers

    RMV

  • Hi RMV,

    There should not be any problem using just slow advertising. Can you share your code so that I see what you have done, and clarify from which function call you get which error code?

  • Hi RMV,

    There should not be any problem using just slow advertising. Can you share your code so that I see what you have done, and clarify from which function call you get which error code?

    Hi Einar,

    Unfortunately I have worked around this issue by, like you say, just setting the values for my slow profile in the fast mode of the advertising module.

    I think it should be easy to reproduce what I am seeing. If this does not reproduce any runtime failures then I may need some time to set up the use case for you again.....

    Just cook up a basic advertising scenario and customize as listed below
    1. Set all values in the 'fast' data field/substructure to 0 i.e. fast_mode is disabled, and all the intervals are '0'.
    2. Set the 'slow' field/substructure to 'enable', and fill in some reasonable (non-zero) values for the various intervals.
    3. Make a call to 'start' the advertisement in 'SLOW' mode)

    If I recall (not sure at this time since I am not running into this issue now) you should observe that the device fails to launch the advertisement -- unless I am mistaken the call to 'start' the advertisement is where I recall the return value was indicating the 'invalid_parameter' (i.e. 7?)

    Cheers
    RMV

  • Hi RMV,

    Ah, you are right. I had forgot about this. The implementation in ble_advertising.c assumes that fast advertising is always used, so you need to specify config.ble_adv_fast_interval and config.ble_adv_fast_timeout in the struct (ble_advertising_init_t) you pass to ble_advertising_init().

    This constitutes a bug, but the workaround you did is perfectly good though, as there is no difference between fast and slow advertising except for the internal concept of the advertising module. So as unfortunately using only slow does not work (without a slightly ugly hack of configuring both fast and low to the same value), then using only fast will give you the exact same behavior.

    Einar

Related