static void _request_fail(UserRequest *ur, int cmd, int resp_len, void *resp)
{
tcore_user_request_send_response(ur, cmd, resp_len, resp);
- tcore_user_request_free(ur);
+ tcore_user_request_unref(ur);
}
gboolean scomm_service_request_network(unsigned int ch_id, Communicator *c, TcorePlugin *plugin,
sipc_util_marshal_object_destory(out_obj);
if (result == FALSE) {
- tcore_user_request_free(ur);
+ tcore_user_request_unref(ur);
return FALSE;
}
const struct tresp_network_set_power_on_attach *resp_set_power_on_attach = data;
const struct tresp_network_get_power_on_attach *resp_get_power_on_attach = data;
const struct tresp_network_set_cancel_manual_search *resp_set_cancel_manual_search = data;
+ const struct tresp_network_get_serving_network *resp_get_serving_network = data;
int ret = 0;
int i = 0;
SIPC_MARSHAL_DATA_INT_TYPE);
dbg("count = %d", resp_network_search->list_count);
- entry_obj = sipc_util_marshal_object_create();
for (i = 0; i < resp_network_search->list_count; i++) {
- sipc_util_marshal_object_add_data(entry_obj, "plmn", resp_network_search->list[0].plmn,
+ entry_obj = sipc_util_marshal_object_create();
+ sipc_util_marshal_object_add_data(entry_obj, "plmn", resp_network_search->list[i].plmn,
SIPC_MARSHAL_DATA_STRING_TYPE);
- sipc_util_marshal_object_add_data(entry_obj, "status", &resp_network_search->list[0].status,
+ sipc_util_marshal_object_add_data(entry_obj, "status", &resp_network_search->list[i].status,
SIPC_MARSHAL_DATA_INT_TYPE);
- sipc_util_marshal_object_add_data(entry_obj, "act", &resp_network_search->list[0].act,
+ sipc_util_marshal_object_add_data(entry_obj, "act", &resp_network_search->list[i].act,
SIPC_MARSHAL_DATA_INT_TYPE);
snprintf(entry_key, 10, "%d", i);
sipc_util_marshal_object_add_data(out_obj, entry_key, entry_obj, SIPC_MARSHAL_DATA_OBJECT_TYPE);
dbg(
- "key=%s, plmn=%s, status=%d, act=%d",
- entry_key, resp_network_search->list[0].plmn, resp_network_search->list[0].status, resp_network_search->list[0].act);
+ "entry=%p, key=%s, plmn=%s, status=%d, act=%d",
+ entry_obj,
+ entry_key, resp_network_search->list[i].plmn, resp_network_search->list[i].status, resp_network_search->list[i].act);
}
break;
break;
case TRESP_NETWORK_GET_PLMN_SELECTION_MODE:
- sipc_util_marshal_object_add_data(out_obj, "mode", &resp_get_plmn_selection_mode->mode,
- SIPC_MARSHAL_DATA_INT_TYPE);
+ switch (resp_get_plmn_selection_mode->mode) {
+ case NETWORK_SELECT_MODE_GSM_MANUAL:
+ sipc_util_marshal_object_add_data(out_obj, "mode", "manual", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
+ case NETWORK_SELECT_MODE_CDMA:
+ sipc_util_marshal_object_add_data(out_obj, "mode", "cdma", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
+ case NETWORK_SELECT_MODE_GLOBAL_AUTOMATIC:
+ default:
+ sipc_util_marshal_object_add_data(out_obj, "mode", "automatic", SIPC_MARSHAL_DATA_STRING_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "mode", "automatic", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ }
break;
case TRESP_NETWORK_SET_SERVICE_DOMAIN:
break;
case TRESP_NETWORK_GET_SERVICE_DOMAIN:
- sipc_util_marshal_object_add_data(out_obj, "domain", &resp_get_service_domain->domain,
- SIPC_MARSHAL_DATA_INT_TYPE);
+ switch (resp_get_service_domain->domain) {
+ case NETWORK_SERVICE_DOMAIN_CS:
+ sipc_util_marshal_object_add_data(out_obj, "domain", "circuit", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
+ case NETWORK_SERVICE_DOMAIN_PS:
+ sipc_util_marshal_object_add_data(out_obj, "domain", "packet", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
+ case NETWORK_SERVICE_DOMAIN_COMBINED:
+ default:
+ sipc_util_marshal_object_add_data(out_obj, "domain", "combined", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ }
break;
case TRESP_NETWORK_SET_BAND:
case TRESP_NETWORK_GET_BAND:
sipc_util_marshal_object_add_data(out_obj, "band", &resp_get_band->band, SIPC_MARSHAL_DATA_INT_TYPE);
+ if (resp_get_band->mode == NETWORK_BAND_MODE_ONLY) {
+ sipc_util_marshal_object_add_data(out_obj, "mode", "only", SIPC_MARSHAL_DATA_STRING_TYPE);
+ }
+ else if (resp_get_band->mode == NETWORK_BAND_MODE_PREFERRED) {
+ sipc_util_marshal_object_add_data(out_obj, "mode", "preferred", SIPC_MARSHAL_DATA_STRING_TYPE);
+ }
break;
case TRESP_NETWORK_SET_PREFERRED_PLMN:
sipc_util_marshal_object_add_data(out_obj, "count", &resp_get_preferred_plmn->list_count,
SIPC_MARSHAL_DATA_INT_TYPE);
- entry_obj = sipc_util_marshal_object_create();
for (i = 0; i < resp_network_search->list_count; i++) {
- sipc_util_marshal_object_add_data(entry_obj, "plmn", resp_get_preferred_plmn->list[0].plmn,
+ entry_obj = sipc_util_marshal_object_create();
+ sipc_util_marshal_object_add_data(entry_obj, "plmn", resp_get_preferred_plmn->list[i].plmn,
SIPC_MARSHAL_DATA_STRING_TYPE);
- sipc_util_marshal_object_add_data(entry_obj, "ef_index", &resp_get_preferred_plmn->list[0].ef_index,
+ sipc_util_marshal_object_add_data(entry_obj, "ef_index", &resp_get_preferred_plmn->list[i].ef_index,
SIPC_MARSHAL_DATA_INT_TYPE);
- sipc_util_marshal_object_add_data(entry_obj, "act", &resp_get_preferred_plmn->list[0].act,
+ sipc_util_marshal_object_add_data(entry_obj, "act", &resp_get_preferred_plmn->list[i].act,
SIPC_MARSHAL_DATA_INT_TYPE);
snprintf(entry_key, 10, "%d", i);
sipc_util_marshal_object_add_data(out_obj, entry_key, entry_obj, SIPC_MARSHAL_DATA_OBJECT_TYPE);
break;
case TRESP_NETWORK_GET_ORDER:
- sipc_util_marshal_object_add_data(out_obj, "result", &resp_get_order->order, SIPC_MARSHAL_DATA_INT_TYPE);
+ switch (resp_get_order->order) {
+ case NETWORK_ORDER_GSM_FIRST:
+ sipc_util_marshal_object_add_data(out_obj, "order", "gsm", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
+ case NETWORK_ORDER_WCDMA_FIRST:
+ sipc_util_marshal_object_add_data(out_obj, "order", "wcdma", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
+ case NETWORK_ORDER_NO_CHANGE:
+ sipc_util_marshal_object_add_data(out_obj, "order", "no_change", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
+ case NETWORK_ORDER_AUTO:
+ default:
+ sipc_util_marshal_object_add_data(out_obj, "order", "auto", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
+ }
break;
case TRESP_NETWORK_SET_POWER_ON_ATTACH:
case TRESP_NETWORK_GET_POWER_ON_ATTACH:
sipc_util_marshal_object_add_data(out_obj, "enabled", &resp_get_power_on_attach->enabled,
- SIPC_MARSHAL_DATA_INT_TYPE);
+ SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
break;
case TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH:
break;
case TRESP_NETWORK_GET_SERVING_NETWORK:
- //
+ sipc_util_marshal_object_add_data(out_obj, "plmn", resp_get_serving_network->plmn, SIPC_MARSHAL_DATA_STRING_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "act", &resp_get_serving_network->act, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "lac", &resp_get_serving_network->gsm.lac, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "carrier", &resp_get_serving_network->cdma.carrier, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "sid", &resp_get_serving_network->cdma.sid, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "nid", &resp_get_serving_network->cdma.nid, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "bs_id", &resp_get_serving_network->cdma.bs_id, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "bs_lat", &resp_get_serving_network->cdma.bs_lat, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "bs_long", &resp_get_serving_network->cdma.bs_long, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "reg_zone", &resp_get_serving_network->cdma.reg_zone, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "pilot_pn", &resp_get_serving_network->cdma.pilot_pn, SIPC_MARSHAL_DATA_INT_TYPE);
break;
}
sipc_util_marshal_object_destory(out_obj);
}
- if (entry_obj) {
- sipc_util_marshal_object_destory(out_obj);
- }
-
out_d = g_new0(char, sizeof(struct _tapi_header) + hdr.data_len);
memcpy(out_d, &hdr, sizeof(struct _tapi_header));
const struct tnoti_network_icon_info *noti_icon_info = data;
const struct tnoti_network_change *noti_change = data;
const struct tnoti_network_timeinfo *noti_timeinfo = data;
+ const struct tnoti_network_identity *noti_identity = data;
int ret = 0;
struct custom_data *ctx = NULL;
struct _sipc_marshal_object* out_obj = NULL;
gchar *out_d = NULL, *serial_d = NULL;
+ memset(&hdr, 0, sizeof(struct _tapi_header));
+
ctx = tcore_communicator_ref_user_data(comm);
if (!ctx) {
dbg("user_data is NULL");
hdr.cmd = TAPI_NOTI_NETWORK_REGISTRATION_STATUS;
out_obj = sipc_util_marshal_object_create();
- sipc_util_marshal_object_add_data(out_obj, "cs_domain_status", ¬i_registration_status->cs_domain_status, SIPC_MARSHAL_DATA_INT_TYPE);
- sipc_util_marshal_object_add_data(out_obj, "ps_domain_status", ¬i_registration_status->ps_domain_status, SIPC_MARSHAL_DATA_INT_TYPE);
+ switch (noti_registration_status->cs_domain_status) {
+ case NETWORK_SERVICE_DOMAIN_STATUS_EMERGENCY:
+ sipc_util_marshal_object_add_data(out_obj, "circuit", "emergency", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ case NETWORK_SERVICE_DOMAIN_STATUS_FULL:
+ sipc_util_marshal_object_add_data(out_obj, "circuit", "full", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ case NETWORK_SERVICE_DOMAIN_STATUS_SEARCH:
+ sipc_util_marshal_object_add_data(out_obj, "circuit", "search", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ case NETWORK_SERVICE_DOMAIN_STATUS_NO:
+ default:
+ sipc_util_marshal_object_add_data(out_obj, "circuit", "none", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ }
+
+ switch (noti_registration_status->ps_domain_status) {
+ case NETWORK_SERVICE_DOMAIN_STATUS_EMERGENCY:
+ sipc_util_marshal_object_add_data(out_obj, "packet", "emergency", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ case NETWORK_SERVICE_DOMAIN_STATUS_FULL:
+ sipc_util_marshal_object_add_data(out_obj, "packet", "full", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ case NETWORK_SERVICE_DOMAIN_STATUS_SEARCH:
+ sipc_util_marshal_object_add_data(out_obj, "packet", "search", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ case NETWORK_SERVICE_DOMAIN_STATUS_NO:
+ default:
+ sipc_util_marshal_object_add_data(out_obj, "packet", "none", SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+ }
sipc_util_marshal_object_add_data(out_obj, "service_type", ¬i_registration_status->service_type, SIPC_MARSHAL_DATA_INT_TYPE);
- sipc_util_marshal_object_add_data(out_obj, "roaming_status", ¬i_registration_status->roaming_status, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "roaming_status", ¬i_registration_status->roaming_status, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
break;
case TNOTI_NETWORK_LOCATION_CELLINFO:
hdr.cmd = TAPI_NOTI_NETWORK_ICON_INFO;
out_obj = sipc_util_marshal_object_create();
- sipc_util_marshal_object_add_data(out_obj, "type", ¬i_icon_info->type, SIPC_MARSHAL_DATA_INT_TYPE);
- sipc_util_marshal_object_add_data(out_obj, "rssi", ¬i_icon_info->rssi, SIPC_MARSHAL_DATA_INT_TYPE);
- sipc_util_marshal_object_add_data(out_obj, "battery", ¬i_icon_info->battery, SIPC_MARSHAL_DATA_INT_TYPE);
- sipc_util_marshal_object_add_data(out_obj, "hdr_rssi", ¬i_icon_info->hdr_rssi, SIPC_MARSHAL_DATA_INT_TYPE);
+ if (noti_icon_info->type & 0x01) {
+ sipc_util_marshal_object_add_data(out_obj, "rssi", ¬i_icon_info->rssi,
+ SIPC_MARSHAL_DATA_INT_TYPE);
+ }
+ if (noti_icon_info->type & 0x02) {
+ sipc_util_marshal_object_add_data(out_obj, "battery", ¬i_icon_info->battery,
+ SIPC_MARSHAL_DATA_INT_TYPE);
+ }
+ if (noti_icon_info->type & 0x04) {
+ sipc_util_marshal_object_add_data(out_obj, "hdr_rssi", ¬i_icon_info->hdr_rssi,
+ SIPC_MARSHAL_DATA_INT_TYPE);
+ }
break;
case TNOTI_NETWORK_CHANGE:
sipc_util_marshal_object_add_data(out_obj, "bs_id", ¬i_change->cdma.bs_id, SIPC_MARSHAL_DATA_INT_TYPE);
sipc_util_marshal_object_add_data(out_obj, "bs_lat", ¬i_change->cdma.bs_lat, SIPC_MARSHAL_DATA_INT_TYPE);
sipc_util_marshal_object_add_data(out_obj, "bs_long", ¬i_change->cdma.bs_long, SIPC_MARSHAL_DATA_INT_TYPE);
- sipc_util_marshal_object_add_data(out_obj, "reg_sonze", ¬i_change->cdma.reg_sonze, SIPC_MARSHAL_DATA_INT_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "reg_zone", ¬i_change->cdma.reg_zone, SIPC_MARSHAL_DATA_INT_TYPE);
sipc_util_marshal_object_add_data(out_obj, "pilot_pn", ¬i_change->cdma.pilot_pn, SIPC_MARSHAL_DATA_INT_TYPE);
break;
sipc_util_marshal_object_add_data(out_obj, "isdst", ¬i_timeinfo->isdst, SIPC_MARSHAL_DATA_INT_TYPE);
break;
+ case TNOTI_NETWORK_IDENTITY:
+ hdr.cmd = TAPI_NOTI_NETWORK_IDENTITY;
+
+ out_obj = sipc_util_marshal_object_create();
+ sipc_util_marshal_object_add_data(out_obj, "plmn", noti_identity->plmn, SIPC_MARSHAL_DATA_STRING_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "short_name", noti_identity->short_name, SIPC_MARSHAL_DATA_STRING_TYPE);
+ sipc_util_marshal_object_add_data(out_obj, "full_name", noti_identity->full_name, SIPC_MARSHAL_DATA_STRING_TYPE);
+ break;
+
default:
+ dbg("unknown notification");
+ return FALSE;
break;
}
g_free(serial_d);
}
- dbg("len = %d, out_d = [%s]", sizeof(struct _tapi_header) + hdr.data_len, out_d);
+ dbg("len = %d, cmd = 0x%x, serialize = [%s]", sizeof(struct _tapi_header) + hdr.data_len, hdr.cmd, out_d);
ret = sipc_server_broadcast(ctx->sk_server, out_d, sizeof(struct _tapi_header) + hdr.data_len);
dbg("ret = %d", ret);