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.

Attribute length more than 19 bytes doesn't work

Hi,

For some reason, my central application is not discovering handle of the attribute if the attribute length is more than 19 bytes in Peripheral. Can anyone  please answer?  

I thought at least 20 bytes should work as  ATT_MTU_SIZE is 23 bytes and in fact there should not be any limitation on size of attribute as it can be 512bytes but if increase beyond 19 bytes then the central device fails to discover handle of the attribute.

TI guys.. Please help me.

Thanks, Arjun

  • Finally I got it working for attribute lengths greater than 19 -

    // If procedure complete
    if ( ( pMsg->method == ATT_FIND_BY_TYPE_VALUE_RSP &&
    pMsg->hdr.status == bleProcedureComplete ) ||
    ( pMsg->method == ATT_ERROR_RSP ) )
    {
    if ( simpleBLESvcStartHdl != 0 )
    {
    // Discover characteristic
    simpleBLEDiscState = BLE_DISC_STATE_AUTH;

    req.startHandle = simpleBLESvcStartHdl;
    req.endHandle = simpleBLESvcEndHdl;
    req.type.len = ATT_BT_UUID_SIZE;
    req.type.uuid[0] = LO_UINT16(SIMPLEPROFILE_CHAR6_UUID);
    req.type.uuid[1] = HI_UINT16(SIMPLEPROFILE_CHAR6_UUID);

    //GATT_ReadUsingCharUUID( simpleBLEConnHandle, &req, simpleBLETaskId );
    GATT_DiscCharsByUUID( simpleBLEConnHandle, &req, simpleBLETaskId );
    }
    }

    I've replaced "GATT_ReadUsingCharUUID" with "GATT_DiscCharsByUUID" and I had my attribute size defined as 25 bytes and now I was bale to successfully discover the handle and also sent 20 bytes in one packet.

    I think "GATT_ReadUsingCharUUID" should not be used for discovering handles and rather use "GATT_DiscCharsByUUID".

    Arjun