Add HF internal API to send/receive vendor command 94/310194/2 accepted/tizen/7.0/unified/20240425.080236
authorWootak Jung <wootak.jung@samsung.com>
Wed, 24 Apr 2024 04:46:34 +0000 (13:46 +0900)
committerWootak Jung <wootak.jung@samsung.com>
Wed, 24 Apr 2024 06:19:54 +0000 (15:19 +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 095ba31a6a82babad050f3637406dd3cdab7719e..76784d0827173e8076aeb194d54476e179c852f5 100644 (file)
@@ -5661,6 +5661,51 @@ int bt_adapter_le_remove_advertising_custom_name(bt_advertiser_h advertiser,
  */
 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 2bd532d7d22a41e7497e969596afa9c5fb37be5e..e53ea7d35c48d286ec459c35a703d061b7c3697e 100644 (file)
@@ -840,19 +840,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 8829eace06a5513b91c0276624b8b3ce76d6d5ad..354b08ae7204df4c2783b6fb104e96a766b481a1 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 73accedaa2f193e18546444da3716af12daff87f..f73a2d39d889807dd0a8975c9caf14b553cf2aa3 100644 (file)
@@ -1738,6 +1738,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 */