diff --git a/src/ble/att_db.c b/src/ble/att_db.c index e795cbf38..697269efc 100644 --- a/src/ble/att_db.c +++ b/src/ble/att_db.c @@ -1098,7 +1098,7 @@ static void handle_write_command(att_connection_t * att_connection, uint8_t * re // MARK: helper for ATT_HANDLE_VALUE_NOTIFICATION and ATT_HANDLE_VALUE_INDICATION static uint16_t prepare_handle_value(att_connection_t * att_connection, uint16_t handle, - uint8_t *value, + const uint8_t *value, uint16_t value_len, uint8_t * response_buffer){ little_endian_store_16(response_buffer, 1, handle); @@ -1112,7 +1112,7 @@ static uint16_t prepare_handle_value(att_connection_t * att_connection, // MARK: ATT_HANDLE_VALUE_NOTIFICATION 0x1b uint16_t att_prepare_handle_value_notification(att_connection_t * att_connection, uint16_t handle, - uint8_t *value, + const uint8_t *value, uint16_t value_len, uint8_t * response_buffer){ @@ -1123,7 +1123,7 @@ uint16_t att_prepare_handle_value_notification(att_connection_t * att_connection // MARK: ATT_HANDLE_VALUE_INDICATION 0x1d uint16_t att_prepare_handle_value_indication(att_connection_t * att_connection, uint16_t handle, - uint8_t *value, + const uint8_t *value, uint16_t value_len, uint8_t * response_buffer){ diff --git a/src/ble/att_db.h b/src/ble/att_db.h index ca3679b54..c318088eb 100644 --- a/src/ble/att_db.h +++ b/src/ble/att_db.h @@ -158,7 +158,7 @@ uint16_t att_handle_request(att_connection_t * att_connection, */ uint16_t att_prepare_handle_value_notification(att_connection_t * att_connection, uint16_t attribute_handle, - uint8_t *value, + const uint8_t *value, uint16_t value_len, uint8_t * response_buffer); @@ -172,7 +172,7 @@ uint16_t att_prepare_handle_value_notification(att_connection_t * att_connection */ uint16_t att_prepare_handle_value_indication(att_connection_t * att_connection, uint16_t attribute_handle, - uint8_t *value, + const uint8_t *value, uint16_t value_len, uint8_t * response_buffer); diff --git a/src/ble/att_server.c b/src/ble/att_server.c index b436387a5..9c0b720bf 100644 --- a/src/ble/att_server.c +++ b/src/ble/att_server.c @@ -988,7 +988,7 @@ int att_server_request_to_send_indication(btstack_context_callback_registration_ return ERROR_CODE_SUCCESS; } -int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t *value, uint16_t value_len){ +int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len){ att_server_t * att_server = att_server_for_handle(con_handle); if (!att_server) return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; @@ -1000,7 +1000,7 @@ int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, ui return l2cap_send_prepared_connectionless(att_server->connection.con_handle, L2CAP_CID_ATTRIBUTE_PROTOCOL, size); } -int att_server_indicate(hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t *value, uint16_t value_len){ +int att_server_indicate(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len){ att_server_t * att_server = att_server_for_handle(con_handle); if (!att_server) return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; diff --git a/src/ble/att_server.h b/src/ble/att_server.h index d6eedd3f6..0995a9d97 100644 --- a/src/ble/att_server.h +++ b/src/ble/att_server.h @@ -124,7 +124,7 @@ int att_server_request_to_send_indication(btstack_context_callback_registration_ * @param value_len * @return 0 if ok, error otherwise */ -int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t *value, uint16_t value_len); +int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len); /* * @brief indicate value change to client. client is supposed to reply with an indication_response @@ -134,7 +134,7 @@ int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, ui * @param value_len * @return 0 if ok, error otherwise */ -int att_server_indicate(hci_con_handle_t con_handle, uint16_t attribute_handle, uint8_t *value, uint16_t value_len); +int att_server_indicate(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len); #ifdef ENABLE_ATT_DELAYED_RESPONSE /*