Add HF internal API to send/receive vendor command 45/313745/1
authorWootak Jung <wootak.jung@samsung.com>
Wed, 24 Apr 2024 04:46:34 +0000 (13:46 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Mon, 1 Jul 2024 10:13:37 +0000 (19:13 +0900)
Change-Id: I1a82ff41412c302f04a861eab51b5afed9f6b53a
Signed-off-by: Wootak Jung <wootak.jung@samsung.com>
include/bluetooth_internal.h
include/bluetooth_private.h
include/bluetooth_type_extension.h
include/bluetooth_type_internal.h

index 6d2a9b5be279dd49bdf26ae078ad965029874d53..e07f92b85214ae391f42200a0ad2b3cf197836f1 100644 (file)
@@ -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);
+
 /**
  * @}
  */
index ff57a1af2d8779395f752610850fcef26fa0eae9..7e63ac7fc3e08c2bd09c548b549b129574648f1f 100644 (file)
@@ -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.
index 770af3a5bf84ee000495f45ff1d6e9c3464dc3b3..f88bf79780febedbfdfff595d2c8c65aa6399244 100644 (file)
@@ -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
index 94a4a42229598d8bfbdefc7e3c700bd67017011d..59ea82349183a39968ddf8abbed3e0d0d57e4803 100644 (file)
@@ -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 */