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 095ba31..76784d0 100644 (file)
@@ -5662,6 +5662,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 2bd532d..e53ea7d 100644 (file)
@@ -841,19 +841,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 8829eac..354b08a 100644 (file)
@@ -222,16 +222,6 @@ typedef void (*bt_hf_call_status_updated_event_cb) (GSList *call_info_list, void
 
 /**
  * @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
  * @since_tizen @if WEARABLE 3.0 @endif
  *
index 73acced..f73a2d3 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 */