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.

CC2642R: Two issues on Connection Parameter Request procedure

Part Number: CC2642R


Hello,

Two issues were discovered while using LL Connection Parameter Request procedure.

<Condition>
* Master - TI stack (3.10)
* Slave - Android phone

<Procedure>
Master's application calls GAP_UpdateLinkParamReq() to send LL_CONNECTION_PARAM_REQ with desired parameters. Slave responds with LL_CONNECTION_PARAM_RSP including valid Reference Connection Event Count and Offset0. Master rejects the response with the error code 0x1E(Invalid Link Layer Parameters). See attached. Reject_Indication.zip

<Issues>
1. The Reference Connection Event Count and Offset0 looks valid from the BLE spec's point of view. If the master cannot accept them due to its internal constraints, it shall respond with the error code 0x3B(Unacceptable Connection Parameters).
2. When it happens, the master's application that initiated the procedure doesn't get GAP_LINK_PARAM_UPDATE_EVENT from the stack. It should be notified by GAP_LINK_PARAM_UPDATE_EVENT with some error status, like it is in the case where the master's request was rejected by the slave.

<Question>
1. Is TI stack supposed to reject LL_CONNECTION_PARAM_RSP if it comes with Reference Connection Event Count which is not 0 and/or OffsetX which is not 0xFFFF? Can it not accept any value other than the default values 0 and 0xFFFF respectively?
2. Is there any way for the master's application to know if the master's Connection Parameter Request procedure has ended up with failure due to master's having rejected slave's response? If there's no way, please make one for a future version. Thanks.

- Cetri

  • Hi,

    I'm assigning an expert to comment. Stay tuned for follow-up.

  • Hi Cetri,

    I will try to reproduce here. What phone model and android version were you using?

    Do you have a sniffer log of this?

  • Hi Marie,

    My phone is ZTE Z978 with Android 6.0.1.

    The sniffer log is already attached in my original post.

    Can you check the LL source code to see what I'm asking?

    - Cetri

  • Hi Cetri,

    I would say the second packet violates the following paragraph in the spec: ( BLUETOOTH SPECIFICATION Version 5.0 | Vol 6, Part B page 2670 Link Layer Specification 5.1.7.1 Issuing an LL_CONNECTION_PARAM_REQ PDU).

    • May set the Offset0 to Offset5 fields to a value other than 0xFFFF [...] If one or more of the Offset0 to Offset5 fields have been set, then:
    [...]
    - If Interval_Min is not equal to Interval_Max then the PerferredPeriodicity
    field shall be set to a value other than zero. If Interval_Min is equal to
    Interval_Max then the PreferredPeriodicity field may be set to any value
    and shall be ignored by the recipient.

    However I agree with your second point, that when this happens the master should get a GAP_LINK_PARAM_UPDATE_EVENT with status != success.

  • Hi Marie,

    Thanks for your reply. Per your pointing to the spec, I agree that my Android used an invalid parameter.

    Have you reported the issue of the lack of GAP_LINK_PARAM_UPDATE_EVENT upon rejection to the development team? Is there any way to know if a rejection has happened?

    - Cetri

  • Hi Cetri,

    Yes I have scheduled a discussion with the development team on this topic. I will let you know by the end of next week.

  • Since your device is the master in this connection you should be able to use an L2CAP connection update parameter procedure instead. If you disable the LL Connection Update Request on the device this will happen automatically when you call GAP_UpdateLinkParamReq().

    uint8_t features[8];
    uint8_t i;
    
     
    features[0] = (
                    LL_FEATURE_ENCRYPTION
                   //|LL_FEATURE_CONN_PARAMS_REQ
                   | LL_FEATURE_REJECT_IND_EXT
                   | LL_FEATURE_SLV_FEATURES_EXCHANGE
                   | LL_FEATURE_PING
                   | LL_FEATURE_DATA_PACKET_LENGTH_EXTENSION
                   | LL_FEATURE_PRIVACY
                   | LL_FEATURE_EXTENDED_SCANNER_FILTER_POLICIES
                  );
    
     
    for(i=1; i<8; i++)
    {
        features[i]=0;
    }
    HCI_EXT_SetLocalSupportedFeaturesCmd(features);

  • Hi Marie,

    L2CAP Connection Parameter Update Request can be sent by only slave, not master according to the spec 5.1 Vol 3 Part A Section 4.20 : 

    4.20 CONNECTION PARAMETER UPDATE REQUEST (CODE 0x12)

    This command shall only be sent from the LE slave device to the LE master device

    Is there another workaround?

    - Cetri

  • Hi Cetri,

    You're right. Sorry, I was thinking of a connection parameter update with no negotiation, but I can't find it so I guess I was misremembering.

    You could terminate the connection and re-connect with the new parameters.

  • Hi Marie,

    What I want to do is to connect with a phone with a short interval to discover services/chars quickly and then switch to a longer interval to save power. If I reconnect, I will have to do discovery again since the phone may come up with different handles upon the new connection. That means I should use a short interval for the new connection and switch to a longer one again, which will lead me to the same result.

    If I can know whether or not the connection parameter update has failed, I can re-attempt with different parameters that the phone may accept. Any update from the development team?

    - Cetri

  • Hi Cetri,

    I see. I will let you know later this week.

    From your log it looks like the phone did accept the parameters, it just added the offset value which makes it an invalid request... 

  • Hi Cetri,

    I discussed with the developers and they will look into whether it makes sense to pass an event for rejected connection parameter updates to the application.

    One suggested work-around is to implement a clock in the application. If the application does not receive a GAP_LINK_PARAM_UPDATE_EVENT within a reasonable time (say, 30 s, depending on your connection interval and slave latency) you can safely assume the request was rejected.

    BTW, if you need full control over events coming from the controller you could switch to a two-device solution (use Host Test).