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.

CCS/CC2640R2F: MTU negotiation request on peripheral side

Part Number: CC2640R2F


Tool/software: Code Composer Studio

Hi 

In the original thread, it said "Only the GATT client (e.g central) can initiate an MTU exchange procedure." 

We would like to check that this limitation only applies to TI SOC??? 

Because we have another BLE module(U-Blox), it can request MTU exchange on the peripheral side




Thanks.

BR

Trevor

  • Hi Trevor,

    The GAP Peripheral/Central roles are independent of GATT Client/Server. Central/Peripheral can act as both Client and/or Server. TI supports all combinations.

  • Hi Joakim, 

    Regarding the simple_peripheral example, how do I send an MTU exchange request in this example?



    Thanks.

    BR

    Trevor

  • Hi Joakim, 

    I did some experiments to compare the behavior between U-blox and CC2642.

    About the following experiments, I only modify the SIMPLEPROFILE_CHAR4 data length.

    Experiment 1: Peripheral sends 100 bytes to Central through the notification channel.

    Peripheral : U-blox module

    Central : Android phone with BLE Scanner App

    Result : Central can receive the 100 bytes.

    Experiment 2: Peripheral sends 20 bytes to Central through the notification channel.

    Peripheral : CC2642

    Central : Android phone with BLE Scanner App

    Result : Central can receive the 20 bytes.

    Experiment 3: Peripheral sends 100 bytes to Central through the notification channel.

    Peripheral : CC2642

    Central : Android phone with BLE Scanner App

    Result : Central can't receive any packets.

    Do you have any suggestions to me?

    Thanks.

    BR

    Trevor

  • Trevor,

    Per the BT5.1 core specification; "The Exchange MTU Request is used by the client to inform the server of the client’s maximum receive MTU size and request the server to respond with its maximum receive MTU size"

    This means that the simple peripheral must also define itself as a GATT Client as well as a GATT Server. To do this, please see the SimpleCentral_init function of the simple central sample app;

      // Initialize GATT Client
      VOID GATT_InitClient();
    

    Then you need to add all necessary application code to handle Client operation (again take inspiration of simple central). After that, you should be able to execute this api (gatt.h);

    /*-------------------------------------------------------------------
     * GATT Client Sub-Procedure APIs
     */
    
    /**
     * @brief   Exchange MTU Request
     *
     * This sub-procedure is used by the client to set the ATT_MTU
     * to the maximum possible value that can be supported by both
     * devices when the client supports a value greater than the
     * default ATT_MTU for the Attribute Protocol. This sub-procedure
     * shall only be initiated once during a connection.
     *
     * @ref ATT_ExchangeMTUReq is used by this sub-procedure.
     *
     * @par Corresponding Events:
     * If the return status from this function is @ref SUCCESS, the calling
     * application task will receive a @ref GATT_MSG_EVENT message with method:
     * - @ref ATT_EXCHANGE_MTU_RSP of type @ref attExchangeMTURsp_t , with
     * status @ref SUCCESS or @ref bleTimeout , if the procedure was successful
     * - @ref ATT_ERROR_RSP of type @ref attErrorRsp_t , with
     * status @ref SUCCESS  , if an error occurred on the server
     *
     * @param   connHandle - connection to use
     * @param   pReq - pointer to request to be sent
     * @param   taskId - task to be notified of response
     *
     * @return  @ref SUCCESS : Request was queued successfully.
     * @return  @ref INVALIDPARAMETER
     * @return  @ref MSG_BUFFER_NOT_AVAIL
     * @return  @ref bleNotConnected
     * @return  @ref blePending : A response is pending with this server.
     * @return  @ref bleMemAllocError
     * @return  @ref bleTimeout : Previous transaction timed out.
     */
    extern bStatus_t GATT_ExchangeMTU( uint16 connHandle, attExchangeMTUReq_t *pReq, uint8 taskId );
    

  • Hi Joakim, 

    Thanks for your help, It works.

    BR

    Trevor