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.

How send a Broadcast packet

Other Parts Discussed in Thread: CC2540

Hi everyone,

I'm trying to send a broadcast packet (ADV_NONCONN_IND or ADV_IND) from my cc2540 Keyfob every 5 second without creating a connection with a dongle, and I want go to sleep after send this packet. What can I do? and can I do this without the OSAL?

  • Hi Giacomantonio,

    Have a look at the simpleBLEPeripheral project, in there you'll find the DEFAULT_ADVERTISING_INTERVAL which is used to set advertisment interval (would be 5000 in your case), you can trace it to the following code where it is actually set:

    // Set advertising interval
    {
    uint16 advInt = DEFAULT_ADVERTISING_INTERVAL;

    GAP_SetParamValue( TGAP_LIM_DISC_ADV_INT_MIN, advInt );
    GAP_SetParamValue( TGAP_LIM_DISC_ADV_INT_MAX, advInt );
    GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MIN, advInt );
    GAP_SetParamValue( TGAP_GEN_DISC_ADV_INT_MAX, advInt );
    }

    The device goes in sleep between the advertisements if you have POWER_SAVING defined in the preprocessors (Rightclick on Project name in IAR and select options-> "C/C++ Compiler"->"Preprocessor"->"Defined Symbols"). 

    OSAL is highly integrated in the BLE Stack, so I guess no, you cannot do this without OSAL.

    Br