This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND not found error in nrf52

Hi,

I am using NRF52840 DK in our project . I  am using 15.3.0 SDK  and soft device s140 in our project .Here the nrf52840 dk board is client and other controller bluetooth is used as slave which as 1 base uuid and 4  128 bit characteristics uuid .I am able to connect to the peripheral by scanning device name.Now  i successfully connected to the peripheral devuce. But while doing service discovery i am getting BLE_GATT_STATUS_ATTERR_ATTRIBUTE_NOT_FOUND  in service discovery. can you tell me  how to resolve this issue. as i know only 128 bit base uuid and i dont know the service uuid . Plz help me to resolve this issue.

Parents Reply Children
  • It appears to be 4 or 5 unique UUID bases. I suggest you start by trying to discover the main Service since any typo or error in the byte order will cause service discovery to fail. 

    I didn't find the UUID below in the documentation you linked to. Can you point me to the Service or characteristic it belongs to?

     #define LBS_UUID_SERVICE_UUID {0x39, 0x23, 0xcf, 0x40, 0x73, 0x16, 0x42, 0x9a, \
    0x5c, 0x41, 0x7e, 0x7d, 0xc4, 0x9a, 0x83, 0x14} /**< Used vendor specific UUID. */

  • Thanks for the reply.

    Below I have attached the program of the service table in the peripheral side.

    /*********************************************************************/
    /** SPPLE Service Table **/
    /*********************************************************************/

    /* The SPPLE Service Declaration UUID. */
    static BTPSCONST GATT_Primary_Service_128_Entry_t SPPLE_Service_UUID =
    {
    SPPLE_SERVICE_BLUETOOTH_UUID_CONSTANT
    };
    /*static BTPSCONST GATT_Primary_Service_16_Entry_t SPPLE_Service_UUID =
    {
    SPPLE_SERVICE_BLUETOOTH_UUID_CONSTANT
    };*/

    /* The Tx Characteristic Declaration. */
    static BTPSCONST GATT_Characteristic_Declaration_128_Entry_t SPPLE_Tx_Declaration =
    {
    GATT_CHARACTERISTIC_PROPERTIES_NOTIFY,
    SPPLE_TX_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT
    };

    /* The Tx Characteristic Value. */
    static BTPSCONST GATT_Characteristic_Value_128_Entry_t SPPLE_Tx_Value =
    {
    SPPLE_TX_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
    0,
    NULL
    };

    /* The Tx Credits Characteristic Declaration. */
    static BTPSCONST GATT_Characteristic_Declaration_128_Entry_t SPPLE_Tx_Credits_Declaration =
    {
    (GATT_CHARACTERISTIC_PROPERTIES_READ|GATT_CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE|GATT_CHARACTERISTIC_PROPERTIES_WRITE),
    SPPLE_TX_CREDITS_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT
    };

    /* The Tx Credits Characteristic Value. */
    static BTPSCONST GATT_Characteristic_Value_128_Entry_t SPPLE_Tx_Credits_Value =
    {
    SPPLE_TX_CREDITS_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
    0,
    NULL
    };

    /* The SPPLE RX Characteristic Declaration. */
    static BTPSCONST GATT_Characteristic_Declaration_128_Entry_t SPPLE_Rx_Declaration =
    {
    (GATT_CHARACTERISTIC_PROPERTIES_WRITE_WITHOUT_RESPONSE),
    SPPLE_RX_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT
    };

    /* The SPPLE RX Characteristic Value. */
    static BTPSCONST GATT_Characteristic_Value_128_Entry_t SPPLE_Rx_Value =
    {
    SPPLE_RX_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
    0,
    NULL
    };


    /* The SPPLE Rx Credits Characteristic Declaration. */
    static BTPSCONST GATT_Characteristic_Declaration_128_Entry_t SPPLE_Rx_Credits_Declaration =
    {
    (GATT_CHARACTERISTIC_PROPERTIES_READ|GATT_CHARACTERISTIC_PROPERTIES_NOTIFY),
    SPPLE_RX_CREDITS_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT
    };

    /* The SPPLE Rx Credits Characteristic Value. */
    static BTPSCONST GATT_Characteristic_Value_128_Entry_t SPPLE_Rx_Credits_Value =
    {
    SPPLE_RX_CREDITS_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT,
    0,
    NULL
    };

    /* Client Characteristic Configuration Descriptor. */
    static GATT_Characteristic_Descriptor_16_Entry_t Client_Characteristic_Configuration =
    {
    GATT_CLIENT_CHARACTERISTIC_CONFIGURATION_BLUETOOTH_UUID_CONSTANT,
    GATT_CLIENT_CHARACTERISTIC_CONFIGURATION_LENGTH,
    NULL
    };

    /* The following defines the SPPLE service that is registered with */
    /* the GATT_Register_Service function call. */
    /* * NOTE * This array will be registered with GATT in the call to */
    /* GATT_Register_Service. */
    BTPSCONST GATT_Service_Attribute_Entry_t SPPLE_Service[] =
    {
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetPrimaryService128, (Byte_t *)&SPPLE_Service_UUID}, //0
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&SPPLE_Tx_Declaration}, //1
    {0, aetCharacteristicValue128, (Byte_t *)&SPPLE_Tx_Value}, //2
    {GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicDescriptor16, (Byte_t *)&Client_Characteristic_Configuration}, //3
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&SPPLE_Tx_Credits_Declaration}, //4
    {GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicValue128, (Byte_t *)&SPPLE_Tx_Credits_Value}, //5
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&SPPLE_Rx_Declaration}, //6
    {GATT_ATTRIBUTE_FLAGS_WRITABLE, aetCharacteristicValue128, (Byte_t *)&SPPLE_Rx_Value}, //7
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicDeclaration128, (Byte_t *)&SPPLE_Rx_Credits_Declaration}, //8
    {GATT_ATTRIBUTE_FLAGS_READABLE, aetCharacteristicValue128, (Byte_t *)&SPPLE_Rx_Credits_Value}, //9
    {GATT_ATTRIBUTE_FLAGS_READABLE_WRITABLE, aetCharacteristicDescriptor16, (Byte_t *)&Client_Characteristic_Configuration}, //10
    };

    #define SPPLE_SERVICE_ATTRIBUTE_COUNT (sizeof(SPPLE_Service)/sizeof(GATT_Service_Attribute_Entry_t))

    #define SPPLE_TX_CHARACTERISTIC_ATTRIBUTE_OFFSET 2
    #define SPPLE_TX_CHARACTERISTIC_CCD_ATTRIBUTE_OFFSET 3
    #define SPPLE_TX_CREDITS_CHARACTERISTIC_ATTRIBUTE_OFFSET 5
    #define SPPLE_RX_CHARACTERISTIC_ATTRIBUTE_OFFSET 7
    #define SPPLE_RX_CREDITS_CHARACTERISTIC_ATTRIBUTE_OFFSET 9
    #define SPPLE_RX_CREDITS_CHARACTERISTIC_CCD_ATTRIBUTE_OFFSET 10

    /*********************************************************************/
    /** END OF SERVICE TABLE **/
    /*********************************************************************/

    /* The following MACRO is a utility MACRO that assigns the SPPLE */
    /* Service 16 bit UUID to the specified UUID_128_t variable. This */
    /* MACRO accepts one parameter which is a pointer to a UUID_128_t */
    /* variable that is to receive the SPPLE UUID Constant value. */
    /* * NOTE * The UUID will be assigned into the UUID_128_t variable in*/
    /* Little-Endian format. */
    #define SPPLE_ASSIGN_SPPLE_SERVICE_UUID_128(_x) ASSIGN_BLUETOOTH_UUID_128(*((UUID_128_t *)(_x)), 0x14, 0x83, 0x9A, 0xC4, 0x7D, 0x7E, 0x41, 0x5c, 0x9A, 0x42, 0x16, 0x73, 0x40, 0xCF, 0x23, 0x39)

    /* The following MACRO is a utility MACRO that exist to compare a */
    /* UUID 16 to the defined SPPLE Service UUID in UUID16 form. This */
    /* MACRO only returns whether the UUID_128_t variable is equal to the*/
    /* SPPLE Service UUID (MACRO returns boolean result) NOT less */
    /* than/greater than. The first parameter is the UUID_128_t variable*/
    /* to compare to the SPPLE Service UUID. */
    #define SPPLE_COMPARE_SPPLE_SERVICE_UUID_TO_UUID_128(_x) COMPARE_BLUETOOTH_UUID_128_TO_CONSTANT((_x), 0x14, 0x83, 0x9A, 0xC4, 0x7D, 0x7E, 0x41, 0x5c, 0x9A, 0x42, 0x16, 0x73, 0x40, 0xCF, 0x23, 0x39)

    /* The following defines the SPPLE Service UUID that is used when */
    /* building the SPPLE Service Table. */
    #define SPPLE_SERVICE_BLUETOOTH_UUID_CONSTANT { 0x39, 0x23, 0xCF, 0x40, 0x73, 0x16, 0x42, 0x9A, 0x5c, 0x41, 0x7E, 0x7D, 0xC4, 0x9A, 0x83, 0x14 }
    //#define SPPLE_SERVICE_BLUETOOTH_UUID_CONSTANT { 0x9a, 0xc4 }

    /* The following MACRO is a utility MACRO that assigns the SPPLE TX */
    /* Characteristic 16 bit UUID to the specified UUID_128_t variable. */
    /* This MACRO accepts one parameter which is the UUID_128_t variable */
    /* that is to receive the SPPLE TX UUID Constant value. */
    /* * NOTE * The UUID will be assigned into the UUID_128_t variable in*/
    /* Little-Endian format. */
    #define SPPLE_ASSIGN_TX_UUID_128(_x) ASSIGN_BLUETOOTH_UUID_128((_x), 0x07, 0x34, 0x59, 0x4A, 0xA8, 0xE7, 0x4b, 0x1a, 0xA6, 0xB1, 0xCD, 0x52, 0x43, 0x05, 0x9A, 0x57)

    /* The following MACRO is a utility MACRO that exist to compare a */
    /* UUID 16 to the defined SPPLE TX UUID in UUID16 form. This MACRO */
    /* only returns whether the UUID_128_t variable is equal to the TX */
    /* UUID (MACRO returns boolean result) NOT less than/greater than. */
    /* The first parameter is the UUID_128_t variable to compare to the */
    /* SPPLE TX UUID. */
    #define SPPLE_COMPARE_SPPLE_TX_UUID_TO_UUID_128(_x) COMPARE_BLUETOOTH_UUID_128_TO_CONSTANT((_x), 0x07, 0x34, 0x59, 0x4A, 0xA8, 0xE7, 0x4b, 0x1a, 0xA6, 0xB1, 0xCD, 0x52, 0x43, 0x05, 0x9A, 0x57)

    /* The following defines the SPPLE TX Characteristic UUID that is */
    /* used when building the SPPLE Service Table. */
    #define SPPLE_TX_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT { 0x57, 0x9A, 0x05, 0x43, 0x52, 0xCD, 0xB1, 0xA6, 0x1a, 0x4b, 0xE7, 0xA8, 0x4A, 0x59, 0x34, 0x07 }

    /* The following MACRO is a utility MACRO that assigns the SPPLE */
    /* TX_CREDITS Characteristic 16 bit UUID to the specified UUID_128_t */
    /* variable. This MACRO accepts one parameter which is the */
    /* UUID_128_t variable that is to receive the SPPLE TX_CREDITS UUID */
    /* Constant value. */
    /* * NOTE * The UUID will be assigned into the UUID_128_t variable in*/
    /* Little-Endian format. */
    #define SPPLE_ASSIGN_TX_CREDITS_UUID_128(_x) ASSIGN_BLUETOOTH_UUID_128((_x), 0xBA, 0x04, 0xC4, 0xB2, 0x89, 0x2B, 0x43, 0xbe, 0xB6, 0x9C, 0x5D, 0x13, 0xF2, 0x19, 0x53, 0x92)

    /* The following MACRO is a utility MACRO that exist to compare a */
    /* UUID 16 to the defined SPPLE TX_CREDITS UUID in UUID16 form. This*/
    /* MACRO only returns whether the UUID_128_t variable is equal to the*/
    /* TX_CREDITS UUID (MACRO returns boolean result) NOT less */
    /* than/greater than. The first parameter is the UUID_128_t variable*/
    /* to compare to the SPPLE TX_CREDITS UUID. */
    #define SPPLE_COMPARE_SPPLE_TX_CREDITS_UUID_TO_UUID_128(_x) COMPARE_BLUETOOTH_UUID_128_TO_CONSTANT((_x), 0xBA, 0x04, 0xC4, 0xB2, 0x89, 0x2B, 0x43, 0xbe, 0xB6, 0x9C, 0x5D, 0x13, 0xF2, 0x19, 0x53, 0x92)

    /* The following defines the SPPLE TX_CREDITS Characteristic UUID */
    /* that is used when building the SPPLE Service Table. */
    #define SPPLE_TX_CREDITS_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT { 0x92, 0x53, 0x19, 0xF2, 0x13, 0x5D, 0x9C, 0xB6, 0xbe, 0x43, 0x2B, 0x89, 0xB2, 0xC4, 0x04, 0xBA }

    /* The following MACRO is a utility MACRO that assigns the SPPLE RX */
    /* Characteristic 16 bit UUID to the specified UUID_128_t variable. */
    /* This MACRO accepts one parameter which is the UUID_128_t variable */
    /* that is to receive the SPPLE RX UUID Constant value. */
    /* * NOTE * The UUID will be assigned into the UUID_128_t variable in*/
    /* Little-Endian format. */
    #define SPPLE_ASSIGN_RX_UUID_128(_x) ASSIGN_BLUETOOTH_UUID_128((_x), 0x8B, 0x00, 0xAC, 0xE7, 0xEB, 0x0B, 0x49, 0xb0, 0xBB, 0xE9, 0x9A, 0xEE, 0x0A, 0x26, 0xE1, 0xA3)

    /* The following MACRO is a utility MACRO that exist to compare a */
    /* UUID 16 to the defined SPPLE RX UUID in UUID16 form. This MACRO */
    /* only returns whether the UUID_128_t variable is equal to the RX */
    /* UUID (MACRO returns boolean result) NOT less than/greater than. */
    /* The first parameter is the UUID_128_t variable to compare to the */
    /* SPPLE RX UUID. */
    #define SPPLE_COMPARE_SPPLE_RX_UUID_TO_UUID_128(_x) COMPARE_BLUETOOTH_UUID_128_TO_CONSTANT((_x), 0x8B, 0x00, 0xAC, 0xE7, 0xEB, 0x0B, 0x49, 0xb0, 0xBB, 0xE9, 0x9A, 0xEE, 0x0A, 0x26, 0xE1, 0xA3)

    /* The following defines the SPPLE RX Characteristic UUID that is */
    /* used when building the SPPLE Service Table. */
    #define SPPLE_RX_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT { 0xA3, 0xE1, 0x26, 0x0A, 0xEE, 0x9A, 0xE9, 0xBB, 0xb0, 0x49, 0x0B, 0xEB, 0xE7, 0xAC, 0x00, 0x8B }

    /* The following MACRO is a utility MACRO that assigns the SPPLE */
    /* RX_CREDITS Characteristic 16 bit UUID to the specified UUID_128_t */
    /* variable. This MACRO accepts one parameter which is the */
    /* UUID_128_t variable that is to receive the SPPLE RX_CREDITS UUID */
    /* Constant value. */
    /* * NOTE * The UUID will be assigned into the UUID_128_t variable in*/
    /* Little-Endian format. */
    #define SPPLE_ASSIGN_RX_CREDITS_UUID_128(_x) ASSIGN_BLUETOOTH_UUID_128((_x), 0xE0, 0x6D, 0x5E, 0xFB, 0x4F, 0x4A, 0x45, 0xc0, 0x9E, 0xB1, 0x37, 0x1A, 0xE5, 0xA1, 0x4A, 0xD4)

    /* The following MACRO is a utility MACRO that exist to compare a */
    /* UUID 16 to the defined SPPLE RX_CREDITS UUID in UUID16 form. This*/
    /* MACRO only returns whether the UUID_128_t variable is equal to the*/
    /* RX_CREDITS UUID (MACRO returns boolean result) NOT less */
    /* than/greater than. The first parameter is the UUID_128_t variable*/
    /* to compare to the SPPLE RX_CREDITS UUID. */
    #define SPPLE_COMPARE_SPPLE_RX_CREDITS_UUID_TO_UUID_128(_x) COMPARE_BLUETOOTH_UUID_128_TO_CONSTANT((_x), 0xE0, 0x6D, 0x5E, 0xFB, 0x4F, 0x4A, 0x45, 0xc0, 0x9E, 0xB1, 0x37, 0x1A, 0xE5, 0xA1, 0x4A, 0xD4)

    /* The following defines the SPPLE RX_CREDITS Characteristic UUID */
    /* that is used when building the SPPLE Service Table. */
    #define SPPLE_RX_CREDITS_CHARACTERISTIC_BLUETOOTH_UUID_CONSTANT { 0xD4, 0x4A, 0xA1, 0xE5, 0x1A, 0x37, 0xB1, 0x9E, 0xc0, 0x45, 0x4A, 0x4F, 0xFB, 0x5E, 0x6D, 0xE0 }

    These are the UUID  of the SPPLE service and characteristics in the program of peripheral side.

    Attached uuid of the characteristic of the spple service.

    Here there is 5 UUID of 128 bit . My doubt is how to add all uuid  which is 128 bit characteristics. In the  example program of the LBS service they are adding 16 bit characteristics and 16 bit Service UUID .

    And one more doubt is what do i need to add the LBS BASE UUID  ..I dont know the base uuid  of the spple service . I know only the spple service uuid  which is of 128 bit UUID. 

    Plz give me the solution.

  • The SSP Service base UUID seems to be added with the correct byte order in your code so that is good, but I can't see from your code snippets if you use the 16-bit Service UUID for the Service discovery (0x9AC4). Can you upload your entire project here so I can take a look?

Related