} ModemBoard;
ModemBoard * manager_core_get_modem_board(Manager *manager, TcorePlugin *modem_plugin);
+ModemBoard * manager_core_get_modem_board_by_plugin(TcorePlugin *modem_plugin);
ModemBoardIndex manager_core_get_modem_board_index(TcorePlugin *modem_plugin);
void manager_core_create_modem_board(TcorePlugin *manager_plugin, TcorePlugin *modem_plugin);
};
gboolean manager_modem_initialize_private_info(ModemBoard *mb);
-gboolean manager_modem_clear_private_info(ModemBoard *mb);
-
+void manager_modem_clear_private_info(ModemBoard *mb);
enum tcore_manager_return manager_modem_process_request(Server *server,
UserRequest *ur);
extern "C" {
#endif
-enum tcore_manager_return manager_phonebook_process_request(Server* server, UserRequest* ur);
+enum tcore_manager_return manager_phonebook_process_request(Server *server, UserRequest *ur);
#ifdef __cplusplus
}
#endif
gboolean manager_sim_initialize_private_info(ModemBoard *mb);
-void set_nw_dds_ds_on_boot(Manager *manager);
+void manager_sim_process_modem_error(CoreObject *co_modem);
+
+void set_nw_dds_ds_on_boot(Manager *manager);
#ifdef __cplusplus
}
enum tcore_manager_return manager_sms_process_notification(Manager *manager,
CoreObject *source, enum tcore_notification_command command,
unsigned int data_len, void *data);
-
#ifdef __cplusplus
}
#endif
TcorePlugin *manager_util_get_modem_plugin(Server *server, UserRequest *ur);
TcorePlugin *manager_util_get_modem_plugin_by_subs_type(Server *server,
enum telephony_subscription_type subs_type);
-CoreObject * manager_util_get_core_object(Server *server, UserRequest *ur, unsigned int type);
+CoreObject *manager_util_get_core_object(Server *server, UserRequest *ur, unsigned int type);
gboolean manager_util_is_ims_registered(Server *server, UserRequest *ur, guint feature_type);
enum telephony_network_ims_reg_network_type manager_util_get_ims_reg_network_type(Server *server, UserRequest *ur);
unsigned int data_len, const void *data, UserRequestResponseHook resp_hook, void *user_data);
TcorePlugin * manager_util_get_other_subs_plugin(TcorePlugin *plugin);
+gint manager_util_get_modem_count(Manager *manager);
void manager_set_deregister_timer(Manager *manager, guint timer_id);
void manager_clear_deregister_timer(Manager *manager);
guint manager_get_deregister_timer(Manager *manager);
%define major 0
%define minor 1
-%define patchlevel 17
+%define patchlevel 18
Name: tel-plugin-manager
Version: %{major}.%{minor}.%{patchlevel}
if (resp_data->result == TCORE_RETURN_SUCCESS) {
UserRequest *ur_cpy;
- struct tnoti_call_status_dialing noti_data = {0,};
+ struct tnoti_call_status_dialing noti_data = { 0, };
Manager *manager = tcore_server_ref_manager(server);
TcorePlugin *manager_plugin = tcore_manager_get_plugin(manager);
PrivateData *priv_data = tcore_plugin_ref_user_data(manager_plugin);
case TREQ_CALL_SET_PREFERRED_VOICE_SUBSCRIPTION: {
dbg("adding hook to update DS to db");
- /* Set Response hook */
+ /* Set Response hook */
tcore_user_request_set_response_hook(ur, manager_network_resp_hook_set_ds, server);
}
break;
/*
* Check if Network Search is in progress and cancel the same
*/
- if (ret != TCORE_MANAGER_RETURN_STOP) {
+ if (ret != TCORE_MANAGER_RETURN_STOP) {
info("Cancel any on-going Network Search");
manager_network_cancel_network_search(manager, tcore_plugin_ref_server(plugin_subs));
}
call_handle = idle_noti->handle;
cpi = mb->call_info;
- /* Unsetting is_dial_initiated flag on rececipt of dial notification */
+ /* Unsetting is_dial_initiated flag on rececipt of idle notification */
priv_data->is_dial_initiated = FALSE;
if ((cpi->rat_query_cache.call_handle == call_handle) &&
#include "manager_queue.h"
#include "manager_network.h"
#include "manager_sim.h"
-#include "internal/manager_internal.h"
#include "manager_call.h"
#include "manager_modem.h"
+#include "internal/manager_internal.h"
static void __create_modem_board_sub_modules(ModemBoard *mb)
{
return mb;
}
}
+ warn("Cannot find modem board");
return NULL;
}
+ModemBoard *manager_core_get_modem_board_by_plugin(TcorePlugin *modem_plugin)
+{
+ Server *server = tcore_plugin_ref_server(modem_plugin);
+ Manager *manager = tcore_server_ref_manager(server);
+
+ return manager_core_get_modem_board(manager, modem_plugin);
+}
+
ModemBoardIndex manager_core_get_modem_board_index(TcorePlugin *modem_plugin)
{
const char *cp_name = tcore_server_get_cp_name_by_plugin(modem_plugin);
co_call = co_call_other;
plugin_subs = plugin_subs_other;
}
- } else{
+ } else {
priv_data->is_end_all_initiated = FALSE;
}
tcore_user_request_set_command(new_ur, TREQ_CALL_END);
tcore_user_request_set_data(new_ur, sizeof(struct treq_call_end), &req);
if (TCORE_RETURN_SUCCESS != tcore_server_dispatch_request(server, new_ur)) {
- err("END_ALL request failed!!r");
+ err("END_ALL request failed!!");
tcore_user_request_free(new_ur);
} else {
info("queueing flight mode request");
}
return TCORE_MANAGER_RETURN_CONTINUE;
-
}
+
enum tcore_manager_return manager_modem_process_request(Server *server,
UserRequest *ur)
{
return TRUE;
}
-gboolean manager_modem_clear_private_info(ModemBoard *mb)
+void manager_modem_clear_private_info(ModemBoard *mb)
{
dbg("enter");
if (G_UNLIKELY(!mb || !mb->modem_info)) {
err("Invalid data");
- return FALSE;
+ return;
}
if (mb->index == MANAGER_MODEM_BOARD_INDEX_0) {
mb->modem_info = NULL;
dbg("done");
-
- return TRUE;
}
enum tcore_manager_return manager_modem_process_notification(Manager *manager,
const struct tnoti_modem_power *modem_power = data;
switch (modem_power->state) {
- case MODEM_STATE_ERROR:
+ case MODEM_STATE_ERROR: {
dbg("Modem RESET happened");
+
manager_network_process_modem_error(source);
manager_call_process_modem_error(source);
+ manager_sim_process_modem_error(source);
+
priv_data->fm_processing_state = MANAGER_FLIGHT_PROCESSING_NONE;
+ }
break;
case MODEM_STATE_ONLINE: {
}
}
}
- break;
+ break;
case MODEM_STATE_OFFLINE: {
dbg("MODEM_STATE has been changed to OFFLINE");
}
}
}
- break;
+ break;
default:
break;
set_nw_dds_ds_on_boot(manager);
#endif
}
- break;
+ break;
default:
break;
case TCORE_TYPE_CALL:
mret = manager_call_process_notification(manager,
source, command, data_len, data);
- break;
+ break;
case TCORE_TYPE_MODEM:
mret = manager_modem_process_notification(manager,
source, command, data_len, data);
- break;
+ break;
case TCORE_TYPE_NETWORK:
mret = manager_network_process_notification(manager,
source, command, data_len, data);
- break;
+ break;
case TCORE_TYPE_SIM:
mret = manager_sim_process_notification(manager,
source, command, data_len, data);
- break;
+ break;
case TCORE_TYPE_SERVER:
mret = manager_server_process_notification(manager,
source, command, data_len, data);
- break;
+ break;
case TCORE_TYPE_SMS:
mret = manager_sms_process_notification(manager,
source, command, data_len, data);
- break;
+ break;
default:
return TCORE_MANAGER_RETURN_CONTINUE;
}
if (mret == TCORE_MANAGER_RETURN_STOP)
- dbg("module:[0x%x] ret:[STOP]");
+ dbg("module:[0x%x] ret:[STOP]", module);
else if (mret == TCORE_MANAGER_RETURN_CONTINUE)
- dbg("module:[0x%x] ret:[CONTINUE]");
+ dbg("module:[0x%x] ret:[CONTINUE], module");
else if (mret == TCORE_MANAGER_RETURN_CONTINUE_IMS)
- dbg("module:[0x%x] ret:[IMS]");
+ dbg("module:[0x%x] ret:[IMS]", module);
else
- dbg("module:[0x%x] ret:[FAIL]");
+ err("module:[0x%x] ret:[FAIL]", module);
return mret;
}
}
if (TRESP_PHONEBOOK_UPDATERECORD == command) {
- struct tresp_phonebook_update_record * update_record_resp = (struct tresp_phonebook_update_record *)data;
+ struct tresp_phonebook_update_record *update_record_resp = (struct tresp_phonebook_update_record *)data;
if (update_record_resp && PB_SUCCESS == update_record_resp->result) {
struct treq_phonebook_update_record *update_record_req = (struct treq_phonebook_update_record *)tcore_user_request_ref_data(ur, NULL);
g_hash_table_iter_init(&iter, mb->fdn_contacts);
while (g_hash_table_iter_next(&iter, &key, &value) == TRUE) {
- index = atoi((const char *) value);
+ index = atoi((const char *)value);
if (index == delete_record_req->index) { /* valid index of FDN record deleted*/
info("Deleted record index found, remove it from cache : index[%d] number[%s]", index, key);
g_hash_table_remove(mb->fdn_contacts, key);
}
}
-enum tcore_manager_return manager_phonebook_process_request(Server* server, UserRequest* ur)
+enum tcore_manager_return manager_phonebook_process_request(Server *server, UserRequest *ur)
{
enum tcore_request_command command = tcore_user_request_get_command(ur);
enum tcore_manager_return manager_ret = TCORE_MANAGER_RETURN_CONTINUE;
tcore_user_request_set_response_hook(ur, __on_hook_change_pb_record, server);
}
}
- break;
+ break;
+
case TREQ_PHONEBOOK_DELETERECORD: {
struct treq_phonebook_delete_record *delete_record_req = (struct treq_phonebook_delete_record *)tcore_user_request_ref_data(ur, NULL);
tcore_user_request_set_response_hook(ur, __on_hook_change_pb_record, server);
}
}
+ break;
+
/*
* All other requests, would be routed to CP.
*/
default:
- break;
+ break;
}
return manager_ret;
case TCORE_TYPE_SIM:
mret = manager_sim_process_request(server, ur);
- break;
+ break;
+
case TCORE_TYPE_PHONEBOOK:
mret = manager_phonebook_process_request(server, ur);
- break;
+ break;
+
/*
* All other modules, would be routed to CP.
* Need to handle other modules as well
return TCORE_MANAGER_RETURN_CONTINUE;
}
- dbg("Command:[0x%x] mret:[%s]", command,
+ if (mret == TCORE_MANAGER_RETURN_CONTINUE)
+ return mret;
+
+ info("Command:[0x%x] mret:[%s]", command,
(mret == TCORE_MANAGER_RETURN_FAILURE ? "FALIURE" :
(mret == TCORE_MANAGER_RETURN_STOP ? "STOP" :
- (mret == TCORE_MANAGER_RETURN_CONTINUE ? "TO MODEM" :
(mret == TCORE_MANAGER_RETURN_CONTINUE_IMS ? "TO IMS" :
- "UNKNOWN RESULT")))));
+ "UNKNOWN"))));
return mret;
}
void set_nw_dds_ds_on_boot(Manager *manager)
{
+ if (manager_util_get_modem_count(manager) <= 1)
+ return;
+
if (__are_both_sims_ready_after_boot(manager)) {
Server *server = tcore_plugin_ref_server(tcore_manager_get_plugin(manager));
GSList *modem_plugin_list = tcore_server_get_modem_plugin_list(server);
g_slist_free(modem_plugin_list);
}
}
+
+void manager_sim_process_modem_error(CoreObject *co_modem)
+{
+ TcorePlugin *plugin = tcore_object_ref_plugin(co_modem);
+ ModemBoard *mb = manager_core_get_modem_board_by_plugin(plugin);
+
+ if (mb && mb->sim_info) {
+ info("Initialize first boot info");
+ mb->sim_info->is_first_boot = TRUE;
+ }
+}
+
enum tcore_manager_return manager_sim_process_notification(Manager *manager,
CoreObject *source, enum tcore_notification_command command,
unsigned int data_len, void *data)
/** BER-TLV tag for SMS-PP download. TS 31.111 section 9.1. */
#define BER_SMS_PP_DOWNLOAD_TAG 0xd1
-#define COMPREHENSION_TLV_TAG_DEVICE_IDENTITIES (0x80|0x02)
+#define COMPREHENSION_TLV_TAG_DEVICE_IDENTITIES (0x80 | 0x02)
#define COMPREHENSION_TLV_TAG_ADDRESS 0x06
-#define COMPREHENSION_TLV_TAG_SMS_TPDU (0x80|0x0b)
+#define COMPREHENSION_TLV_TAG_SMS_TPDU (0x80 | 0x0b)
struct manager_sms_decoded_param {
unsigned char dcs;
unsigned int data_len, const void *data, void *user_data)
{
const struct tresp_sat_envelop_data *resp = data;
-
if (G_UNLIKELY(!data))
return;
envelope.envelop_data.event_download.sms_pp.data[index++] = COMPREHENSION_TLV_TAG_ADDRESS;
envelope.envelop_data.event_download.sms_pp.data[index++] = sca_len;
envelope.envelop_data.event_download.sms_pp.data[index++] = ton;
- memcpy(&envelope.envelop_data.event_download.sms_pp.data[index], sca, sca_len-1);
- index += sca_len-1;
+ memcpy(&envelope.envelop_data.event_download.sms_pp.data[index], sca, sca_len - 1);
+ index += sca_len - 1;
}
/* SMS TPDU TLV. Length is assumed to be < 256 bytes. */
ton = 0x80 + (resp->scaAddress.typeOfNum << 4) + resp->scaAddress.numPlanId;
/* Send ENVELOPE_CMD to SIM */
- __send_smspp_envelop_cmd(rp_data->modem_plugin, rp_data->msg_data, resp->scaAddress.dialNumLen+1, (unsigned char *)resp->scaAddress.diallingNum, ton, rp_data->dcs, rp_data->pid);
+ __send_smspp_envelop_cmd(rp_data->modem_plugin, rp_data->msg_data, resp->scaAddress.dialNumLen + 1, (unsigned char *)resp->scaAddress.diallingNum, ton, rp_data->dcs, rp_data->pid);
} else {
warn("Fail to Get SCA address(0x%x)", resp->result);
}
return TCORE_MANAGER_RETURN_CONTINUE;
}
-
enum tcore_manager_return manager_sms_process_notification(Manager *manager,
CoreObject *source, enum tcore_notification_command command,
unsigned int data_len, void *data)
#include <stdio.h>
#include <glib.h>
+
#include <tcore.h>
#include <server.h>
#include <manager.h>
TcorePlugin *other_plugin = NULL;
Server *s = tcore_plugin_ref_server(plugin);
+ if (tcore_server_get_modems_count(s) <= 1)
+ return NULL;
+
modem_list = tcore_server_get_modem_plugin_list(s);
if (!modem_list)
return NULL;
g_slist_free(modem_list);
if (is_found == TRUE) {
- err("Current:[%p] Other:[%p]", plugin, other_plugin);
+ info("Current:[%p] Other:[%p]", plugin, other_plugin);
return other_plugin;
} else {
err("other_sub_plugin not found.");
}
}
+gint manager_util_get_modem_count(Manager *manager)
+{
+ TcorePlugin *plugin = tcore_manager_get_plugin(manager);
+ Server *s = tcore_plugin_ref_server(plugin);
+ if (G_UNLIKELY(!s))
+ return 0;
+
+ return tcore_server_get_modems_count(s);
+}
+
gboolean manager_deregister_ims_timeout(gpointer user_data)
{
Manager *manager = user_data;
Manager *manager = tcore_server_ref_manager(server);
enum tcore_manager_return manager_ret = TCORE_MANAGER_RETURN_CONTINUE;
enum tcore_request_command command = tcore_user_request_get_command(ur);
-
int deregister_timeout = MANAGER_IMS_DEREGISTER_REQUEST_TIMEOUT;
request_present = manager_queue_probe_command(manager,
if (manager_get_deregister_timer(manager) != 0) {
/* Already requested for deregistration*/
dbg("Deregistration in progress, enqueue the request");
- /* Enqueue plmn selection mode request, process it once we get the de-registartion notification */
+
+ /*
+ * Enqueue plmn selection mode request,
+ * process it once we get the
+ * de-registartion notification
+ */
manager_queue_enqueue(manager, ur);
return TCORE_MANAGER_RETURN_STOP;
}
LacNetnameInfo *lac_netname_info;
};
-void manager_network_process_sim_refreshed(CoreObject *co_sim);
+void manager_network_process_sim_refreshed(CoreObject *co_sim);
void manager_network_get_sim_network_name(CoreObject *co_sim);
void manager_network_apply_operator_name_rule(const char *plmn, char **name_delta, char **name_long, char **name_short);
void manager_network_load_spn_override_info(NetworkPrivateInfo *npi);