From 642ae27f7577c2a5976953529449c24c3223bd50 Mon Sep 17 00:00:00 2001 From: Suresh Kumar N Date: Thu, 15 Dec 2016 17:21:37 +0530 Subject: [PATCH] Resolve SAT issues and remove dead code Change-Id: I987ef51b2e4755b58a8d7b7ab6e5b0746c1466b4 Signed-off-by: Suresh Kumar N --- include/co_call.h | 6 ++- include/co_sim.h | 3 -- include/type/call.h | 30 +++++------ include/type/request.h | 4 -- include/type/response.h | 1 - src/core_object/co_call.c | 4 +- src/core_object/co_context.c | 2 +- src/core_object/co_network.c | 2 +- src/core_object/co_sat.c | 27 +++++++--- src/core_object/co_sim.c | 119 ++----------------------------------------- 10 files changed, 46 insertions(+), 152 deletions(-) diff --git a/include/co_call.h b/include/co_call.h index 0b2d7d7..920db73 100644 --- a/include/co_call.h +++ b/include/co_call.h @@ -26,12 +26,14 @@ __BEGIN_DECLS #define MAX_CALL_NUMBER_LEN 83 -#define MAX_CALL_NAME_LEN 83 +#define MAX_CALL_NAME_LEN 97 #define MAX_HANDLE 0xFF #define MIN_HANDLE 0x01 #define INVALID_HANDLE 0x0 +#define INVALID_ID -1 + enum tcore_call_type { TCORE_CALL_TYPE_VOICE, TCORE_CALL_TYPE_VIDEO, @@ -139,7 +141,7 @@ struct tcore_call_operations { TReturn (*confirm_upgrade)(CoreObject *o, UserRequest *ur); /* IMS specific */ TReturn (*start_conference)(CoreObject *o, UserRequest *ur); TReturn (*modify_participants_in_conference)(CoreObject *o, UserRequest *ur); - TReturn (*set_ecc_status)(CoreObject* o, UserRequest* ur); + TReturn (*set_ecc_status)(CoreObject *o, UserRequest *ur); }; struct tcore_call_information_operations { diff --git a/include/co_sim.h b/include/co_sim.h index aebfbac..1006014 100644 --- a/include/co_sim.h +++ b/include/co_sim.h @@ -160,9 +160,6 @@ char *tcore_sim_encode_cfis(int *out_length, const struct tel_sim_cfis *p_cfis); gboolean tcore_sim_decode_cff(struct tel_sim_cphs_cf *cfis, unsigned char *p_in, int in_length); char *tcore_sim_encode_cff(const struct tel_sim_cphs_cf *cff, int in_length); gboolean tcore_sim_decode_csp(struct tel_sim_cphs_csp *p_csp, unsigned char *p_in, int in_length); -#if 0 -gboolean tcore_sim_encode_csp(unsigned char *p_out, int out_length, struct tel_sim_cphs_csp *p_csp); -#endif gboolean tcore_sim_decode_dynamic_flag(struct tel_sim_cphs_dflag *p_df, unsigned char *p_in, int in_length); gboolean tcore_sim_encode_dynamic_flag(char *p_out, int out_length, struct tel_sim_cphs_dflag *p_df); gboolean tcore_sim_decode_dynamic2_flag(struct tel_sim_cphs_dflag2 *p_d2f, unsigned char *p_in, int in_length); diff --git a/include/type/call.h b/include/type/call.h index 34fe44a..ac4fd31 100644 --- a/include/type/call.h +++ b/include/type/call.h @@ -26,8 +26,8 @@ __BEGIN_DECLS #include enum telephony_call_error { - CALL_ERROR_NONE, /**< Success */ - CALL_ERROR_ACCESSDISCARD, /**< Access discarded */ + CALL_ERROR_NONE, /**< Success */ + CALL_ERROR_ACCESSDISCARD, /**< Access discarded */ CALL_ERROR_BARR_BYOPERATOR, /**< Barred by operator */ CALL_ERROR_BEARERMODE_NOTIMPL, /**< Bearer mode not implemented */ CALL_ERROR_BEARERMODE_RESTRICTED, /**< Bearer mode restricted */ @@ -36,7 +36,7 @@ enum telephony_call_error { CALL_ERROR_BUSY, /**< (Network/Server) busy */ CALL_ERROR_CALLMETER_EXPIRED, /**< Call meter expired */ CALL_ERROR_CALLNO_ERROR, /**< Call number error */ - CALL_ERROR_CKTUNAVAIL, /**< Circuit channel unavailable */ //10 + CALL_ERROR_CKTUNAVAIL, /**< Circuit channel unavailable */ //10 CALL_ERROR_CONGESTION, /**< Congestion happened */ CALL_ERROR_NO_CIRCUIT_AVAIL, /**< Circuit not available */ CALL_ERROR_DESTIN_INCOMPAT, /**< Destination incompatibility */ @@ -46,8 +46,8 @@ enum telephony_call_error { CALL_ERROR_FACILITY_NOTSUBSCRIBED, /**< Facility not subscribed */ CALL_ERROR_INCOMINGCUGCALLS_BARRED, /**< Incoming CUG Calls barred */ CALL_ERROR_INVALNUM, /**< Invalid number */ - CALL_ERROR_MPTY_ERROR, /**< Multiparty error */ //20 - CALL_ERROR_NOANSWER, /**< No answer */ + CALL_ERROR_MPTY_ERROR, /**< Multiparty error */ //20 + CALL_ERROR_NOANSWER, /**< No answer */ CALL_ERROR_NONCUGMEMBER, /**< Non CUG member */ CALL_ERROR_NUMBERCHANGED, /**< Number changed */ CALL_ERROR_NUMBER_ERROR, /**< Number error */ @@ -56,7 +56,7 @@ enum telephony_call_error { CALL_ERROR_OUTOFORDER, /**< Out of order */ CALL_ERROR_PROTOCOL_ERROR, /**< Protocol error */ CALL_ERROR_QOSUNAVAIL, /**< QOS unavailable */ - CALL_ERROR_REJECT, /**< Rejected */ //30 + CALL_ERROR_REJECT, /**< Rejected */ //30 CALL_ERROR_REJ_FAIL, /**< Rejection failed */ CALL_ERROR_REJ_SRVC_NOT_AVL, /**< Rejection service not available */ CALL_ERROR_REJ_SAT_CALL_CTRL, /**< Rejection by SAT call control */ @@ -66,7 +66,7 @@ enum telephony_call_error { CALL_ERROR_SERVICE_NOTIMPL, /**< Service not implemented */ CALL_ERROR_SERVICE_UNAVAIL, /**< Service not available */ CALL_ERROR_MODIFY_SAME_BEARER, /**< Modify same bearer */ - CALL_ERROR_MODIFY_NOT_PERMITTED, /**< Modification not permitted */ //40 + CALL_ERROR_MODIFY_NOT_PERMITTED, /**< Modification not permitted */ //40 CALL_ERROR_HOLD_FAIL, /**< Call hold fail */ CALL_ERROR_TEMPFAILURE, /**< Temporary failure */ CALL_ERROR_WRONGNUM, /**< Wrong number */ @@ -76,7 +76,7 @@ enum telephony_call_error { CALL_ERROR_SSINCOMPATIBLESTATE, /**< SS incompatible state */ CALL_ERROR_SSERRSYNTAXERROR, /**< SS syntax error */ CALL_ERROR_SSPROTOCOLERROR, /**< Protocol error */ - CALL_ERROR_SSNEGATIVEPASSWORDCHECK, /**< Negative password check */ //50 + CALL_ERROR_SSNEGATIVEPASSWORDCHECK, /**< Negative password check */ //50 CALL_ERROR_SSSENTASPHASE1, /**< SS sent as phase1 message */ CALL_ERROR_SSERROR, /**< Supplementary service error */ CALL_ERROR_SS_USSD_BUSY, /**< Second USSD request will be rejected when already USSD transaction is ongoing. */ @@ -86,7 +86,7 @@ enum telephony_call_error { CALL_ERROR_UNKNOWN, /**< unknown no details available */ CALL_ERROR_INCOM_CALL, /**< terminated by incoming call */ CALL_ERROR_ALERT_STOP, /**< terminated by alert stop */ - CALL_ERROR_INTERCEPT, /**< voice call was dropped by interception */ //60 + CALL_ERROR_INTERCEPT, /**< voice call was dropped by interception */ //60 CALL_ERROR_REORDER, /**< voice call was dropped by reordering */ CALL_ERROR_CLIENT_END, /**< client ended the call */ CALL_ERROR_ACCESS_CLASS_BLOCKED, /**< access class blocked */ @@ -96,7 +96,7 @@ enum telephony_call_error { CALL_ERROR_PROTOCOLID_ERROR, /**< Protocol id error */ CALL_ERROR_CLASSNOTSUPPORTED, /**< Class not supported */ CALL_ERROR_DATACODING_ERROR, /**< Data coding error */ - CALL_ERROR_INVAL_MSG, /**< Invalid message */ //70 + CALL_ERROR_INVAL_MSG, /**< Invalid message */ //70 CALL_ERROR_CALL_BARRED, /**< Call barred */ CALL_ERROR_SIM_CALL_CONTROL_CHANGED_TO_SS, /**< Sim call control changed to SS */ CALL_ERROR_SIM_CALL_CONTROL_CHANGED_TO_CALL, /**< SIM Call control changed to call */ @@ -106,7 +106,7 @@ enum telephony_call_error { CALL_ERROR_LOWER_LAYER_FAILURE, /**< Lower layer error */ CALL_ERROR_ACCESS_REJECTED, /**< Access rejected */ CALL_ERROR_RESET_NOT_ALLOWED, /**< Reset not allowed */ - CALL_ERROR_EMERGENCY_CALL_NOT_ALLOWED, /**< Emergency call not allowed */ //80 + CALL_ERROR_EMERGENCY_CALL_NOT_ALLOWED, /**< Emergency call not allowed */ //80 CALL_ERROR_ACCESS_NOT_ALLOWED, /**< Access not allowed */ CALL_ERROR_RADIO_LINK_FAILURE, /**< Radio link failure */ CALL_ERROR_INVALID_IDENTITY, /**< Invalid identity */ @@ -116,7 +116,7 @@ enum telephony_call_error { CALL_ERROR_SERVICE_NOT_ALLOWED, /**< Service not allowed */ CALL_ERROR_SERVICE_NOT_AVAIL, /**< Service not available */ CALL_ERROR_SERVICE_NOT_WORKING, /**< Service not working */ - CALL_ERROR_CANNOT_IDENTIFY_CALL, /**< Cannot identify the call */ //90 + CALL_ERROR_CANNOT_IDENTIFY_CALL, /**< Cannot identify the call */ //90 CALL_ERROR_DEACTIVATION, /**< Deactivation */ CALL_ERROR_FATAL_ERROR, /**< Fatal error */ CALL_ERROR_SEND_DTMF_SUCCESS, /**< Sending DTMF Success */ @@ -630,7 +630,7 @@ enum telephony_call_ecc_status { #define MAX_ALPHA_INFO_LEN 64 #define MAX_CALL_CLI_NUM_LEN MAX_CALL_NUMBER_LEN -#define MAX_CALL_CNA_NAME_LEN 83 +#define MAX_CALL_CNA_NAME_LEN 97 #define MAX_CALL_DISPLAY_INFORMATION 182 @@ -659,7 +659,7 @@ struct telephony_call_rec_info { unsigned int handle; enum telephony_call_rec_type type; union { - char name[ MAX_ALPHA_INFO_LEN ]; + char name[ MAX_CALL_CNA_NAME_LEN ]; char number[ MAX_CALL_NUMBER_LEN ]; struct telephony_call_line_ctrl_info line_ctrl; } data; @@ -808,7 +808,7 @@ struct treq_call_modify_participans_in_conference { }; /* end of IMS specific */ -struct treq_call_set_ecc_status{ +struct treq_call_set_ecc_status { enum telephony_call_ecc_status status; }; diff --git a/include/type/request.h b/include/type/request.h index e816530..8dc1de3 100644 --- a/include/type/request.h +++ b/include/type/request.h @@ -79,15 +79,12 @@ enum tcore_request_command { TREQ_CALL_UPGRADE, TREQ_CALL_DOWNGRADE, TREQ_CALL_CONFIRM_UPGRADE, - TREQ_CALL_SET_ACTIVE_LINE, TREQ_CALL_GET_ACTIVE_LINE, TREQ_CALL_ACTIVATE_CCBS, TREQ_CALL_CUSTOM_SERVICE, - TREQ_CALL_START_CONFERENCE, TREQ_CALL_MODIFY_PARTICIPANTS_IN_CONFERENCE, - TREQ_CALL_SET_ECC_STATUS, TREQ_SS = TCORE_REQUEST | TCORE_TYPE_SS, @@ -144,7 +141,6 @@ enum tcore_request_command { TREQ_SIM_GET_ICON, TREQ_SIM_SET_POWERSTATE, TREQ_SIM_GET_GID, - TREQ_SIM_SET_CPHS_CSP_INFO, TREQ_SIM_GET_CPHS_CSP_INFO, TREQ_SIM_GET_IMPI, TREQ_SIM_GET_IMPU, diff --git a/include/type/response.h b/include/type/response.h index aef3d8f..b2f6649 100644 --- a/include/type/response.h +++ b/include/type/response.h @@ -137,7 +137,6 @@ enum tcore_response_command { TRESP_SIM_SET_POWERSTATE, TRESP_SIM_GET_GID, TRESP_SIM_GET_CPHS_CSP_INFO, - TRESP_SIM_SET_CPHS_CSP_INFO, TRESP_SIM_GET_IMPI, TRESP_SIM_GET_IMPU, TRESP_SIM_GET_DOMAIN, diff --git a/src/core_object/co_call.c b/src/core_object/co_call.c index 33c0ce0..f324f0d 100644 --- a/src/core_object/co_call.c +++ b/src/core_object/co_call.c @@ -493,7 +493,7 @@ CallObject *tcore_call_object_new(CoreObject *o) if (co == NULL) return NULL; - co->handle = __assign_handle(o); + co->handle = __assign_handle(o); if (INVALID_HANDLE == co->handle) { err("valid handle not available. call object creation failed"); @@ -519,6 +519,8 @@ gboolean tcore_call_object_free(CoreObject *o, CallObject *co) tcore_check_null_ret_err("co", co, FALSE); po->cobjs = g_slist_remove(po->cobjs, co); + + dbg("co_obj with handle [%d] freed", co->handle); g_free(co); return TRUE; diff --git a/src/core_object/co_context.c b/src/core_object/co_context.c index 7686f52..2ec21ae 100644 --- a/src/core_object/co_context.c +++ b/src/core_object/co_context.c @@ -188,7 +188,7 @@ TReturn tcore_context_set_state(CoreObject *o, enum co_context_state state) return TCORE_RETURN_SUCCESS; } -enum co_context_state tcore_context_get_state(CoreObject *o) +enum co_context_state tcore_context_get_state(CoreObject *o) { struct private_object_data *po = NULL; diff --git a/src/core_object/co_network.c b/src/core_object/co_network.c index 6064d2e..4b5f2db 100644 --- a/src/core_object/co_network.c +++ b/src/core_object/co_network.c @@ -1145,7 +1145,7 @@ struct tcore_network_operator_info * tcore_network_operator_info_find(CoreObject *co, const char *mcc, const char *mnc) { struct private_object_data *po = NULL; - struct tcore_network_operator_info *data; + struct tcore_network_operator_info *data = NULL; char plmn[NETWORK_MAX_PLMN_LEN+1]; int mcc_index, mnc_index; diff --git a/src/core_object/co_sat.c b/src/core_object/co_sat.c index 2d5017e..ee6115b 100644 --- a/src/core_object/co_sat.c +++ b/src/core_object/co_sat.c @@ -222,7 +222,9 @@ static gboolean _check_file_for_refresh(enum tel_sim_file_id file_id) return TRUE; } } - } else if ((file_id & 0x6F00) == 0x6F00) { + } + + if ((file_id & 0x6F00) == 0x6F00) { dbg("[SAT] SAT PARSER - ADF_USIM EF=0x%04x", file_id); for (i = 0; i < 29; i++) { if (file_id == ef_under_df[i]) { @@ -1381,14 +1383,14 @@ static enum tcore_sat_result _sat_decode_file_list_tlv(unsigned char *tlv_str, i } /* length */ - len_of_len = _get_length_filed_size(src_data[temp_index]); + len_of_len = _get_length_filed_size(src_data[temp_index+1]); if (!len_of_len) { err("[SAT] parser: invalid length."); return TCORE_SAT_COMMAND_NOT_UNDERSTOOD; } - file_list_len = src_data[temp_index + len_of_len-1]; temp_index += len_of_len; + file_list_len = src_data[temp_index]; if ((temp_index + file_list_len) > tlv_len) { dbg("[SAT] SAT PARSER - incorrect cmd len, expected len = %d, orig_len=%d", @@ -1396,6 +1398,7 @@ static enum tcore_sat_result _sat_decode_file_list_tlv(unsigned char *tlv_str, i return TCORE_SAT_COMMAND_NOT_UNDERSTOOD; } + temp_index++; tmp_cnt = src_data[temp_index++]; file_list_obj->file_count = 0; memset(file_list_obj->file_id, 0, SAT_FILE_ID_LIST_MAX_COUNT); @@ -1432,7 +1435,7 @@ static enum tcore_sat_result _sat_decode_file_list_tlv(unsigned char *tlv_str, i /* USIM DIRECTORY FILE (DIR) 0x7FFF */ temp_index += 2; if (src_data[temp_index] == 0x6F) { - ef = 0x6A << 8; + ef = src_data[temp_index] << 8; temp_index++; ef = ef | src_data[temp_index]; @@ -2102,7 +2105,7 @@ static enum tcore_sat_result _sat_decode_bearer_description_tlv(unsigned char *t return TCORE_SAT_SUCCESS; } - if ((src_data[temp_index] & 0x7F) == SATK_BEARER_DISCRIPTION_TAG) { + if ((src_data[temp_index] & 0x7F) == (SATK_BEARER_DISCRIPTION_TAG & 0x7F)) { dbg("find bearer description tag temp_index(%d)", temp_index); temp_index++; break; @@ -2174,7 +2177,7 @@ static enum tcore_sat_result _sat_decode_channel_data_tlv(unsigned char *tlv_str /* tag */ temp_index = curr_offset; src_data = &tlv_str[0]; - if ((src_data[temp_index++] & 0x7F) != SATK_CHANNEL_DATA_TAG) { + if ((src_data[temp_index++] & 0x7F) != (SATK_CHANNEL_DATA_TAG & 0x7F)) { dbg("[SAT] SAT PARSER - tag not found.=%d", src_data[temp_index]); return TCORE_SAT_COMMAND_NOT_UNDERSTOOD; } @@ -2217,7 +2220,7 @@ static enum tcore_sat_result _sat_decode_channel_data_length_tlv(unsigned char * /* tag */ temp_index = curr_offset; src_data = &tlv_str[0]; - if ((src_data[temp_index++] & 0x7F) != SATK_CHANNEL_DATA_LEN_TAG) { + if ((src_data[temp_index++] & 0x7F) != (SATK_CHANNEL_DATA_LEN_TAG & 0x7F)) { dbg("[SAT] SAT PARSER - channel data tag missing."); return TCORE_SAT_COMMAND_NOT_UNDERSTOOD; /* Send TR */ } @@ -2254,7 +2257,7 @@ static enum tcore_sat_result _sat_decode_buffer_size_tlv(unsigned char *tlv_str, /* tag */ temp_index = curr_offset; src_data = &tlv_str[0]; - if ((src_data[temp_index++] & 0x7F) != SATK_BUFFER_SIZE_TAG) { + if ((src_data[temp_index++] & 0x7F) != (SATK_BUFFER_SIZE_TAG & 0x7F)) { dbg("[SAT] SAT PARSER - buffer size tag missing."); return TCORE_SAT_COMMAND_NOT_UNDERSTOOD; /* Send TR */ } @@ -7558,6 +7561,14 @@ static int _sat_encode_open_channel(const struct tel_sat_tr_open_channel_tlv *sr dst_tr[temp_index++] = 2; dst_tr[temp_index++] = src_tr->result_type; dst_tr[temp_index++] = src_tr->bip_problem_type; + + /* set bearer description */ + encoded_len = _sat_encode_bearer_desc_tlv(&(src_tr->bearer_desc), dst_tr, temp_index); + temp_index += encoded_len; + + /* set buffer size */ + encoded_len = _sat_encode_buffer_size_tlv(&(src_tr->buffer_size), dst_tr, temp_index); + temp_index += encoded_len; break; default: diff --git a/src/core_object/co_sim.c b/src/core_object/co_sim.c index 4c7b7df..d6f2871 100644 --- a/src/core_object/co_sim.c +++ b/src/core_object/co_sim.c @@ -237,7 +237,6 @@ static TReturn _dispatcher(CoreObject *o, UserRequest *ur, enum tcore_ops_type o case TREQ_SIM_SET_CALLFORWARDING: case TREQ_SIM_SET_MESSAGEWAITING: case TREQ_SIM_SET_MAILBOX: - case TREQ_SIM_SET_CPHS_CSP_INFO: tcore_check_null_ret_err("ops->update_file", ops->update_file, TCORE_RETURN_ENOSYS); @@ -2242,118 +2241,6 @@ gboolean tcore_sim_decode_csp(struct tel_sim_cphs_csp *p_csp, unsigned char *p_i return TRUE; } -#if 0 -gboolean tcore_sim_encode_csp(unsigned char *p_out, int out_length, struct tel_sim_cphs_csp *p_csp) -{ - unsigned char i, j = 0; - - if (out_length == 0) - return FALSE; - - memset((void *) p_out, 0xFF, out_length); - - /* - * current telephony supports 22 byte cphs-csp data. - * 18 byte is mandatory, the other is optional. - */ - for (i = 0, j = 0; - i < SIM_CPHS_CSP_LEN_MAX && j < SIM_CPHS_CSP_ENTRY_CNT_MAX; - i++, j++) { - p_out[i] = (unsigned char) p_csp->service_profile_entry[j].customer_service_group; - switch (p_out[i]) { - case 0x01: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_forwarding_unconditional) << 7) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_forwarding_on_user_busy) << 6) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_forwarding_on_no_reply) << 5) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_forwarding_on_user_not_reachable) << 4) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_offering.b_call_transfer) << 3); - break; - - case 0x02: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_all_outgoing_calls) << 7) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_outgoing_international_calls) << 6) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_outgoing_international_calls_except_hplmn) << 5) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_all_incoming_calls_roaming_outside_hplmn) << 4) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_restriction.b_barring_of_incoming_calls_when_roaming) << 3); - break; - - case 0x03: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_multi_party_service) << 7) - + (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_closed_user_group) << 6) - + (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_advice_of_charge) << 5) - + (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_preferential_closed_user_group) << 4) - + (((unsigned char) p_csp->service_profile_entry[j].service.other_supp_services.b_closed_user_group_outgoing_access) << 3); - break; - - case 0x04: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.call_complete.b_call_hold) << 7) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_complete.b_call_waiting) << 6) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_complete.b_completion_of_call_to_busy_subscriber) << 5) - + (((unsigned char) p_csp->service_profile_entry[j].service.call_complete.b_user_user_signalling) << 4); - break; - - case 0x05: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_mobile_terminated) << 7) - + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_mobile_originated) << 6) - + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_cell_broadcast) << 5) - + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_reply_path) << 4) - + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_delivery_conf) << 3) - + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_protocol_identifier) << 2) - + (((unsigned char) p_csp->service_profile_entry[j].service.teleservices.b_short_message_validity_period) << 1); - break; - - case 0x06: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.cphs_teleservices.b_alternative_line_service) << 7); - break; - - case 0x07: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.cphs_features.b_string_service_table) << 7); - break; - - case 0x08: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_calling_line_identification_present) << 7) - + (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_connected_line_identification_restrict) << 5) - + (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_connected_line_identification_present) << 4) - + (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_malicious_call_identifier) << 3) - + (((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_calling_line_identification_send) << 1) - + ((unsigned char) p_csp->service_profile_entry[j].service.number_identifiers.b_calling_line_identification_block); - break; - - case 0x09: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_gprs) << 7) - + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_high_speed_csd) << 6) - + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_voice_group_call) << 5) - + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_voice_broadcast_service) << 4) - + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_multiple_subscriber_profile) << 3) - + (((unsigned char) p_csp->service_profile_entry[j].service.phase_services.b_menu_for_multiple_band) << 2); - break; - - case 0xC0: - p_out[++i] = (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_manual_selection) << 7) - + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_voice_mail) << 6) - + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_mo_sms_and_paging) << 5) - + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_mo_sms_with_emial_type) << 4) - + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_fax_calls) << 3) - + (((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_data_calls) << 2) - + ((unsigned char) p_csp->service_profile_entry[j].service.value_added_services.b_restrict_menu_for_change_language); - break; - - case 0xD5: - if (p_csp->service_profile_entry[j].service.information_numbers.b_information_numbers) - p_out[++i] = 0xFF; - else - p_out[++i] = 0x00; - break; - - default: - break; - } - } - - return TRUE; -} -#endif - gboolean tcore_sim_decode_mwis(struct tel_sim_mw *pMwis, unsigned char *p_in, int in_length) { int i; @@ -4412,7 +4299,7 @@ enum tcore_return tcore_sim_delete_isim_impi(CoreObject *o) gboolean tcore_sim_is_jio_sim(CoreObject *co_sim) { struct tel_sim_imsi *imsi = NULL; - int index, count; + int index_s, count; const char *jio_plmn_list[] = { /* RJIL */ @@ -4428,8 +4315,8 @@ gboolean tcore_sim_is_jio_sim(CoreObject *co_sim) } count = sizeof(jio_plmn_list)/sizeof(jio_plmn_list[0]); - for (index = 0; index < count; index++) { - if (g_strcmp0(imsi->plmn, jio_plmn_list[index]) == 0) { + for (index_s = 0; index_s < count; index_s++) { + if (g_strcmp0(imsi->plmn, jio_plmn_list[index_s]) == 0) { dbg("Jio SIM - PLMN: [%s]", imsi->plmn); g_free(imsi); return TRUE; -- 2.7.4