att_server: use const for input data buffer

This commit is contained in:
Milanka Ringwald 2018-11-02 14:48:46 +01:00
parent 28e59789a6
commit 3bb3035f55
4 changed files with 9 additions and 9 deletions

View File

@ -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){

View File

@ -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);

View File

@ -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;

View File

@ -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
/*