4 Replies Latest reply on Sep 25, 2015 9:21 AM by dutch2

    How to increase characteristic data length?

    dutch2

      I have created a custom service with a notify characteristic that sends an uint8 array with a size of 20.

         

      How do I increase the size to 60? When I increase to anything over 20 it stops working.

         

      I tied increasing the MTU without success.

         

      Regards, Paul.

        • 1. Re: How to increase characteristic data length?
          dutch2

          Just to clarify, I can increase the length for characteristic to 60 without any issues.

             

          However, when I change the notification len in my code to a higher value it stops working.

             

                      NotificationHandle.attrHandle = REALTIME_CHAR_HANDLE;                
                      NotificationHandle.value.val = BLETemp; //is unsigned char BLETemp[60];
                      NotificationHandle.value.len = 56;
                      
                      /* Send notifications. */
                      CyBle_GattsNotification(cyBle_connHandle, &NotificationHandle);

          • 2. Re: How to increase characteristic data length?
            bmah

            Can you confirm if you have given the length as 60 in the characteristic of the service in the BLE component?  Also, please set the MTU size as 63.

            • 3. Re: How to increase characteristic data length?
              dutch2

              Yes, I set the length of the characteristic to 60 and the MTU to 63 or higher.

                 

              It turns out that is not sufficient.

                 

              You must also add this to the BLE event handler

                 

                      case CYBLE_EVT_GAP_DEVICE_CONNECTED:

                 

                          /* Initiate an MTU exchange request */
                          CyBle_GattcExchangeMtuReq(cyBle_connHandle, CYBLE_GATT_MTU);
                          break;

                 

              This will actually increase the MTU to the configured amount.

                 

              I hope this will help somebody.

                 

              Paul.

              • 4. Re: How to increase characteristic data length?
                nabeel_1522996

                Thanks Paul - this was the port I was looking for to solve my problem. !