2 * tel-plugin-socket-communicator
4 * Copyright (c) 2012 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
25 #include <glib-object.h>
31 #include <communicator.h>
32 #include <core_object.h>
34 #include <user_request.h>
36 #include <co_network.h>
39 #include "tapi_common.h"
40 #include "module_req.h"
42 static void _request_fail(UserRequest *ur, int cmd, int resp_len, void *resp)
44 tcore_user_request_send_response(ur, cmd, resp_len, resp);
45 tcore_user_request_free(ur);
48 gboolean scomm_service_request_network(unsigned int ch_id, Communicator *c, TcorePlugin *plugin,
49 tapi_service_command_e cmd, gchar *data, void **outparam)
52 struct _sipc_marshal_object *out_obj;
53 struct _sipc_marshal_object *in_obj;
54 gboolean result = TRUE;
55 UserRequest *ur = NULL;
56 struct tcore_user_info ui = { 0, 0, 0, NULL, 0, 0, NULL };
58 in_obj = sipc_util_marshal_object_deserializer(data);
60 dbg("in_obj is NULL");
65 ur = tcore_user_request_new(c, tcore_plugin_get_description(plugin)->name);
72 ui.channel_id = ch_id;
74 tcore_user_request_set_user_info(ur, &ui);
77 case TAPI_SERVICE_NETWORK_SEARCH:
78 tcore_user_request_set_data(ur, 0, NULL);
79 tcore_user_request_set_command(ur, TREQ_NETWORK_SEARCH);
82 case TAPI_SERVICE_NETWORK_SET_PLMN_SELECTION_MODE: {
83 struct treq_network_set_plmn_selection_mode data_plmn_select;
84 struct tresp_network_set_plmn_selection_mode resp;
88 mode = sipc_util_marshal_object_get_string(in_obj, "mode");
90 resp.result = TCORE_RETURN_EINVAL;
91 _request_fail(ur, TRESP_NETWORK_SET_PLMN_SELECTION_MODE, sizeof(struct tresp_network_set_plmn_selection_mode), &resp);
96 plmn = sipc_util_marshal_object_get_string(in_obj, "plmn");
98 memset(&data_plmn_select, 0, sizeof(struct treq_network_set_plmn_selection_mode));
99 if (!g_strcmp0(mode, "automatic")) {
100 data_plmn_select.mode = NETWORK_SELECT_MODE_GSM_AUTOMATIC;
102 else if (!g_strcmp0(mode, "manual")) {
103 data_plmn_select.mode = NETWORK_SELECT_MODE_GSM_MANUAL;
104 snprintf(data_plmn_select.plmn, 6, "%s", plmn);
105 if (strlen(data_plmn_select.plmn) <= 5)
106 data_plmn_select.plmn[5] = '#';
113 resp.result = TCORE_RETURN_EINVAL;
114 _request_fail(ur, TRESP_NETWORK_SET_PLMN_SELECTION_MODE, sizeof(struct tresp_network_set_plmn_selection_mode), &resp);
122 tcore_user_request_set_data(ur, sizeof(struct treq_network_set_plmn_selection_mode), &data_plmn_select);
123 tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PLMN_SELECTION_MODE);
127 case TAPI_SERVICE_NETWORK_GET_PLMN_SELECTION_MODE:
128 tcore_user_request_set_data(ur, 0, NULL);
129 tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PLMN_SELECTION_MODE);
132 case TAPI_SERVICE_NETWORK_SET_SERVICE_DOMAIN: {
133 struct treq_network_set_service_domain data_service_domain;
134 struct tresp_network_set_service_domain resp;
135 gchar *domain = NULL;
137 domain = sipc_util_marshal_object_get_string(in_obj, "domain");
139 resp.result = TCORE_RETURN_EINVAL;
140 _request_fail(ur, TRESP_NETWORK_SET_SERVICE_DOMAIN, sizeof(struct tresp_network_set_service_domain), &resp);
145 if (!g_strcmp0(domain, "circuit")) {
146 data_service_domain.domain = NETWORK_SERVICE_DOMAIN_CS;
148 else if (!g_strcmp0(domain, "packet")) {
149 data_service_domain.domain = NETWORK_SERVICE_DOMAIN_PS;
151 else if (!g_strcmp0(domain, "combined")) {
152 data_service_domain.domain = NETWORK_SERVICE_DOMAIN_COMBINED;
158 resp.result = TCORE_RETURN_EINVAL;
159 _request_fail(ur, TRESP_NETWORK_SET_SERVICE_DOMAIN, sizeof(struct tresp_network_set_service_domain), &resp);
165 tcore_user_request_set_data(ur, sizeof(struct treq_network_set_service_domain), &data_service_domain);
166 tcore_user_request_set_command(ur, TREQ_NETWORK_SET_SERVICE_DOMAIN);
170 case TAPI_SERVICE_NETWORK_GET_SERVICE_DOMAIN:
171 tcore_user_request_set_data(ur, 0, NULL);
172 tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVICE_DOMAIN);
175 case TAPI_SERVICE_NETWORK_SET_BAND :{
176 struct treq_network_set_band data_band;
177 struct tresp_network_set_band resp;
181 mode = sipc_util_marshal_object_get_string(in_obj, "mode");
184 resp.result = TCORE_RETURN_EINVAL;
185 _request_fail(ur, TRESP_NETWORK_SET_BAND, sizeof(struct tresp_network_set_band), &resp);
189 band = sipc_util_marshal_object_get_int(in_obj, "band");
191 if (!g_strcmp0(mode, "only")) {
192 data_band.mode = NETWORK_BAND_MODE_ONLY;
194 else if (!g_strcmp0(mode, "preferred")) {
195 data_band.mode = NETWORK_BAND_MODE_PREFERRED;
201 resp.result = TCORE_RETURN_EINVAL;
202 _request_fail(ur, TRESP_NETWORK_SET_BAND, sizeof(struct tresp_network_set_band), &resp);
206 data_band.band = band;
210 tcore_user_request_set_data(ur, sizeof(struct treq_network_set_band), &data_band);
211 tcore_user_request_set_command(ur, TREQ_NETWORK_SET_BAND);
215 case TAPI_SERVICE_NETWORK_GET_BAND:
216 tcore_user_request_set_data(ur, 0, NULL);
217 tcore_user_request_set_command(ur, TREQ_NETWORK_GET_BAND);
220 case TAPI_SERVICE_NETWORK_SET_PREFERRED_PLMN :{
221 struct treq_network_set_preferred_plmn data_preferred_plmn;
222 struct tresp_network_set_preferred_plmn resp;
228 mode = sipc_util_marshal_object_get_string(in_obj, "mode");
231 resp.result = TCORE_RETURN_EINVAL;
232 _request_fail(ur, TRESP_NETWORK_SET_PREFERRED_PLMN, sizeof(struct tresp_network_set_preferred_plmn), &resp);
236 plmn = sipc_util_marshal_object_get_string(in_obj, "plmn");
240 resp.result = TCORE_RETURN_EINVAL;
241 _request_fail(ur, TRESP_NETWORK_SET_PREFERRED_PLMN, sizeof(struct tresp_network_set_preferred_plmn), &resp);
245 act = sipc_util_marshal_object_get_int(in_obj, "act");
246 ef_index = sipc_util_marshal_object_get_int(in_obj, "ef_index");
248 if (!g_strcmp0(mode, "add")) {
249 data_preferred_plmn.operation = NETWORK_PREF_PLMN_ADD;
252 else if (!g_strcmp0(mode, "edit")) {
253 data_preferred_plmn.operation = NETWORK_PREF_PLMN_EDIT;
256 else if (!g_strcmp0(mode, "delete")) {
257 data_preferred_plmn.operation = NETWORK_PREF_PLMN_DELETE;
264 resp.result = TCORE_RETURN_EINVAL;
265 _request_fail(ur, TRESP_NETWORK_SET_PREFERRED_PLMN, sizeof(struct tresp_network_set_preferred_plmn), &resp);
269 snprintf(data_preferred_plmn.plmn, 6, "%s", plmn);
270 if (strlen(data_preferred_plmn.plmn) <= 5)
271 data_preferred_plmn.plmn[5] = '#';
273 data_preferred_plmn.act = act;
274 data_preferred_plmn.ef_index = ef_index;
279 tcore_user_request_set_data(ur, sizeof(struct treq_network_set_preferred_plmn), &data_preferred_plmn);
280 tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PREFERRED_PLMN);
284 case TAPI_SERVICE_NETWORK_GET_PREFERRED_PLMN:
285 tcore_user_request_set_data(ur, 0, NULL);
286 tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PREFERRED_PLMN);
289 case TAPI_SERVICE_NETWORK_SET_ORDER :{
290 struct treq_network_set_order data_order;
291 struct tresp_network_set_order resp;
294 order = sipc_util_marshal_object_get_string(in_obj, "order");
297 resp.result = TCORE_RETURN_EINVAL;
298 _request_fail(ur, TRESP_NETWORK_SET_ORDER, sizeof(struct tresp_network_set_order), &resp);
302 if (!g_strcmp0(order, "auto")) {
303 data_order.order = NETWORK_ORDER_AUTO;
305 else if (!g_strcmp0(order, "gsm")) {
306 data_order.order = NETWORK_ORDER_GSM_FIRST;
308 else if (!g_strcmp0(order, "wcdma")) {
309 data_order.order = NETWORK_ORDER_WCDMA_FIRST;
311 else if (!g_strcmp0(order, "no_change")) {
312 data_order.order = NETWORK_ORDER_NO_CHANGE;
317 resp.result = TCORE_RETURN_EINVAL;
318 _request_fail(ur, TRESP_NETWORK_SET_ORDER, sizeof(struct tresp_network_set_order), &resp);
324 tcore_user_request_set_data(ur, sizeof(struct treq_network_set_order), &data_order);
325 tcore_user_request_set_command(ur, TREQ_NETWORK_SET_ORDER);
329 case TAPI_SERVICE_NETWORK_GET_ORDER:
330 tcore_user_request_set_data(ur, 0, NULL);
331 tcore_user_request_set_command(ur, TREQ_NETWORK_GET_ORDER);
334 case TAPI_SERVICE_NETWORK_SET_POWER_ON_ATTACH :{
335 struct treq_network_set_power_on_attach data_power_on_attach;
338 enable = sipc_util_marshal_object_get_boolean(in_obj, "enable");
340 data_power_on_attach.enable = enable;
342 tcore_user_request_set_data(ur, sizeof(struct treq_network_set_power_on_attach), &data_power_on_attach);
343 tcore_user_request_set_command(ur, TREQ_NETWORK_SET_POWER_ON_ATTACH);
347 case TAPI_SERVICE_NETWORK_GET_POWER_ON_ATTACH:
348 tcore_user_request_set_data(ur, 0, NULL);
349 tcore_user_request_set_command(ur, TREQ_NETWORK_GET_POWER_ON_ATTACH);
352 case TAPI_SERVICE_NETWORK_SET_CANCEL_MANUAL_SEARCH:
353 tcore_user_request_set_data(ur, 0, NULL);
354 tcore_user_request_set_command(ur, TREQ_NETWORK_SET_CANCEL_MANUAL_SEARCH);
357 case TAPI_SERVICE_NETWORK_GET_SERVING_NETWORK:
358 tcore_user_request_set_data(ur, 0, NULL);
359 tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVING_NETWORK);
364 sipc_util_marshal_object_destory(in_obj);
365 out_obj = sipc_util_marshal_object_create();
366 sipc_util_marshal_object_add_data(out_obj, "result", &result, SIPC_MARSHAL_DATA_BOOLEAN_TYPE);
368 dbg("result = %d", result);
370 *outparam = sipc_util_marshal_object_serializer(out_obj);
371 sipc_util_marshal_object_destory(out_obj);
373 if (result == FALSE) {
374 tcore_user_request_free(ur);
378 ret = tcore_communicator_dispatch_request(c, ur);
379 if (ret != TCORE_RETURN_SUCCESS) {
386 gboolean scomm_service_response_network(Communicator *comm, UserRequest *ur, enum tcore_response_command command,
387 unsigned int data_len, const void *data)
389 const struct tresp_network_search *resp_network_search = data;
390 const struct tresp_network_set_plmn_selection_mode *resp_set_plmn_selection_mode = data;
391 const struct tresp_network_get_plmn_selection_mode *resp_get_plmn_selection_mode = data;
392 const struct tresp_network_set_service_domain *resp_set_service_domain = data;
393 const struct tresp_network_get_service_domain *resp_get_service_domain = data;
394 const struct tresp_network_set_band *resp_set_band = data;
395 const struct tresp_network_get_band *resp_get_band = data;
396 const struct tresp_network_set_preferred_plmn *resp_set_preferred_plmn = data;
397 const struct tresp_network_get_preferred_plmn *resp_get_preferred_plmn = data;
398 const struct tresp_network_set_order *resp_set_order = data;
399 const struct tresp_network_get_order *resp_get_order = data;
400 const struct tresp_network_set_power_on_attach *resp_set_power_on_attach = data;
401 const struct tresp_network_get_power_on_attach *resp_get_power_on_attach = data;
402 const struct tresp_network_set_cancel_manual_search *resp_set_cancel_manual_search = data;
407 gchar *serial_d = NULL;
408 gchar entry_key[10] = { 0, };
409 struct custom_data *ctx = NULL;
410 const struct tcore_user_info *ui;
411 struct _tapi_header hdr;
412 struct _sipc_marshal_object* out_obj = NULL;
413 struct _sipc_marshal_object* entry_obj = NULL;
414 struct _sipc_marshal_object* in_obj = NULL;
416 ctx = tcore_communicator_ref_user_data(comm);
422 ui = tcore_user_request_ref_user_info(ur);
424 dbg("response command = [0x%x], data_len = %d", command, data_len);
425 dbg("channel_id = %d, client_cmd = %d", ui->channel_id, ui->client_cmd);
427 memset(&hdr, 0, sizeof(struct _tapi_header));
428 hdr.cmd = (tapi_service_command_e) ui->client_cmd;
430 out_obj = sipc_util_marshal_object_create();
433 case TRESP_NETWORK_SEARCH:
434 sipc_util_marshal_object_add_data(out_obj, "count", &resp_network_search->list_count,
435 SIPC_MARSHAL_DATA_INT_TYPE);
437 dbg("count = %d", resp_network_search->list_count);
438 entry_obj = sipc_util_marshal_object_create();
439 for (i = 0; i < resp_network_search->list_count; i++) {
440 sipc_util_marshal_object_add_data(entry_obj, "plmn", resp_network_search->list[0].plmn,
441 SIPC_MARSHAL_DATA_STRING_TYPE);
442 sipc_util_marshal_object_add_data(entry_obj, "status", &resp_network_search->list[0].status,
443 SIPC_MARSHAL_DATA_INT_TYPE);
444 sipc_util_marshal_object_add_data(entry_obj, "act", &resp_network_search->list[0].act,
445 SIPC_MARSHAL_DATA_INT_TYPE);
447 snprintf(entry_key, 10, "%d", i);
448 sipc_util_marshal_object_add_data(out_obj, entry_key, entry_obj, SIPC_MARSHAL_DATA_OBJECT_TYPE);
451 "key=%s, plmn=%s, status=%d, act=%d",
452 entry_key, resp_network_search->list[0].plmn, resp_network_search->list[0].status, resp_network_search->list[0].act);
456 case TRESP_NETWORK_SET_PLMN_SELECTION_MODE:
457 sipc_util_marshal_object_add_data(out_obj, "result", &resp_set_plmn_selection_mode->result,
458 SIPC_MARSHAL_DATA_INT_TYPE);
461 case TRESP_NETWORK_GET_PLMN_SELECTION_MODE:
462 sipc_util_marshal_object_add_data(out_obj, "mode", &resp_get_plmn_selection_mode->mode,
463 SIPC_MARSHAL_DATA_INT_TYPE);
466 case TRESP_NETWORK_SET_SERVICE_DOMAIN:
467 sipc_util_marshal_object_add_data(out_obj, "result", &resp_set_service_domain->result,
468 SIPC_MARSHAL_DATA_INT_TYPE);
471 case TRESP_NETWORK_GET_SERVICE_DOMAIN:
472 sipc_util_marshal_object_add_data(out_obj, "domain", &resp_get_service_domain->domain,
473 SIPC_MARSHAL_DATA_INT_TYPE);
476 case TRESP_NETWORK_SET_BAND:
477 sipc_util_marshal_object_add_data(out_obj, "result", &resp_set_band->result, SIPC_MARSHAL_DATA_INT_TYPE);
480 case TRESP_NETWORK_GET_BAND:
481 sipc_util_marshal_object_add_data(out_obj, "band", &resp_get_band->band, SIPC_MARSHAL_DATA_INT_TYPE);
484 case TRESP_NETWORK_SET_PREFERRED_PLMN:
485 sipc_util_marshal_object_add_data(out_obj, "result", &resp_set_preferred_plmn->result,
486 SIPC_MARSHAL_DATA_INT_TYPE);
489 case TRESP_NETWORK_GET_PREFERRED_PLMN:
490 sipc_util_marshal_object_add_data(out_obj, "count", &resp_get_preferred_plmn->list_count,
491 SIPC_MARSHAL_DATA_INT_TYPE);
493 entry_obj = sipc_util_marshal_object_create();
494 for (i = 0; i < resp_network_search->list_count; i++) {
495 sipc_util_marshal_object_add_data(entry_obj, "plmn", resp_get_preferred_plmn->list[0].plmn,
496 SIPC_MARSHAL_DATA_STRING_TYPE);
497 sipc_util_marshal_object_add_data(entry_obj, "ef_index", &resp_get_preferred_plmn->list[0].ef_index,
498 SIPC_MARSHAL_DATA_INT_TYPE);
499 sipc_util_marshal_object_add_data(entry_obj, "act", &resp_get_preferred_plmn->list[0].act,
500 SIPC_MARSHAL_DATA_INT_TYPE);
501 snprintf(entry_key, 10, "%d", i);
502 sipc_util_marshal_object_add_data(out_obj, entry_key, entry_obj, SIPC_MARSHAL_DATA_OBJECT_TYPE);
506 case TRESP_NETWORK_SET_ORDER:
507 sipc_util_marshal_object_add_data(out_obj, "result", &resp_set_order->result, SIPC_MARSHAL_DATA_INT_TYPE);
510 case TRESP_NETWORK_GET_ORDER:
511 sipc_util_marshal_object_add_data(out_obj, "result", &resp_get_order->order, SIPC_MARSHAL_DATA_INT_TYPE);
514 case TRESP_NETWORK_SET_POWER_ON_ATTACH:
515 sipc_util_marshal_object_add_data(out_obj, "result", &resp_set_power_on_attach->result,
516 SIPC_MARSHAL_DATA_INT_TYPE);
519 case TRESP_NETWORK_GET_POWER_ON_ATTACH:
520 sipc_util_marshal_object_add_data(out_obj, "enabled", &resp_get_power_on_attach->enabled,
521 SIPC_MARSHAL_DATA_INT_TYPE);
524 case TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH:
525 sipc_util_marshal_object_add_data(out_obj, "result", &resp_set_cancel_manual_search->result,
526 SIPC_MARSHAL_DATA_INT_TYPE);
529 case TRESP_NETWORK_GET_SERVING_NETWORK:
535 serial_d = sipc_util_marshal_object_serializer(out_obj);
536 hdr.data_len = strlen(serial_d);
537 dbg("data_len = %d", hdr.data_len);
538 sipc_util_marshal_object_destory(out_obj);
542 sipc_util_marshal_object_destory(out_obj);
545 out_d = g_new0(char, sizeof(struct _tapi_header) + hdr.data_len);
546 memcpy(out_d, &hdr, sizeof(struct _tapi_header));
549 memcpy(out_d + sizeof(struct _tapi_header), serial_d, hdr.data_len);
550 dbg("serial_d = [%s]", serial_d);
554 ret = sipc_server_send(ctx->sk_server, ui->channel_id, out_d, sizeof(struct _tapi_header) + hdr.data_len,
555 SIPC_SEND_DATA_ASYNC);
559 dbg("ret = %d", ret);
566 gboolean scomm_service_notification_network(Communicator *comm, CoreObject *source, enum tcore_notification_command command,
567 unsigned int data_len, const void *data)
569 const struct tnoti_network_registration_status *noti_registration_status = data;
570 const struct tnoti_network_location_cellinfo *noti_location_cellinfo = data;
571 const struct tnoti_network_icon_info *noti_icon_info = data;
572 const struct tnoti_network_change *noti_change = data;
573 const struct tnoti_network_timeinfo *noti_timeinfo = data;
576 struct custom_data *ctx = NULL;
577 struct _tapi_header hdr;
578 struct _sipc_marshal_object* out_obj = NULL;
579 gchar *out_d = NULL, *serial_d = NULL;
581 ctx = tcore_communicator_ref_user_data(comm);
583 dbg("user_data is NULL");
587 dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
590 case TNOTI_NETWORK_REGISTRATION_STATUS:
591 hdr.cmd = TAPI_NOTI_NETWORK_REGISTRATION_STATUS;
593 out_obj = sipc_util_marshal_object_create();
594 sipc_util_marshal_object_add_data(out_obj, "cs_domain_status", ¬i_registration_status->cs_domain_status, SIPC_MARSHAL_DATA_INT_TYPE);
595 sipc_util_marshal_object_add_data(out_obj, "ps_domain_status", ¬i_registration_status->ps_domain_status, SIPC_MARSHAL_DATA_INT_TYPE);
596 sipc_util_marshal_object_add_data(out_obj, "service_type", ¬i_registration_status->service_type, SIPC_MARSHAL_DATA_INT_TYPE);
597 sipc_util_marshal_object_add_data(out_obj, "roaming_status", ¬i_registration_status->roaming_status, SIPC_MARSHAL_DATA_INT_TYPE);
600 case TNOTI_NETWORK_LOCATION_CELLINFO:
601 hdr.cmd = TAPI_NOTI_NETWORK_LOCATION_CELLINFO;
603 out_obj = sipc_util_marshal_object_create();
604 sipc_util_marshal_object_add_data(out_obj, "lac", ¬i_location_cellinfo->lac, SIPC_MARSHAL_DATA_INT_TYPE);
605 sipc_util_marshal_object_add_data(out_obj, "cell_id", ¬i_location_cellinfo->cell_id, SIPC_MARSHAL_DATA_INT_TYPE);
608 case TNOTI_NETWORK_ICON_INFO:
609 hdr.cmd = TAPI_NOTI_NETWORK_ICON_INFO;
611 out_obj = sipc_util_marshal_object_create();
612 sipc_util_marshal_object_add_data(out_obj, "type", ¬i_icon_info->type, SIPC_MARSHAL_DATA_INT_TYPE);
613 sipc_util_marshal_object_add_data(out_obj, "rssi", ¬i_icon_info->rssi, SIPC_MARSHAL_DATA_INT_TYPE);
614 sipc_util_marshal_object_add_data(out_obj, "battery", ¬i_icon_info->battery, SIPC_MARSHAL_DATA_INT_TYPE);
615 sipc_util_marshal_object_add_data(out_obj, "hdr_rssi", ¬i_icon_info->hdr_rssi, SIPC_MARSHAL_DATA_INT_TYPE);
618 case TNOTI_NETWORK_CHANGE:
619 hdr.cmd = TAPI_NOTI_NETWORK_CHANGE;
621 out_obj = sipc_util_marshal_object_create();
622 sipc_util_marshal_object_add_data(out_obj, "plmn", noti_change->plmn, SIPC_MARSHAL_DATA_STRING_TYPE);
623 sipc_util_marshal_object_add_data(out_obj, "act", ¬i_change->act, SIPC_MARSHAL_DATA_INT_TYPE);
624 sipc_util_marshal_object_add_data(out_obj, "lac", ¬i_change->gsm.lac, SIPC_MARSHAL_DATA_INT_TYPE);
625 sipc_util_marshal_object_add_data(out_obj, "carrier", ¬i_change->cdma.carrier, SIPC_MARSHAL_DATA_INT_TYPE);
626 sipc_util_marshal_object_add_data(out_obj, "sid", ¬i_change->cdma.sid, SIPC_MARSHAL_DATA_INT_TYPE);
627 sipc_util_marshal_object_add_data(out_obj, "nid", ¬i_change->cdma.nid, SIPC_MARSHAL_DATA_INT_TYPE);
628 sipc_util_marshal_object_add_data(out_obj, "bs_id", ¬i_change->cdma.bs_id, SIPC_MARSHAL_DATA_INT_TYPE);
629 sipc_util_marshal_object_add_data(out_obj, "bs_lat", ¬i_change->cdma.bs_lat, SIPC_MARSHAL_DATA_INT_TYPE);
630 sipc_util_marshal_object_add_data(out_obj, "bs_long", ¬i_change->cdma.bs_long, SIPC_MARSHAL_DATA_INT_TYPE);
631 sipc_util_marshal_object_add_data(out_obj, "reg_sonze", ¬i_change->cdma.reg_sonze, SIPC_MARSHAL_DATA_INT_TYPE);
632 sipc_util_marshal_object_add_data(out_obj, "pilot_pn", ¬i_change->cdma.pilot_pn, SIPC_MARSHAL_DATA_INT_TYPE);
635 case TNOTI_NETWORK_TIMEINFO:
636 hdr.cmd = TAPI_NOTI_NETWORK_TIMEINFO;
638 out_obj = sipc_util_marshal_object_create();
639 sipc_util_marshal_object_add_data(out_obj, "plmn", noti_timeinfo->plmn, SIPC_MARSHAL_DATA_STRING_TYPE);
640 sipc_util_marshal_object_add_data(out_obj, "year", ¬i_timeinfo->year, SIPC_MARSHAL_DATA_INT_TYPE);
641 sipc_util_marshal_object_add_data(out_obj, "month", ¬i_timeinfo->month, SIPC_MARSHAL_DATA_INT_TYPE);
642 sipc_util_marshal_object_add_data(out_obj, "day", ¬i_timeinfo->day, SIPC_MARSHAL_DATA_INT_TYPE);
643 sipc_util_marshal_object_add_data(out_obj, "hour", ¬i_timeinfo->hour, SIPC_MARSHAL_DATA_INT_TYPE);
644 sipc_util_marshal_object_add_data(out_obj, "minute", ¬i_timeinfo->minute, SIPC_MARSHAL_DATA_INT_TYPE);
645 sipc_util_marshal_object_add_data(out_obj, "second", ¬i_timeinfo->second, SIPC_MARSHAL_DATA_INT_TYPE);
646 sipc_util_marshal_object_add_data(out_obj, "wday", ¬i_timeinfo->wday, SIPC_MARSHAL_DATA_INT_TYPE);
647 sipc_util_marshal_object_add_data(out_obj, "gmtoff", ¬i_timeinfo->gmtoff, SIPC_MARSHAL_DATA_INT_TYPE);
648 sipc_util_marshal_object_add_data(out_obj, "dstoff", ¬i_timeinfo->dstoff, SIPC_MARSHAL_DATA_INT_TYPE);
649 sipc_util_marshal_object_add_data(out_obj, "isdst", ¬i_timeinfo->isdst, SIPC_MARSHAL_DATA_INT_TYPE);
657 serial_d = sipc_util_marshal_object_serializer(out_obj);
658 hdr.data_len = strlen(serial_d);
659 sipc_util_marshal_object_destory(out_obj);
662 out_d = g_new0(char, sizeof(struct _tapi_header)+hdr.data_len);
663 memcpy(out_d, &hdr, sizeof(struct _tapi_header));
665 memcpy(out_d + sizeof(struct _tapi_header), serial_d, hdr.data_len);
669 dbg("len = %d, out_d = [%s]", sizeof(struct _tapi_header) + hdr.data_len, out_d);
671 ret = sipc_server_broadcast(ctx->sk_server, out_d, sizeof(struct _tapi_header) + hdr.data_len);
672 dbg("ret = %d", ret);