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

How to implement 512 bytes characteristic in peripheral

Do we have any example for implementing a characteristic with more than 20 bytes? Thanks.

Parents
  • Example? Just set the length of the characteristic to what you want when you add it.

    ble_gatts_attr_t.max_len
    ble_gatts_attr_t.init_len
    

    and note the defines

    #define BLE_GATTS_FIX_ATTR_LEN_MAX (510)  /**< Maximum length for fixed length Attribute Values. */
    #define BLE_GATTS_VAR_ATTR_LEN_MAX (512)  /**< Maximum length for variable length Attribute Values. */
    
  • I am doing some test to verify this now. I have a characteristic set to init_len to 40, and max_len = 40. But on Master Control Panel, it only reads the first 20 bytes when I press "discover services" button. When I press "Read" button in the log window it only shows 20 bytes too. I want to verify I can put more than 20 bytes out before I test my device with Apple devices.

Reply
  • I am doing some test to verify this now. I have a characteristic set to init_len to 40, and max_len = 40. But on Master Control Panel, it only reads the first 20 bytes when I press "discover services" button. When I press "Read" button in the log window it only shows 20 bytes too. I want to verify I can put more than 20 bytes out before I test my device with Apple devices.

Children
No Data
Related