Hello, in my travels through Nordic development, somehow I am only now creating truly custom characteristics, and I realize I have no idea why there is both an initial and a maximum length specified parameters when you create it. So my questions are:
1) why are these different? do characteristics grow and shrink?
2) what is the maximum characteristic length?
3) is there a big drawback to making characteristics larger rather than smaller?
Thanks!
/**@brief Add characteristic parameters structure. * @details This structure contains the parameters needed to use the @ref characteristic_add function. */ typedef struct { uint16_t uuid; /**< Characteristic UUID (16 bits UUIDs).*/ uint8_t uuid_type; /**< Base UUID. If 0, the Bluetooth SIG UUID will be used. Otherwise, this should be a value returned by @ref sd_ble_uuid_vs_add when adding the base UUID.*/ uint16_t max_len; /**< Maximum length of the characteristic value.*/ uint16_t init_len; /**< Initial length of the characteristic value.*/ uint8_t * p_init_value; /**< Initial encoded value of the characteristic.*/ bool is_var_len; /**< Indicates if the characteristic value has variable length.*/ ble_gatt_char_props_t char_props; /**< Characteristic properties.*/ ble_gatt_char_ext_props_t char_ext_props; /**< Characteristic extended properties.*/ bool is_defered_read; /**< Indicate if deferred read operations are supported.*/ bool is_defered_write; /**< Indicate if deferred write operations are supported.*/ security_req_t read_access; /**< Security requirement for reading the characteristic value.*/ security_req_t write_access; /**< Security requirement for writing the characteristic value.*/ security_req_t cccd_write_access; /**< Security requirement for writing the characteristic's CCCD.*/ bool is_value_user; /**< Indicate if the content of the characteristic is to be stored in the application (user) or in the stack.*/ ble_add_char_user_desc_t *p_user_descr; /**< Pointer to user descriptor if needed*/ ble_gatts_char_pf_t *p_presentation_format; /**< Pointer to characteristic format if needed*/ } ble_add_char_params_t;