Bluetooth: GATT: Fix const'ness of characteristic descriptor data
None of the data for the CEP, CUD and CPF descriptors needs to be modified by the stack at runtime. Make it possible to pass constant data to the descriptor macros, and make sure the descriptor handlers cast the data back to be a constant. Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:
parent
62d7a7a5a5
commit
366378f8ac
2 changed files with 6 additions and 6 deletions
|
@ -582,7 +582,7 @@ ssize_t bt_gatt_attr_read_cep(struct bt_conn *conn,
|
|||
*/
|
||||
#define BT_GATT_CEP(_value) \
|
||||
BT_GATT_DESCRIPTOR(BT_UUID_GATT_CEP, BT_GATT_PERM_READ, \
|
||||
bt_gatt_attr_read_cep, NULL, _value)
|
||||
bt_gatt_attr_read_cep, NULL, (void *)_value)
|
||||
|
||||
/** @brief Read Characteristic User Description Descriptor Attribute helper
|
||||
*
|
||||
|
@ -613,7 +613,7 @@ ssize_t bt_gatt_attr_read_cud(struct bt_conn *conn,
|
|||
*/
|
||||
#define BT_GATT_CUD(_value, _perm) \
|
||||
BT_GATT_DESCRIPTOR(BT_UUID_GATT_CUD, _perm, bt_gatt_attr_read_cud, \
|
||||
NULL, _value)
|
||||
NULL, (void *)_value)
|
||||
|
||||
/** @brief Read Characteristic Presentation format Descriptor Attribute helper
|
||||
*
|
||||
|
@ -643,7 +643,7 @@ ssize_t bt_gatt_attr_read_cpf(struct bt_conn *conn,
|
|||
*/
|
||||
#define BT_GATT_CPF(_value) \
|
||||
BT_GATT_DESCRIPTOR(BT_UUID_GATT_CPF, BT_GATT_PERM_READ, \
|
||||
bt_gatt_attr_read_cpf, NULL, (void * const)_value)
|
||||
bt_gatt_attr_read_cpf, NULL, (void *)_value)
|
||||
|
||||
/** @def BT_GATT_DESCRIPTOR
|
||||
* @brief Descriptor Declaration Macro.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue