From 9a66762edf7648d4093b41e223fa65736b66aa6c Mon Sep 17 00:00:00 2001 From: DoHyun Pyun Date: Thu, 8 Dec 2016 10:56:06 +0900 Subject: [PATCH] Add the internal API for HF remote call event Change-Id: I347ade09e27166eed26a2f1a1afe6194bf3a35ad Signed-off-by: DoHyun Pyun --- include/bluetooth_private.h | 35 ---------------------- include/wearable/bluetooth_internal.h | 33 ++++++++++++++++++++ include/wearable/bluetooth_type_internal.h | 34 +++++++++++++++++++++ 3 files changed, 67 insertions(+), 35 deletions(-) diff --git a/include/bluetooth_private.h b/include/bluetooth_private.h index 9de7dde..c3b59e9 100644 --- a/include/bluetooth_private.h +++ b/include/bluetooth_private.h @@ -693,27 +693,6 @@ typedef enum { BT_HF_REMOTE_DEVICE_STATE_VOICE_RECOGNITON, /**< Voice Recognition State (0:disabled , 1:enabled) */ } bt_hf_remote_device_state_e; -/** - * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE - * @brief Enumerations for the call event from Audio-Gateway device - * @since_tizen 3.0 - */ -typedef enum { - BT_HF_REMOTE_CALL_EVENT_IDLE = 0x00, /**< Idle. Neither setup call nor active call exist */ - BT_HF_REMOTE_CALL_EVENT_INCOMING, /**< (Call-setup event) Received an incoming call on AG */ - BT_HF_REMOTE_CALL_EVENT_DIALING, /**< (Call-setup event) Dialing an outgoing call on AG */ - BT_HF_REMOTE_CALL_EVENT_ALERTING, /**< (Call-setup event) Remote party being alerted in an outgoing call of AG */ - BT_HF_REMOTE_CALL_EVENT_CALL_TERMINATED, /**< (Call-setup event) Setup call is terminated without activating */ - BT_HF_REMOTE_CALL_EVENT_CALL_STARTED, /**< (Active call state event) Call is started on AG */ - BT_HF_REMOTE_CALL_EVENT_CALL_ENDED, /**< (Active call state event) Active call is terminated on AG */ - BT_HF_REMOTE_CALL_EVENT_UNHELD, /**< (Call held event) No calls on hold */ - BT_HF_REMOTE_CALL_EVENT_SWAPPED, /**< (Call held event) Call is placed on hold or active/held calls swapped */ - BT_HF_REMOTE_CALL_EVENT_HELD, /**< (Call held event) Calls on hold, no active call */ - BT_HF_REMOTE_CALL_EVENT_RINGING, /**< Incoming call is ringing event with number. This event is optional event. */ - BT_HF_REMOTE_CALL_EVENT_WAITING, /**< Call Waiting notification in 3-way call scenario */ - BT_HF_REMOTE_CALL_EVENT_FAILED_TO_DIALING, /**< Failed to dialing a outgoing call on AG */ -} bt_hf_remote_call_event_e; - /** * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE * @brief Called when a device status changed event happend from Audio-Gateway device @@ -728,20 +707,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 call event happend from Audio-Gateway device - * @since_tizen 3.0 - * - * @param[in] event The call state chagned event from remote Audio-Gateway device - * @param[in] user_data The user data passed from the callback registration function - * - * @see bt_hf_set_remote_call_event_cb() - * @see bt_hf_unset_remote_call_event_cb() - */ -typedef void (*bt_hf_remote_call_event_cb) (bt_hf_remote_call_event_e event, char *phone_number, void *user_data); - /** * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE * @brief Called when a vendor command event happened from Hands-Free. diff --git a/include/wearable/bluetooth_internal.h b/include/wearable/bluetooth_internal.h index b80fb61..6c2136e 100644 --- a/include/wearable/bluetooth_internal.h +++ b/include/wearable/bluetooth_internal.h @@ -2165,6 +2165,39 @@ int bt_hf_set_call_handling_event_cb(bt_hf_call_handling_event_cb callback, void */ int bt_hf_unset_call_handling_event_cb(void); +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE + * @brief Registers a callback function that will be invoked when a call event happend from Audio-Gateway device. + * @since_tizen 3.0 + * @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_INITIALIZED Not initialized + * @retval #BT_ERROR_INVALID_PARAMETER Invalid parameter + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * @pre The Bluetooth audio service must be initialized with bt_audio_initialize(). + * @see bt_audio_initialize() + * @see bt_hf_remote_call_event_cb() + * @see bt_hf_unset_remote_call_event_cb() + */ +int bt_hf_set_remote_call_event_cb(bt_hf_remote_call_event_cb callback, void *user_data); + +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE + * @brief Unregisters a callback function. + * @since_tizen 3.0 + * @return 0 on success, otherwise a negative error value. + * @retval #BT_ERROR_NONE Successful + * @retval #BT_ERROR_NOT_INITIALIZED Not initialized + * @retval #BT_ERROR_NOT_SUPPORTED Not supported + * @pre The Bluetooth audio service must be initialized with bt_audio_initialize(). + * @see bt_audio_initialize() + * @see bt_hf_remote_call_event_cb() + * @see bt_hf_set_remote_call_event_cb() + */ +int bt_hf_unset_remote_call_event_cb(void); + /** * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE * @brief Registers a callback function that will be invoked when a multi call handling event happened from Hands-Free. diff --git a/include/wearable/bluetooth_type_internal.h b/include/wearable/bluetooth_type_internal.h index 21e1a2a..ffbefd5 100644 --- a/include/wearable/bluetooth_type_internal.h +++ b/include/wearable/bluetooth_type_internal.h @@ -88,6 +88,27 @@ typedef enum { BT_AG_CALL_STATE_WAITING, /**< Waiting for connected indication event after answering an incoming call*/ } bt_ag_call_state_e; +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_HF_MODULE + * @brief Enumerations for the call event from Audio-Gateway device + * @since_tizen 3.0 + */ +typedef enum { + BT_HF_REMOTE_CALL_EVENT_IDLE = 0x00, /**< Idle. Neither setup call nor active call exist */ + BT_HF_REMOTE_CALL_EVENT_INCOMING, /**< (Call-setup event) Received an incoming call on AG */ + BT_HF_REMOTE_CALL_EVENT_DIALING, /**< (Call-setup event) Dialing an outgoing call on AG */ + BT_HF_REMOTE_CALL_EVENT_ALERTING, /**< (Call-setup event) Remote party being alerted in an outgoing call of AG */ + BT_HF_REMOTE_CALL_EVENT_CALL_TERMINATED, /**< (Call-setup event) Setup call is terminated without activating */ + BT_HF_REMOTE_CALL_EVENT_CALL_STARTED, /**< (Active call state event) Call is started on AG */ + BT_HF_REMOTE_CALL_EVENT_CALL_ENDED, /**< (Active call state event) Active call is terminated on AG */ + BT_HF_REMOTE_CALL_EVENT_UNHELD, /**< (Call held event) No calls on hold */ + BT_HF_REMOTE_CALL_EVENT_SWAPPED, /**< (Call held event) Call is placed on hold or active/held calls swapped */ + BT_HF_REMOTE_CALL_EVENT_HELD, /**< (Call held event) Calls on hold, no active call */ + BT_HF_REMOTE_CALL_EVENT_RINGING, /**< Incoming call is ringing event with number. This event is optional event. */ + BT_HF_REMOTE_CALL_EVENT_WAITING, /**< Call Waiting notification in 3-way call scenario */ + BT_HF_REMOTE_CALL_EVENT_FAILED_TO_DIALING, /**< Failed to dialing a outgoing call on AG */ +} bt_hf_remote_call_event_e; + /** * @ingroup CAPI_NETWORK_BLUETOOTH_OPP_MODULE * @brief Enumerations for the transfer type @@ -741,6 +762,19 @@ typedef struct { 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 3.0 + * + * @param[in] event The call state chagned event from remote Audio-Gateway device + * @param[in] user_data The user data passed from the callback registration function + * + * @see bt_hf_set_remote_call_event_cb() + * @see bt_hf_unset_remote_call_event_cb() + */ +typedef void (*bt_hf_remote_call_event_cb) (bt_hf_remote_call_event_e event, char *phone_number, void *user_data); + /** * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE * @brief Called when a XSAT vendor command is transmitted from Hands-Free. -- 2.34.1