From: sinikang Date: Mon, 13 Mar 2017 10:11:33 +0000 (+0900) Subject: Add some core object for tw2 plugin support X-Git-Tag: accepted/tizen/common/20170315.124735^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F40%2F118640%2F2;p=platform%2Fcore%2Ftelephony%2Flibtcore.git Add some core object for tw2 plugin support Change-Id: I5c6d36daaac932cc6bf3f038776785d852cbd337 --- diff --git a/include/co_call.h b/include/co_call.h index 87adf4e..a958b9c 100644 --- a/include/co_call.h +++ b/include/co_call.h @@ -60,6 +60,8 @@ enum tcore_call_status { TCORE_CALL_STATUS_SETUP_PENDING, /*call core object created but no operation invoked - when invoked, status transition to TCORE_CALL_STATUS_SETUP*/ TCORE_CALL_STATUS_SETUP, /*call core object created & call_handle assigned, but call_id not assigned by CP*/ + TCORE_CALL_STATUS_MT_SETUP, /*MT SETUP msg received but detailed info not gathered from CP side. added to cover early SS_INFO_NOTI with CLI info*/ + TCORE_CALL_STATUS_MAX }; @@ -245,6 +247,8 @@ gboolean tcore_call_object_set_active_line(CallObject *co, unsigned int line); int tcore_call_object_get_active_line(CallObject *co); gboolean tcore_call_object_set_is_volte_call(CallObject *co, gboolean flag); gboolean tcore_call_object_get_is_volte_call(CallObject *co); +gboolean tcore_call_object_set_is_srvcc_call(CallObject *co, gboolean flag); +gboolean tcore_call_object_get_is_srvcc_call(CallObject *co); gboolean tcore_call_object_set_session_id(CallObject *co, int session_id); int tcore_call_object_get_session_id(CallObject *co); gboolean tcore_call_object_set_conf_call_session_id(CallObject *co, int session_id); diff --git a/include/co_network.h b/include/co_network.h index 868b221..af0e705 100644 --- a/include/co_network.h +++ b/include/co_network.h @@ -202,7 +202,9 @@ TReturn tcore_network_set_ecc_rat(CoreObject *co, TReturn tcore_network_get_ecc_rat(CoreObject *co, enum telephony_network_access_technology *ecc_rat); TReturn tcore_network_operator_info_add(CoreObject *co, - const struct tcore_network_operator_info *noi); + const struct tcore_network_operator_info *noi); +TReturn tcore_network_operator_info_remove(CoreObject *co, + const struct tcore_network_operator_info *noi); struct tcore_network_operator_info *tcore_network_operator_info_find(CoreObject *co, const char *mcc, const char *mnc); diff --git a/include/type/network.h b/include/type/network.h index c3061b1..e7fa04b 100644 --- a/include/type/network.h +++ b/include/type/network.h @@ -245,6 +245,13 @@ enum telephony_network_ims_reg_ecmp_mode { NETWORK_IMS_REG_ECMP_MODE_PS_PREFERRED = 1, /**< PS preferred */ }; +/* IMS specific */ +enum telephony_network_ims_dereg_cause { + NETWORK_IMS_DEREG_CAUSE_NONE = 0, /**< None */ + NETWORK_IMS_DEREG_CAUSE_LOW_BATTERY = 1, /**< Low Battery */ + NETWORK_IMS_DEREG_CAUSE_APN_CHANGED = 2, /**< APN Changed */ +}; + enum telephony_network_ecc_rat_search_status { NETWORK_ECC_RAT_SEARCH_STATUS_IDLE, NETWORK_ECC_RAT_SEARCH_STATUS_WAITING, @@ -414,6 +421,10 @@ struct treq_network_get_default_subscription { /* no data */ struct treq_network_get_subscription_source { /* no data */ }; +struct treq_network_set_ims_deregister { + enum telephony_network_ims_dereg_cause cause; +}; + struct tresp_network_search { TReturn result; int list_count; diff --git a/include/type/notification.h b/include/type/notification.h index 7b19e6d..708308d 100644 --- a/include/type/notification.h +++ b/include/type/notification.h @@ -116,6 +116,7 @@ enum tcore_notification_command { TNOTI_SIM = TCORE_NOTIFICATION | TCORE_TYPE_SIM, TNOTI_SIM_STATUS, + TNOTI_SIM_REFRESH_STAGE, TNOTI_SIM_REFRESHED, TNOTI_SIM_CALL_FORWARD_STATE, diff --git a/include/type/sim.h b/include/type/sim.h index 8553e35..eeffe16 100644 --- a/include/type/sim.h +++ b/include/type/sim.h @@ -722,6 +722,13 @@ enum tel_sim_img_coding_scheme{ SIM_IMG_CODING_SCHEME_RESERVED = 0xFF }; +enum tel_sim_refresh_stage { + SIM_REFRESH_WAIT_FOR_OK = 0, /** Waiting for OK to init. */ + SIM_REFRESH_START = 1, /**Refresh Start.*/ + SIM_RFRESH_END_SUCCESS = 2, /**Refresh End with Success.*/ + SIM_REFRESH_END_FAILURE = 3 /**Refresh End with Failure.*/ +}; + struct tel_sim_sst { char service[SIM_SST_SERVICE_CNT_MAX]; /**< should accessed with 'enum tel_sim_sst_service' as index */ }; @@ -1359,6 +1366,10 @@ struct tnoti_sim_call_forward_state { gboolean b_forward; }; +struct tnoti_sim_refresh_stage { + enum tel_sim_refresh_stage stage; +}; + __END_DECLS #endif diff --git a/include/type/sms.h b/include/type/sms.h index 8297cb3..8c6394e 100644 --- a/include/type/sms.h +++ b/include/type/sms.h @@ -251,6 +251,20 @@ enum telephony_sms_3gpp_type { SMS_NETTYPE_MWI, /**< Message waiting indication */ }; +/** + * @enum telephony_sms_cb_selected_id + * This defines the cb config, type (selected_id) + */ +enum telephony_sms_cb_enabled_id { + SMS_CB_SET_OFF, + SMS_CB_SET_SOME, + SMS_CB_SET_ALL, + SMS_CB_SET_CB_SOME_CMAS_SOME, + SMS_CB_SET_CB_ALL_CMAS_SOME, + SMS_CB_SET_CB_SOME_CMAS_ALL, + SMS_CB_SET_CB_ALL_CMAS_ALL, + SMS_CB_SET_MAX, +}; /** * This structure defines the fields related to an Sms like SIM index, TPDU and length diff --git a/include/util.h b/include/util.h index aebafe8..a60845f 100644 --- a/include/util.h +++ b/include/util.h @@ -114,7 +114,8 @@ void tcore_util_swap_byte_order(unsigned char* dest, const unsigned char* src, i char *tcore_util_get_version(void); void tcore_util_set_log(gboolean enable); gboolean tcore_util_is_country_NA(char *plmn); - +gboolean tcore_util_convert_ipv4_secure_log(gchar *input, gchar *output, int output_len); +gboolean tcore_util_convert_ipv6_secure_log(gchar *input, gchar *output, int output_len); __END_DECLS #endif /* __TCORE_UTIL_H__ */ diff --git a/packaging/libtcore.spec b/packaging/libtcore.spec index 9c46fc1..a16b12f 100644 --- a/packaging/libtcore.spec +++ b/packaging/libtcore.spec @@ -1,6 +1,6 @@ %define major 0 %define minor 3 -%define patchlevel 12 +%define patchlevel 13 Name: libtcore Version: %{major}.%{minor}.%{patchlevel} diff --git a/src/core_object/co_call.c b/src/core_object/co_call.c index 5b7d997..c1aed15 100644 --- a/src/core_object/co_call.c +++ b/src/core_object/co_call.c @@ -70,6 +70,7 @@ struct call_object { /* IMS: VoLTE/ViLTE speciifc parameters */ gboolean is_volte_call; /* True: VoLTE Call, False: CS Call */ + gboolean is_srvcc_call; /* VoLTE call that will be moved to CS call after SRVCC */ int session_id; /* IMS Session ID */ int conf_call_session_id; /* N-way Conference call session-id (VoLTE only) */ gboolean early_media; /* Early media started */ @@ -923,6 +924,22 @@ gboolean tcore_call_object_get_is_volte_call(CallObject *co) return co->is_volte_call; } +gboolean tcore_call_object_set_is_srvcc_call(CallObject *co, gboolean flag) +{ + tcore_check_null_ret_err("co", co, FALSE); + + co->is_srvcc_call = flag; + + return TRUE; +} + +gboolean tcore_call_object_get_is_srvcc_call(CallObject *co) +{ + tcore_check_null_ret_err("co", co, FALSE); + + return co->is_srvcc_call; +} + gboolean tcore_call_object_set_session_id(CallObject *co, int session_id) { tcore_check_null_ret_err("co", co, FALSE); diff --git a/src/core_object/co_network.c b/src/core_object/co_network.c index 4b5f2db..ee71088 100644 --- a/src/core_object/co_network.c +++ b/src/core_object/co_network.c @@ -1141,6 +1141,54 @@ TReturn tcore_network_operator_info_add(CoreObject *co, return TCORE_RETURN_SUCCESS; } +TReturn tcore_network_operator_info_remove(CoreObject *co, + const struct tcore_network_operator_info *noi) +{ + struct private_object_data *po = NULL; + char plmn[7]; + int mcc_index, mnc_index; + GSList *noi_list = NULL, *list = NULL; + + CORE_OBJECT_CHECK_RETURN(co, CORE_OBJECT_TYPE_NETWORK, TCORE_RETURN_EINVAL); + + if (!noi) + return TCORE_RETURN_EINVAL; + + mcc_index = atoi(noi->mcc); + mnc_index = atoi(noi->mnc); + + if (mcc_index > 999 || mnc_index > 999) { + err("mcc_index %d mnc_index %d", mcc_index, mnc_index); + return TCORE_RETURN_EINVAL; + } + + po = tcore_object_ref_object(co); + if (!po) + return TCORE_RETURN_EINVAL; + + g_strlcpy(plmn, noi->mcc, NETWORK_MAX_MCC_LEN + 1); + g_strlcpy(plmn + NETWORK_MAX_MCC_LEN, noi->mnc, NETWORK_MAX_MNC_LEN + 1); + + noi_list = g_hash_table_lookup(po->operator_info_hash, plmn); + if (noi_list) { + for (list = noi_list; list; list = list->next) { + struct tcore_network_operator_info *tmp_noi = list->data; + + if (strlen(tmp_noi->name) == 0) + continue; + + if (tmp_noi->type == noi->type) { + dbg("Remove mcc[%s] mnc[%s] name[%s] type[%d]", tmp_noi->mcc, tmp_noi->mnc, tmp_noi->name, tmp_noi->type); + noi_list = g_slist_remove(noi_list, tmp_noi); + break; + } + } + } + + return TCORE_RETURN_SUCCESS; + +} + struct tcore_network_operator_info * tcore_network_operator_info_find(CoreObject *co, const char *mcc, const char *mnc) { diff --git a/src/util.c b/src/util.c index fef6d71..7ce3e57 100644 --- a/src/util.c +++ b/src/util.c @@ -40,6 +40,7 @@ #define tabGsmUniMax2 9 #define tabGsmUniMax 42 #define TAB_SPACE " " +#define MAX_BUF_SIZE 255 gboolean tcore_debug = TRUE; @@ -2161,3 +2162,57 @@ gboolean tcore_util_is_country_NA(char *plmn) return FALSE; } +gboolean tcore_util_convert_ipv4_secure_log(gchar *input, gchar *output, int output_len) +{ + gchar buf[MAX_BUF_SIZE] = {0,}; + gchar * pch = NULL; + int count = 0; + + pch = strtok(input, "."); + while (pch != NULL) + { + if (count % 2) { + int i = 0; + int len = strlen(pch); + for (i = 0; i < len;i++) + g_strlcat(buf, "x", MAX_BUF_SIZE); + } + else + g_strlcat(buf, pch, MAX_BUF_SIZE); + pch = strtok(NULL, "."); + if(pch) + g_strlcat(buf, ".", MAX_BUF_SIZE); + count++; + } + g_strlcpy(output, buf, output_len); + + return TRUE; +} + +gboolean tcore_util_convert_ipv6_secure_log(gchar *input, gchar *output, int output_len) +{ + gchar buf[MAX_BUF_SIZE] = {0,}; + gchar * pch = NULL; + int count = 0; + + pch = strtok(input, ":"); + while (pch != NULL) + { + if (count % 2) { + int i = 0; + int len = strlen(pch); + for (i = 0; i < len;i++) + g_strlcat(buf, "x", MAX_BUF_SIZE); + } + else + g_strlcat(buf, pch, MAX_BUF_SIZE); + pch = strtok(NULL, ":"); + if(pch) + g_strlcat(buf, ":", MAX_BUF_SIZE); + count++; + } + g_strlcpy(output, buf, output_len); + + return TRUE; +} +