From: Wootak Jung Date: Wed, 24 Apr 2024 04:46:34 +0000 (+0900) Subject: Add HF internal API to send/receive vendor command X-Git-Tag: accepted/tizen/unified/20240703.100012~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=e52f99c9aeccb8d8046ce1a44f7c2e6601c5a88b;p=platform%2Fcore%2Fapi%2Fbluetooth.git Add HF internal API to send/receive vendor command Change-Id: I1a82ff41412c302f04a861eab51b5afed9f6b53a Signed-off-by: Wootak Jung --- diff --git a/include/bluetooth_internal.h b/include/bluetooth_internal.h index 6d2a9b5..e07f92b 100644 --- a/include/bluetooth_internal.h +++ b/include/bluetooth_internal.h @@ -5873,6 +5873,51 @@ int bt_gatt_server_unset_service_persistence(const char *uuid); */ int bt_socket_get_l2cap_max_buffer_size(int *size); +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE + * @brief Registers a callback function to be invoked when vendor command occurs. + * + * @param[in] callback The callback function to register + * @param[in] user_data The user data to be passed to the callback function + * + * @return 0 on success, otherwise a negative error value + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #BT_ERROR_NOT_INITIALIZED Not initialized + * + * @see bt_hf_notify_vendor_cmd() + */ +int bt_hf_set_vendor_dep_cmd_event_cb(bt_hf_vendor_dep_cmd_event_cb callback, void *user_data); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE + * @brief Unregisters a callback function. + * + * @return 0 on success, otherwise a negative error value + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * @retval #BT_ERROR_NOT_INITIALIZED Not initialized + */ +int bt_hf_unset_vendor_dep_cmd_event_cb(void); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE + * @brief Notifies vendor command to the remote AG device. + * + * @param[in] appid The ID of application + * @param[in] msg The message to send + * + * @return 0 on success, otherwise a negative error value + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #BT_ERROR_NOT_INITIALIZED Not initialized + * + * @see bt_hf_set_vendor_dep_cmd_event_cb() + */ +int bt_hf_notify_vendor_cmd(int appid, char *msg); + /** * @} */ diff --git a/include/bluetooth_private.h b/include/bluetooth_private.h index ff57a1a..7e63ac7 100644 --- a/include/bluetooth_private.h +++ b/include/bluetooth_private.h @@ -853,19 +853,6 @@ typedef enum { */ typedef void (*bt_hf_remote_device_state_changed_cb) (bt_hf_remote_device_state_e state, int value, void *user_data); -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE - * @brief Called when a vendor command event happened from Hands-Free. - * @since_tizen 2.3.2 - * @remarks The @a meesage of cmd must be released with free() by you. - * - * @param[in] cmd The information of vendor command - * @param[in] user_data The user data passed from the callback registration function - * @see bt_hf_set_vendor_dep_cmd_event_cb() - * @see bt_hf_unset_vendor_dep_cmd_event_cb() - */ -typedef void (*bt_hf_vendor_dep_cmd_event_cb) (bt_hf_vendor_dep_at_cmd_s cmd, void *user_data); - /** * @internal * @brief Since the HF call back and event proxy call backs have different prototype it is wrapper function. diff --git a/include/bluetooth_type_extension.h b/include/bluetooth_type_extension.h index 770af3a..f88bf79 100644 --- a/include/bluetooth_type_extension.h +++ b/include/bluetooth_type_extension.h @@ -220,16 +220,6 @@ typedef void (*bt_hf_speaker_gain_changed_cb) (int gain, void *user_data); */ typedef void (*bt_hf_call_status_updated_event_cb) (GSList *call_info_list, void *user_data); -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE - * @brief Samsung XSAT Vendor dependent command. - * @since_tizen 2.3.2 - */ -typedef struct { - int app_id; /**< The application ID */ - char *message; /**< Command message */ -} bt_hf_vendor_dep_at_cmd_s; - /** * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE * @brief Called when a call event happend from Audio-Gateway device diff --git a/include/bluetooth_type_internal.h b/include/bluetooth_type_internal.h index 94a4a42..59ea823 100644 --- a/include/bluetooth_type_internal.h +++ b/include/bluetooth_type_internal.h @@ -1828,6 +1828,28 @@ typedef bool (*bt_mesh_network_group_info_cb) (int result, bt_mesh_network_h network, int total, bt_mesh_group_h group, void *user_data); +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE + * @brief Samsung XSAT Vendor dependent command. + */ +typedef struct { + int app_id; /**< The application ID */ + char *message; /**< Command message */ +} bt_hf_vendor_dep_at_cmd_s; + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE + * @brief Called when a vendor command event happened from Hands-Free. + * @remarks The @a meesage of cmd must be released with free() by you. + * + * @param[in] cmd The information of vendor command + * @param[in] user_data The user data passed from the callback registration function + * + * @see bt_hf_set_vendor_dep_cmd_event_cb() + * @see bt_hf_unset_vendor_dep_cmd_event_cb() + */ +typedef void (*bt_hf_vendor_dep_cmd_event_cb) (bt_hf_vendor_dep_at_cmd_s cmd, void *user_data); + #ifdef __cplusplus } #endif /* __cplusplus */