diff --git a/CHANGELOG.md b/CHANGELOG.md index 7d744c29e..779792126 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Changed - Chipset: use da145xx in folder/file/function names for these SoCs +- ATT Server: use uint8_t for status returns - AVDTP: use BLUETOOTH_SERVICE_CLASS_AUDIO_SINK / SOURCE instead of BLUETOOTH_PROTOCOL_AVDTP in SDP queries ## Release v1.5.1 diff --git a/src/ble/att_server.c b/src/ble/att_server.c index 0fbddce24..0f136da91 100644 --- a/src/ble/att_server.c +++ b/src/ble/att_server.c @@ -599,7 +599,7 @@ static int att_server_process_validated_request(hci_connection_t * hci_connectio } #ifdef ENABLE_ATT_DELAYED_RESPONSE -int att_server_response_ready(hci_con_handle_t con_handle){ +uint8_t att_server_response_ready(hci_con_handle_t con_handle){ hci_connection_t * hci_connection = hci_connection_for_handle(con_handle); if (!hci_connection) return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; att_server_t * att_server = &hci_connection->att_server; @@ -1191,7 +1191,7 @@ int att_server_can_send_packet_now(hci_con_handle_t con_handle){ return att_server_can_send_packet(hci_connection); } -int att_server_register_can_send_now_callback(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){ +uint8_t att_server_register_can_send_now_callback(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){ return att_server_request_to_send_notification(callback_registration, con_handle); } @@ -1201,7 +1201,7 @@ void att_server_request_can_send_now_event(hci_con_handle_t con_handle){ } // end of deprecated -int att_server_request_to_send_notification(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){ +uint8_t att_server_request_to_send_notification(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){ hci_connection_t * hci_connection = hci_connection_for_handle(con_handle); if (!hci_connection) return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; att_server_t * att_server = &hci_connection->att_server; @@ -1214,7 +1214,7 @@ int att_server_request_to_send_notification(btstack_context_callback_registratio } } -int att_server_request_to_send_indication(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){ +uint8_t att_server_request_to_send_indication(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle){ hci_connection_t * hci_connection = hci_connection_for_handle(con_handle); if (!hci_connection) return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; att_server_t * att_server = &hci_connection->att_server; @@ -1227,7 +1227,7 @@ int att_server_request_to_send_indication(btstack_context_callback_registration_ } } -int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len){ +uint8_t att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len){ hci_connection_t * hci_connection = hci_connection_for_handle(con_handle); if (!hci_connection) return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; att_connection_t * att_connection = &hci_connection->att_connection; @@ -1246,7 +1246,7 @@ int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, co return l2cap_send_prepared_connectionless(att_connection->con_handle, L2CAP_CID_ATTRIBUTE_PROTOCOL, size); } -int att_server_indicate(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len){ +uint8_t att_server_indicate(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len){ hci_connection_t * hci_connection = hci_connection_for_handle(con_handle); if (!hci_connection) return ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER; att_server_t * att_server = &hci_connection->att_server; diff --git a/src/ble/att_server.h b/src/ble/att_server.h index c0b0d0225..cba5ee8ef 100644 --- a/src/ble/att_server.h +++ b/src/ble/att_server.h @@ -83,7 +83,7 @@ void att_server_register_service_handler(att_service_handler_t * handler); * @param con_handle * @return 0 if ok, error otherwise */ -int att_server_register_can_send_now_callback(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle); +uint8_t att_server_register_can_send_now_callback(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle); /** * @brief Return ATT MTU @@ -99,7 +99,7 @@ uint16_t att_server_get_mtu(hci_con_handle_t con_handle); * @param con_handle * @return ERROR_CODE_SUCCESS if ok, ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if handle unknown, and ERROR_CODE_COMMAND_DISALLOWED if callback already registered */ -int att_server_request_to_send_notification(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle); +uint8_t att_server_request_to_send_notification(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle); /** * @brief Request callback when sending indication is possible @@ -108,7 +108,7 @@ int att_server_request_to_send_notification(btstack_context_callback_registratio * @param con_handle * @return ERROR_CODE_SUCCESS if ok, ERROR_CODE_UNKNOWN_CONNECTION_IDENTIFIER if handle unknown, and ERROR_CODE_COMMAND_DISALLOWED if callback already registered */ -int att_server_request_to_send_indication(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle); +uint8_t att_server_request_to_send_indication(btstack_context_callback_registration_t * callback_registration, hci_con_handle_t con_handle); /* * @brief notify client about attribute value change @@ -118,7 +118,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, const uint8_t *value, uint16_t value_len); +uint8_t 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 @@ -128,7 +128,7 @@ int att_server_notify(hci_con_handle_t con_handle, uint16_t attribute_handle, co * @param value_len * @return 0 if ok, error otherwise */ -int att_server_indicate(hci_con_handle_t con_handle, uint16_t attribute_handle, const uint8_t *value, uint16_t value_len); +uint8_t 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 /* @@ -138,7 +138,7 @@ int att_server_indicate(hci_con_handle_t con_handle, uint16_t attribute_handle, * @param con_handle * @return 0 if ok, error otherwise */ -int att_server_response_ready(hci_con_handle_t con_handle); +uint8_t att_server_response_ready(hci_con_handle_t con_handle); #endif // the following functions will be removed soon