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

Variable length not working?

/**@brief Attribute metadata. */
typedef struct
{
  ble_gap_conn_sec_mode_t read_perm;       /**< Read permissions. */
  ble_gap_conn_sec_mode_t write_perm;      /**< Write permissions. */
  uint8_t                 vlen       :1;   /**< Variable length attribute. */
  uint8_t                 vloc       :2;   /**< Value location, see @ref BLE_GATTS_VLOCS.*/
  uint8_t                 rd_auth    :1;   /**< Read Authorization and value will be requested from the application on every read operation. */ 
  uint8_t                 wr_auth    :1;   /**< Write Authorization will be requested from the application on every Write Request operation (but not Write Command). */
} ble_gatts_attr_md_t;

Whenever I set .vlen to true the softdevice fails with error 7 on the call to: sd_ble_gatts_characteristic_add

Is this functionality implemented, and are there any examples using it?

Parents
  • This is what is going into to the metadata struct (the null pointers are not expanded). Do I need to fill in all the structs, or can I just fill in the ones that I don't want to be default?

    _ns	0x200031c8	
    	char_props	{...}	
    		broadcast	0	
    		read	0	
    		write_wo_resp	0	
    		write	1	
    		notify	0	
    		indicate	0	
    		auth_signed_wr	0	
    	char_ext_props	{...}	
    		reliable_wr	0	
    		wr_aux	0	
    	p_char_user_desc	0x00000000	
    	char_user_desc_max_size	0	
    	char_user_desc_size	0	
    	p_char_pf	0x00000000	
    	p_user_desc_md	0x20003210	
    		read_perm	{...}	
    			sm	1	
    			lv	1	
    		write_perm	{...}	
    			sm	1	
    			lv	1	
    		vlen	1	
    		vloc	0	
    		rd_auth	0	
    		wr_auth	0	
    	p_cccd_md	0x00000000	
    	p_sccd_md	0x00000000	
    
Reply
  • This is what is going into to the metadata struct (the null pointers are not expanded). Do I need to fill in all the structs, or can I just fill in the ones that I don't want to be default?

    _ns	0x200031c8	
    	char_props	{...}	
    		broadcast	0	
    		read	0	
    		write_wo_resp	0	
    		write	1	
    		notify	0	
    		indicate	0	
    		auth_signed_wr	0	
    	char_ext_props	{...}	
    		reliable_wr	0	
    		wr_aux	0	
    	p_char_user_desc	0x00000000	
    	char_user_desc_max_size	0	
    	char_user_desc_size	0	
    	p_char_pf	0x00000000	
    	p_user_desc_md	0x20003210	
    		read_perm	{...}	
    			sm	1	
    			lv	1	
    		write_perm	{...}	
    			sm	1	
    			lv	1	
    		vlen	1	
    		vloc	0	
    		rd_auth	0	
    		wr_auth	0	
    	p_cccd_md	0x00000000	
    	p_sccd_md	0x00000000	
    
Children
No Data
Related