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
  • Hi there,

    I am not sure I understand the memory dump you pasted, but here's a possible cause:

    If your p_user_desc_md is != NULL and your p_user_desc_md->write_perm allows the user description descriptor to be written to, then you need to set your wr_aux bit in extended properties.

    Carles

  • Since we provide a GAP/GATT level API we do rely on API users having an understanding of the specification at those levels.

    In GATT 3.3.3.2: "If the Writable Auxiliary bit of the Characteristic Properties is set then this characteristic descriptor can be written".

    I agree that we could be a bit more explicit regarding these sort of pitfalls, but we don't want to replicate the whole specification in our documentation either, so it's a tough balance to strike.

Reply
  • Since we provide a GAP/GATT level API we do rely on API users having an understanding of the specification at those levels.

    In GATT 3.3.3.2: "If the Writable Auxiliary bit of the Characteristic Properties is set then this characteristic descriptor can be written".

    I agree that we could be a bit more explicit regarding these sort of pitfalls, but we don't want to replicate the whole specification in our documentation either, so it's a tough balance to strike.

Children
No Data
Related