From 42114cbf9ae58df0c7168d37b60fa4bc15ade2c7 Mon Sep 17 00:00:00 2001 From: Sangki Park Date: Fri, 11 Nov 2016 17:41:17 +0900 Subject: [PATCH] Code sync from 2.3 branch [Model] ALL [BinType] AP [Customer] ALL [Issue#] Internal [Request] N/A [Occurrence Version] N/A [Problem] Code sync from 2.3 branch [Cause & Measure] N/A [Checking Method] N/A [Team] Basic connection [Developer] Sangki Park [Solution company] Samsung [Change Type] Specific change Change-Id: I7566caa9f320efbce4d26028309a75f438e402a7 Signed-off-by: Sudha Bheemanna Conflicts: src/bluetooth-common.c Change-Id: I7566caa9f320efbce4d26028309a75f438e402a7 --- include/mobile/bluetooth_type_internal.h | 11 ++++ include/tv/bluetooth_type_internal.h | 12 ++++ include/wearable/bluetooth_type_internal.h | 12 ++++ src/bluetooth-common.c | 74 ++++++++++++++++++++++ 4 files changed, 109 insertions(+) mode change 100644 => 100755 include/mobile/bluetooth_type_internal.h mode change 100644 => 100755 include/tv/bluetooth_type_internal.h mode change 100644 => 100755 include/wearable/bluetooth_type_internal.h mode change 100644 => 100755 src/bluetooth-common.c diff --git a/include/mobile/bluetooth_type_internal.h b/include/mobile/bluetooth_type_internal.h old mode 100644 new mode 100755 index 0dfb58b..d964c12 --- a/include/mobile/bluetooth_type_internal.h +++ b/include/mobile/bluetooth_type_internal.h @@ -534,6 +534,17 @@ typedef void (*bt_proximity_property_changed_cb) typedef void (*bt_adapter_authentication_req_cb)(int result, bt_authentication_type_info_e auth_type, char *device_name, char *remote_addr, char *pass_key, void *user_data); +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE + * @brief Called when a XSAT vendor command is transmitted from Hands-Free. + * @since_tizen 2.3 + * + * @param[in] command The XSAT vendor command transmitted from Hands-Free + * @param[in] user_data The user data passed from the callback registration function + * @see bt_ag_set_vendor_cmd_cb() + * @see bt_ag_unset_vendor_cmd_cb() + */ +typedef void (*bt_ag_vendor_cmd_cb) (char *command, void *user_data); /** * @} diff --git a/include/tv/bluetooth_type_internal.h b/include/tv/bluetooth_type_internal.h old mode 100644 new mode 100755 index e431b7c..6833856 --- a/include/tv/bluetooth_type_internal.h +++ b/include/tv/bluetooth_type_internal.h @@ -534,6 +534,18 @@ typedef void (*bt_adapter_authentication_req_cb)(int result, bt_authentication_t typedef void (*bt_proximity_property_changed_cb) (int result, const char *remote_address, int role, int service_type, int prop_value, void *user_data); +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE + * @brief Called when a XSAT vendor command is transmitted from Hands-Free. + * @since_tizen 2.3 + * + * @param[in] command The XSAT vendor command transmitted from Hands-Free + * @param[in] user_data The user data passed from the callback registration function + * @see bt_ag_set_vendor_cmd_cb() + * @see bt_ag_unset_vendor_cmd_cb() + */ +typedef void (*bt_ag_vendor_cmd_cb) (char *command, void *user_data); + /** * @} */ diff --git a/include/wearable/bluetooth_type_internal.h b/include/wearable/bluetooth_type_internal.h old mode 100644 new mode 100755 index 06f4075..402cda0 --- a/include/wearable/bluetooth_type_internal.h +++ b/include/wearable/bluetooth_type_internal.h @@ -546,6 +546,18 @@ typedef void (*bt_adapter_authentication_req_cb)(int result, bt_authentication_t typedef void (*bt_proximity_property_changed_cb) (int result, const char *remote_address, int role, int service_type, int prop_value, void *user_data); +/** + * @ingroup CAPI_NETWORK_BLUETOOTH_AUDIO_AG_MODULE + * @brief Called when a XSAT vendor command is transmitted from Hands-Free. + * @since_tizen 2.3 + * + * @param[in] command The XSAT vendor command transmitted from Hands-Free + * @param[in] user_data The user data passed from the callback registration function + * @see bt_ag_set_vendor_cmd_cb() + * @see bt_ag_unset_vendor_cmd_cb() + */ +typedef void (*bt_ag_vendor_cmd_cb) (char *command, void *user_data); + /** * @} */ diff --git a/src/bluetooth-common.c b/src/bluetooth-common.c old mode 100644 new mode 100755 index 23d33b8..2a47176 --- a/src/bluetooth-common.c +++ b/src/bluetooth-common.c @@ -1198,6 +1198,56 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us (false, conn_info, bt_event_slot_container[event_index].user_data); __bt_free_bt_device_connection_info_s(conn_info); break; + case BLUETOOTH_EVENT_RSSI_ENABLED: + BT_INFO("bt_rssi_monitor_enabled_cb() will be called"); + bt_rssi_enabled_t *enabled = (bt_rssi_enabled_t *)(param->param_data); + + if (_bt_check_cb(event_index)) { + ((bt_rssi_monitor_enabled_cb)bt_event_slot_container[event_index].callback) + (enabled->address, enabled->link_type, enabled->rssi_enabled, + bt_event_slot_container[event_index].user_data); + _bt_unset_cb(BT_EVENT_RSSI_ENABLED_EVENT); + } + break; + case BLUETOOTH_EVENT_RSSI_ALERT: { + BT_INFO("bt_rssi_alert_cb() will be called"); + int alert_type; + int rssi_dbm; + int link_type; + char *address; + bt_rssi_alert_t *rssi_alert = (bt_rssi_alert_t *)(param->param_data);; + + alert_type = rssi_alert->alert_type; + rssi_dbm = rssi_alert->rssi_dbm; + address = rssi_alert->address; + link_type = rssi_alert->link_type; + if (_bt_check_cb(event_index)) { + ((bt_rssi_alert_cb)bt_event_slot_container[event_index].callback) + (address, link_type, alert_type, rssi_dbm, + bt_event_slot_container[event_index].user_data); + } + break; + } + case BLUETOOTH_EVENT_RAW_RSSI: { + BT_INFO("bt_rssi_strength_cb() will be called"); + int rssi_dbm; + int link_type; + char *address; + bt_raw_rssi_t *raw_rssi = (bt_raw_rssi_t *)(param->param_data);; + + rssi_dbm = raw_rssi->rssi_dbm; + address = raw_rssi->address; + link_type = raw_rssi->link_type; + + if (_bt_check_cb(event_index)) { + BT_INFO("BT Address [%s] Link Type[%d] RSSI dBm[%d]", + address, link_type, rssi_dbm); + ((bt_rssi_strength_cb)bt_event_slot_container[event_index].callback) + (address, link_type, rssi_dbm, bt_event_slot_container[event_index].user_data); + _bt_unset_cb(BT_EVENT_GET_RSSI_EVENT); + } + break; + } case BLUETOOTH_EVENT_SERVICE_SEARCHED: BT_INFO("bt_device_service_searched_cb() will be called"); error_code = _bt_get_error_code(param->result); @@ -1552,7 +1602,14 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us (call_data->dtmf, bt_event_slot_container[event_index].user_data); break; } + case BLUETOOTH_EVENT_TELEPHONY_VENDOR_AT_CMD: { + char *vendor_cmd = param->param_data; + BT_INFO("BLUETOOTH_EVENT_TELEPHONY_VENDOR_AT_CMD"); + ((bt_ag_vendor_cmd_cb)bt_event_slot_container[event_index].callback) + (vendor_cmd, bt_event_slot_container[event_index].user_data); + break; + } case BLUETOOTH_EVENT_AG_SPEAKER_GAIN: BT_INFO("BLUETOOTH_EVENT_AG_SPEAKER_GAIN"); int *spk_gain = (int *)(param->param_data); @@ -2484,6 +2541,15 @@ static void __bt_event_proxy(int event, bluetooth_event_param_t *param, void *us (BT_HF_REMOTE_CALL_EVENT_SWAPPED, NULL, bt_event_slot_container[event_index].user_data); break; + case BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD: + BT_INFO("BLUETOOTH_EVENT_HF_VENDOR_DEP_CMD"); + bluetooth_vendor_dep_at_cmd_t *cmd = (bluetooth_vendor_dep_at_cmd_t *)(param->param_data); + bt_hf_vendor_dep_at_cmd_s command = {0, }; + command.app_id = cmd->app_id; + command.message = strdup(cmd->message); + ((bt_hf_vendor_dep_cmd_event_cb)bt_event_slot_container[event_index].callback) + (command, bt_event_slot_container[event_index].user_data); + break; case BLUETOOTH_EVENT_HF_VOLUME_SPEAKER: { BT_INFO("BLUETOOTH_EVENT_HF_VOLUME_SPEAKER"); int *spk_gain = (int *)(param->param_data); @@ -3022,6 +3088,14 @@ static int __bt_get_cb_index(int event) return BT_EVENT_PASSKEY_NOTIFICATION_EVENT; case BLUETOOTH_EVENT_CONNECTABLE_CHANGED: return BT_EVENT_CONNECTABLE_CHANGED_EVENT; /* LCOV_EXCL_LINE */ + case BLUETOOTH_EVENT_TELEPHONY_VENDOR_AT_CMD: + return BT_EVENT_AG_VENDOR_CMD; + case BLUETOOTH_EVENT_RSSI_ENABLED: + return BT_EVENT_RSSI_ENABLED_EVENT; + case BLUETOOTH_EVENT_RSSI_ALERT: + return BT_EVENT_RSSI_ALERT_EVENT; + case BLUETOOTH_EVENT_RAW_RSSI: + return BT_EVENT_GET_RSSI_EVENT; case BLUETOOTH_EVENT_IPSP_CONNECTED: case BLUETOOTH_EVENT_IPSP_DISCONNECTED: return BT_EVENT_IPSP_CONNECTION_STATUS; /* LCOV_EXCL_LINE */ -- 2.34.1