3 Replies Latest reply on Jun 10, 2019 5:26 AM by AnjanaM_61

    Maximum attribute length

    ArTc_3305816

      Hi

      I'm having an issue with Bluetooth transmission where my program is erroring out after the 20th iteration. I found out the setting max_attr_len in the file wiced_app_cfg.c.

      The default value is 20. when changing this setting, there is no change in the behavior of my code. on the 20th iteration the system is throwing WICED_BT_GATT_CONGESTED once followed by WICED_BT_GATT_INTERNAL_ERROR for the rest of the loop.

      I noticed that in the comment section there is a reference to gki_cfg which I am not able to locate in any of the files.

      Has anyone had to deal with this issue before?

      Thank you for your time and assistance.

        • 1. Re: Maximum attribute length
          XinghaoZ_26

          The max_attr_len is the max length for the attribute packet. It should not cause the error.

          Could you share your project or some logs?

          • 2. Re: Maximum attribute length
            ArTc_3305816

            Hi

            Please find attached my project.

            • 3. Re: Maximum attribute length
              AnjanaM_61

              Hello,

               

              Max attribute length / Max MTU size decides on how much data can be send on single transmission . In your case it's not about the data size, its about how frequently you are sending the data . I think that was expected behavior. Too many Notification data cannot be sent quickly enough.

               

              You need to monitor congestion event(congested or cleared). If congested, you need to stop sending and wait congestion clear.

              In application layer,

               

              Can you try a work around. Application should do two things

               

              1. monitor GATT_CONGEST_EVT.  ( Refer wiced_bt_gatt.h file)

              This event will have this struct data.

              typedef struct

              {

                uint16_t conn_id; /**< ID of the connection */

                wiced_bool_t congested; /**< congestion state */

              } wiced_bt_gatt_congestion_event_t;

               

              If you receive "congested = true", please do not send BLE data.

              Once congestion is removed, GATT_CONGEST_EVT event with "congested = FALSE" will be generated and forwarded to application.

               

              2. Check return value of wiced_bt_gatt_send_notification()

              As you already done, please check return value of wiced_bt_gatt_send_notification function.

              If you got congested error, please wait uncongestion event.

               

              Can you try this method and see ?

               

              Thanks,
              Anjana