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.

CC26xx related error at SWRU393D with TGAP_CONN_ADV_INT_MIN/MAX

Other Parts Discussed in Thread: CC2640

According to the document TGAP_CONN_ADV_INT_MIN and TGAP_CONN_ADV_INT_MAX range starts from 32. However actual minimum is 160=100ms. See Bluetooth specification chapter '4.4.2.2 Advertising interval'. If smaller value is accidentally set GAP_MAKE_DISCOVERABLE_DONE_EVENT gives failure value of 0x12. And you can not make device discoverable when connected. It would be very useful to have GAP source code available for checking these kind of issues.

Used device CC26xx with BLE SDK 2.2.1.

  • Hello ArtoP,

    You are referring to non-connectable Adv, however, TGAP_CONN_ADV_INT_MIN is for connectable Adv which has a maximum (fastest) rate of 20ms as per BT4.2.

    Best wishes
  • From gap.h:
    #define TGAP_LIM_DISC_ADV_INT_MIN 6 //!< Minimum advertising interval, when in limited discoverable mode (n * 0.625 mSec)
    #define TGAP_LIM_DISC_ADV_INT_MAX 7 //!< Maximum advertising interval, when in limited discoverable mode (n * 0.625 mSec)
    #define TGAP_GEN_DISC_ADV_INT_MIN 8 //!< Minimum advertising interval, when in General discoverable mode (n * 0.625 mSec)
    #define TGAP_GEN_DISC_ADV_INT_MAX 9 //!< Maximum advertising interval, when in General discoverable mode (n * 0.625 mSec)
    #define TGAP_CONN_ADV_INT_MIN 10 //!< Minimum advertising interval, when in Connectable mode (n * 0.625 mSec)
    #define TGAP_CONN_ADV_INT_MAX 11 //!< Maximum advertising interval, when in Connectable mode (n * 0.625 mSec)

    These are available modes offered. TGAP_CONN_ADV_INT_MIN/MAX actually affect unconnectable advertising when connected and setting value to less than 160 will prevent advertising with described error. TGAP_LIM/GEN_DISC_ADV_INT_MIN/MAX value do define advertising interval when not connected? Something wrong at stack?

    In your opinion what is correct GAP parameter for non connectable undirected advertising when connected?
  • TGAP_CONN_ADV_INT_MIN/MAX values are used if you are already in a connection. If you are a peripheral-only v4.0 controller config, you can only send non-connectable ADV when connected, at a max rate of 100ms. You can see an example by searching PLUS_BROADCASTER in the simple_peripheral sample application.

    Beyond that, can you describe the use case you are trying to implement? It may be better to help provide an answer based on your actual scenario.

    Best wishes
  • Since TGAP_CONN_ADV_INT_MIN/MAX values are used if you are already in a connection as my debug findings indicated gap.h code comments and documentation needs updating. Also my original point of having min value changed to 160=100ms is then valid.

    I have already implemented fully functional peripheral observer. This combination is missing from SDK. Just wanted to share one solution here to help others.

  • Hi ArtoP,

    I'm attempting to set CC26xx in a Scanable Advertising mode after connection, so after link_established, I setted TGAP_CONN_ADV_INT_MIN/MAX to 100ms and then MakeDiscoverable with type of ADV_SCAN_IND. However, my CC2640 chip didn't advertise anymore. 

    Could you please tell me where you set these parameters and when you set your CC26xx chip to a non connectable advertising mode?

    Thanks in advance.

    Best regards,

    Yang

  • Hi Yang,

    I'm putting advertising on periodically with following code.

    void advertiserOn()
    {
        uint8_t advertEnable = TRUE;
        
        lastAdvParam = (linkDB_NumActive() > 0) ? GAPROLE_ADV_NONCONN_ENABLED : GAPROLE_ADVERT_ENABLED;
        bStatus_t status =
            GAPRole_SetParameter(lastAdvParam,
                                 sizeof(uint8_t),
                                 &advertEnable);
        if (status != SUCCESS)
        {
            advertEnable = FALSE;
            status =
            GAPRole_SetParameter(GAPROLE_ADV_NONCONN_ENABLED,
                                 sizeof(uint8_t),
                                 &advertEnable);
            status =
            GAPRole_SetParameter(GAPROLE_ADVERT_ENABLED,
                                 sizeof(uint8_t),
                                 &advertEnable);
            
            advertEnable = TRUE;
            status =
            GAPRole_SetParameter(lastAdvParam,
                                 sizeof(uint8_t),
                                 &advertEnable);
            if (status != SUCCESS)
            {
                TRACE_ERR_EVENT0(ENTITY_ADV, "Can not enable advertising");
            }
        }
    }
  • Hi ArtoP,

    Thank you for your reply.

    Best regards,

    Yang