+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <glib.h>
-#include <security-server.h>
-
-#include <tcore.h>
-#include <plugin.h>
-#include <communicator.h>
-#include <server.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-const char *dbus_plugin_get_cp_name_by_object_path(const char *object_path)
-{
- if (!object_path)
- return NULL;
-
- if (!g_str_has_prefix(object_path, TELEPHONY_OBJECT_PATH)) {
- return NULL;
- }
-
- return object_path + strlen(TELEPHONY_OBJECT_PATH) + 1;
-}
-
-gboolean check_access_control(GDBusMethodInvocation *invoc, const char *label,
- const char *perm)
-{
- GDBusConnection *conn;
- GVariant *result_pid;
- GVariant *param;
- GError *error = NULL;
- const char *sender;
- unsigned int pid;
- int ret;
- int result = FALSE;
-
- conn = g_dbus_method_invocation_get_connection(invoc);
- if (conn == NULL) {
- err("access control denied(no connection info)");
- goto OUT;
- }
-
- sender = g_dbus_method_invocation_get_sender(invoc);
- dbg("sender: %s", sender);
-
- param = g_variant_new("(s)", sender);
- if (param == NULL) {
- err("access control denied(sender info fail)");
- goto OUT;
- }
-
- result_pid = g_dbus_connection_call_sync (conn, "org.freedesktop.DBus",
- "/org/freedesktop/DBus",
- "org.freedesktop.DBus",
- "GetConnectionUnixProcessID",
- param, NULL,
- G_DBUS_CALL_FLAGS_NONE, -1, NULL, &error);
-
- if (error) {
- err("access control denied (dbus error: %d(%s))",
- error->code, error->message);
- g_error_free (error);
- goto OUT;
- }
-
- if (result_pid == NULL) {
- err("access control denied(fail to get pid)");
- goto OUT;
- }
-
- g_variant_get(result_pid, "(u)", &pid);
- g_variant_unref(result_pid);
-
- dbg ("pid = %u", pid);
-
- ret = security_server_check_privilege_by_pid(pid, label, perm);
- if (ret != SECURITY_SERVER_API_SUCCESS)
- err("access control(%s - %s) denied(%d)", label, perm, ret);
- else
- result = TRUE;
-
-OUT:
- /* TODO: return result; */
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef __COMMON_H__
-#define __COMMON_H__
-
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-
-#include "generated-code.h"
-
-#define AC_MANAGER "telephony_framework::api_manager"
-#define AC_CALL "telephony_framework::api_call"
-#define AC_GPS "telephony_framework::api_gps"
-#define AC_MODEM "telephony_framework::api_modem"
-#define AC_NETWORK "telephony_framework::api_network"
-#define AC_PHONEBOOK "telephony_framework::api_phonebook"
-#define AC_SAP "telephony_framework::api_sap"
-#define AC_SAT "telephony_framework::api_sat"
-#define AC_SIM "telephony_framework::api_sim"
-#define AC_SMS "telephony_framework::api_sms"
-#define AC_SS "telephony_framework::api_ss"
-
-struct custom_data {
- TcorePlugin *plugin;
- Communicator *comm;
- Server *server;
- guint bus_id;
-
- GHashTable *objects;
- GDBusObjectManagerServer *manager;
-};
-
-typedef struct {
- void *interface_object;
- GDBusMethodInvocation *invocation;
- char user_data[0]; /* Additional user data base pointer */
-} DbusRespCbData;
-
-#define GET_CP_NAME(invocation) dbus_plugin_get_cp_name_by_object_path(g_dbus_method_invocation_get_object_path(invocation))
-#define MAKE_DBUS_RESP_CB_DATA(data, object, invocation, user_data, user_data_len) \
- data = g_malloc0(sizeof(DbusRespCbData) + user_data_len); \
- data->interface_object = object; \
- data->invocation = invocation; \
- if ((user_data != NULL) && (user_data_len > 0)) \
- memcpy(data->user_data, user_data, user_data_len);
-
-#define FREE_DBUS_RESP_CB_DATA(data) g_free(data);
-
-const char *dbus_plugin_get_cp_name_by_object_path(const char *object_path);
-gboolean check_access_control(GDBusMethodInvocation *invoc, const char *label, const char *perm);
-
-gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_network_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_sap_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_sap_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_phonebook_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_phonebook_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_sim_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_sim_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_sat_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_sat_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_sms_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_sms_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_call_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_call_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_ss_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_ss_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_modem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_modem_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-gboolean dbus_plugin_setup_gps_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx);
-gboolean dbus_plugin_gps_notification(struct custom_data *ctx, CoreObject *source, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data);
-
-#endif
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_gps.h>
-#include <co_sim.h>
-#include <co_ps.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-static gboolean
-on_gps_set_frequency_aiding (TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- guchar data,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_GPS, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, gps, invocation);
- dbg("data=%d",data);
-
- tcore_user_request_set_data(ur, sizeof(data), (const char*)&data);
- tcore_user_request_set_command(ur, TREQ_GPS_SET_FREQUENCY_AIDING);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_gps_complete_set_frequency_aiding(gps, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_gps_confirm_measure_pos (TelephonyGps *gps,
- GDBusMethodInvocation *invocation,
- const gchar *data,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- gboolean result = TRUE;
- guchar *decoded_data = NULL;
- gsize length;
-
- if (check_access_control(invocation, AC_GPS, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, gps, invocation);
-
- decoded_data = g_base64_decode(data, &length);
- dbg("decoded length=%d", length);
- tcore_user_request_set_data(ur, length, decoded_data);
- tcore_user_request_set_command(ur, TREQ_GPS_CONFIRM_MEASURE_POS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- tcore_user_request_unref(ur);
- result = FALSE;
- }
-
- telephony_gps_complete_confirm_measure_pos(gps, invocation, result);
- g_free(decoded_data);
-
- return TRUE;
-}
-
-
-gboolean dbus_plugin_setup_gps_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyGps *gps;
-
- gps = telephony_gps_skeleton_new();
- telephony_object_skeleton_set_gps(object, gps);
-
- g_object_unref(gps);
-
- dbg("gps = %p", gps);
-
- g_signal_connect (gps,
- "handle-set-frequency-aiding",
- G_CALLBACK (on_gps_set_frequency_aiding),
- ctx);
-
- g_signal_connect (gps,
- "handle-confirm-measure-pos",
- G_CALLBACK (on_gps_confirm_measure_pos),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_gps_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- const struct tresp_gps_set_frequency_aiding*resp_gps_frequency_aiding = data;
-
- CoreObject *co_gps;
- char *modem_name = NULL;
- TcorePlugin *p = NULL;
-
- modem_name = tcore_user_request_get_modem_name(ur);
- if (!modem_name)
- return FALSE;
-
- p = tcore_server_find_plugin(ctx->server, modem_name);
- free(modem_name);
- if (!p)
- return FALSE;
-
- co_gps = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_GPS);
- if (!co_gps)
- return FALSE;
-
- switch (command) {
- case TRESP_GPS_SET_FREQUENCY_AIDING:
- dbg("receive TRESP_GPS_SET_FREQUENCY_AIDING");
- dbg("resp->result = %d", resp_gps_frequency_aiding->result);
- telephony_gps_complete_set_frequency_aiding(dbus_info->interface_object, dbus_info->invocation, resp_gps_frequency_aiding->result);
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_gps_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonyGps *gps;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
-
- gps = telephony_object_peek_gps(TELEPHONY_OBJECT(object));
- dbg("gps = %p", gps);
-
- switch (command) {
- case TNOTI_GPS_ASSIST_DATA:
- {
- gchar *encoded_data = NULL;
- dbg("TNOTI_GPS_ASSIST_DATA. data=%p, data_len=%d", data, data_len);
- encoded_data = g_base64_encode((const guchar*)data, data_len);
- telephony_gps_emit_assist_data(gps, encoded_data);
- g_free(encoded_data);
- }
- break;
-
- case TNOTI_GPS_MEASURE_POSITION:
- {
- gchar *encoded_data = NULL;
- dbg("TNOTI_GPS_MEASURE_POSITION. data=%p, data_len=%d", data, data_len);
- encoded_data = g_base64_encode((const guchar*)data, data_len);
- telephony_gps_emit_measure_position(gps, encoded_data);
- g_free(encoded_data);
- }
- break;
-
- case TNOTI_GPS_RESET_ASSIST_DATA:
- dbg("TNOTI_GPS_RESET_ASSIST_DATA");
- telephony_gps_emit_reset_assist_data(gps);
- break;
-
- case TNOTI_GPS_FREQUENCY_AIDING_DATA:
- {
- gchar *encoded_data = NULL;
- dbg("TNOTI_GPS_FREQUENCY_AIDING_DATA. data=%p, data_len=%d", data, data_len);
- encoded_data = g_base64_encode((const guchar*)data, data_len);
- telephony_gps_emit_frequency_aiding(gps, encoded_data);
- g_free(encoded_data);
- }
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_modem.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-static gboolean
-on_modem_set_power (TelephonyModem *modem,
- GDBusMethodInvocation *invocation,
- gint mode,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret = TCORE_RETURN_SUCCESS;
-
- if (check_access_control(invocation, AC_MODEM, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
-
- switch (mode) {
- case 0:
- tcore_user_request_set_command(ur, TREQ_MODEM_POWER_OFF);
- break;
- case 1:
- tcore_user_request_set_command(ur, TREQ_MODEM_POWER_ON);
- break;
- case 2:
- tcore_user_request_set_command(ur, TREQ_MODEM_POWER_RESET);
- break;
- default:
- ret = TCORE_RETURN_EINVAL;
- goto ERR;
- break;
- }
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS)
- goto ERR;
-
- return TRUE;
-
-ERR:
- telephony_modem_complete_set_power(modem, invocation, ret);
- g_free(ur);
-
- return TRUE;
-}
-
-static gboolean
-on_modem_set_flight_mode (TelephonyModem *modem,
- GDBusMethodInvocation *invocation,
- gboolean enable,
- gpointer user_data)
-{
- struct treq_modem_set_flightmode data;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_MODEM, "w") == FALSE)
- return FALSE;
-
- data.enable = enable;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_modem_set_flightmode), &data);
- tcore_user_request_set_command(ur, TREQ_MODEM_SET_FLIGHTMODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_modem_complete_set_flight_mode(modem, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_modem_get_flight_mode (TelephonyModem *modem,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct treq_modem_get_flightmode data;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_MODEM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_modem_get_flightmode), &data);
- tcore_user_request_set_command(ur, TREQ_MODEM_GET_FLIGHTMODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_modem_complete_get_flight_mode(modem, invocation, FALSE, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_modem_get_version (TelephonyModem *modem,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_MODEM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_command(ur, TREQ_MODEM_GET_VERSION);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_modem_complete_get_version(modem, invocation,
- ret,
- NULL, NULL, NULL, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_modem_get_serial_number (TelephonyModem *modem,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_MODEM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_command(ur, TREQ_MODEM_GET_SN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_modem_complete_get_serial_number(modem, invocation, ret, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_modem_get_imei (TelephonyModem *modem,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_MODEM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_command(ur, TREQ_MODEM_GET_IMEI);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_modem_complete_get_imei(modem, invocation, ret, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_modem_set_dun_pin_ctrl (TelephonyModem *modem, GDBusMethodInvocation *invocation,
- gint arg_signal, gboolean arg_status, gpointer user_data)
-{
- struct treq_modem_set_dun_pin_control data;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_MODEM, "x") == FALSE)
- return FALSE;
-
- data.signal = arg_signal;
- data.status = arg_status;
-
- ur = MAKE_UR(ctx, modem, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_modem_set_dun_pin_control), &data);
- tcore_user_request_set_command(ur, TREQ_MODEM_SET_DUN_PIN_CONTROL);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_modem_complete_set_dun_pin_ctrl(modem, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_modem_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyModem *modem;
-
- modem = telephony_modem_skeleton_new();
- telephony_object_skeleton_set_modem(object, modem);
- g_object_unref(modem);
-
- dbg("modem = %p", modem);
-
- g_signal_connect (modem,
- "handle-set-power",
- G_CALLBACK (on_modem_set_power),
- ctx);
-
- g_signal_connect (modem,
- "handle-set-flight-mode",
- G_CALLBACK (on_modem_set_flight_mode),
- ctx);
-
- g_signal_connect (modem,
- "handle-get-flight-mode",
- G_CALLBACK (on_modem_get_flight_mode),
- ctx);
-
- g_signal_connect (modem,
- "handle-get-version",
- G_CALLBACK (on_modem_get_version),
- ctx);
-
- g_signal_connect (modem,
- "handle-get-serial-number",
- G_CALLBACK (on_modem_get_serial_number),
- ctx);
-
- g_signal_connect (modem,
- "handle-get-imei",
- G_CALLBACK (on_modem_get_imei),
- ctx);
-
- g_signal_connect (modem,
- "handle-set-dun-pin-ctrl",
- G_CALLBACK (on_modem_set_dun_pin_ctrl),
- ctx);
-
-
- return TRUE;
-}
-
-gboolean dbus_plugin_modem_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- const struct tresp_modem_set_flightmode *resp_set_flight_mode = data;
- const struct tresp_modem_get_flightmode *resp_get_flight_mode = data;
- const struct tresp_modem_set_dun_pin_control *resp_dun_pin_ctrl = data;
- const struct tresp_modem_get_imei *resp_get_imei = data;
- const struct tresp_modem_get_sn *resp_get_sn = data;
- const struct tresp_modem_get_version *resp_get_version = data;
-
- switch (command) {
- case TRESP_MODEM_SET_FLIGHTMODE:
- dbg("receive TRESP_MODEM_SET_FLIGHTMODE");
- dbg("resp->result = %d", resp_set_flight_mode->result);
- telephony_modem_complete_set_flight_mode(dbus_info->interface_object, dbus_info->invocation, resp_set_flight_mode->result);
- break;
-
- case TRESP_MODEM_GET_FLIGHTMODE:
- dbg("receive TRESP_MODEM_GET_FLIGHTMODE");
- dbg("resp->result = %d", resp_get_flight_mode->result);
- telephony_modem_complete_get_flight_mode(dbus_info->interface_object, dbus_info->invocation, resp_get_flight_mode->enable, resp_get_flight_mode->result);
- break;
-
- case TRESP_MODEM_POWER_ON:
- dbg("receive TRESP_MODEM_POWER_ON");
- telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
- break;
-
- case TRESP_MODEM_POWER_OFF:
- dbg("receive TRESP_MODEM_POWER_OFF");
- telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
- break;
-
- case TRESP_MODEM_POWER_RESET:
- dbg("receive TRESP_MODEM_POWER_RESET");
- telephony_modem_complete_set_power(dbus_info->interface_object, dbus_info->invocation, 0);
- break;
-
- case TRESP_MODEM_GET_IMEI:
- dbg("receive TRESP_MODEM_GET_IMEI");
- telephony_modem_complete_get_imei(dbus_info->interface_object, dbus_info->invocation, resp_get_imei->result, resp_get_imei->imei);
- break;
-
- case TRESP_MODEM_GET_SN:
- dbg("receive TRESP_MODEM_GET_SN");
- telephony_modem_complete_get_serial_number(dbus_info->interface_object, dbus_info->invocation, resp_get_sn->result, resp_get_sn->sn);
- break;
-
- case TRESP_MODEM_GET_VERSION:
- dbg("receive TRESP_MODEM_GET_VERSION");
- telephony_modem_complete_get_version(dbus_info->interface_object, dbus_info->invocation,
- resp_get_version->result,
- resp_get_version->software,
- resp_get_version->hardware,
- resp_get_version->calibration,
- resp_get_version->product_code);
- break;
-
- case TRESP_MODEM_SET_DUN_PIN_CONTROL:
- dbg("receive TRESP_MODEM_SET_DUN_PIN_CONTROL");
- dbg("resp->result = %d", resp_dun_pin_ctrl->result);
- telephony_modem_complete_set_dun_pin_ctrl(dbus_info->interface_object, dbus_info->invocation, resp_dun_pin_ctrl->result);
- break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_modem_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonyModem *modem;
- const struct tnoti_modem_power *info = data;
- const struct tnoti_modem_dun_pin_control *pin = data;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
-
- modem = telephony_object_peek_modem(TELEPHONY_OBJECT(object));
- dbg("modem = %p", modem);
-
- switch (command) {
- case TNOTI_MODEM_POWER:
- dbg("modem->state = %d", info->state);
- telephony_modem_emit_power(modem, info->state);
- telephony_modem_set_power(modem, info->state);
- break;
-
- case TNOTI_MODEM_DUN_PIN_CONTROL:
- dbg("modem dun pin ctrl noti signal(%d), status(%d)", pin->signal, pin->status);
- telephony_modem_emit_dun_pin_ctrl(modem, pin->signal, pin->status);
- break;
-
- case TNOTI_MODEM_DUN_EXTERNAL_CALL:
- dbg("modem dun external call noti");
- telephony_modem_emit_dun_external_call(modem, TRUE);
- break;
-
- case TNOTI_MODEM_ADDED:
- break;
-
- default:
- dbg("not handled command[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_network.h>
-#include <co_sim.h>
-#include <co_ps.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-static inline GVariant *network_build_empty_array()
-{
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- return g_variant_builder_end(&b);
-}
-
-static char *_get_network_name_by_plmn(CoreObject *o, const char *plmn)
-{
- struct tcore_network_operator_info *noi = NULL;
- char mcc[4] = { 0, };
- char mnc[4] = { 0, };
-
- if (!plmn)
- return NULL;
-
- snprintf(mcc, 4, "%s", plmn);
- snprintf(mnc, 4, "%s", plmn+3);
-
- if (mnc[2] == '#')
- mnc[2] = '\0';
-
- noi = tcore_network_operator_info_find(o, mcc, mnc);
- if (noi) {
- dbg("%s-%s: country=[%s], oper=[%s]", mcc, mnc, noi->country, noi->name);
- return noi->name;
- }
- else {
- dbg("%s-%s: no network operator name", mcc, mnc);
- }
-
- return NULL;
-}
-
-
-static enum tcore_hook_return on_hook_location_cellinfo(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
-{
- const struct tnoti_network_location_cellinfo *info = data;
- TelephonyNetwork *network = user_data;
-
- if (!network)
- return TCORE_HOOK_RETURN_CONTINUE;
-
- telephony_network_set_lac(network, info->lac);
- telephony_network_set_cell_id(network, info->cell_id);
-
- return TCORE_HOOK_RETURN_CONTINUE;
-}
-
-static enum tcore_hook_return on_hook_icon_info(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
-{
- const struct tnoti_network_icon_info *info = data;
- TelephonyNetwork *network = user_data;
-
- if (!network)
- return TCORE_HOOK_RETURN_CONTINUE;
-
- telephony_network_set_rssi(network, info->rssi);
-
- return TCORE_HOOK_RETURN_CONTINUE;
-}
-
-static enum tcore_hook_return on_hook_registration_status(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
-{
- const struct tnoti_network_registration_status *info = data;
- TelephonyNetwork *network = user_data;
-
- if (!network)
- return TCORE_HOOK_RETURN_CONTINUE;
-
- telephony_network_set_circuit_status(network, info->cs_domain_status);
- telephony_network_set_packet_status(network, info->ps_domain_status);
- telephony_network_set_service_type(network, info->service_type);
- telephony_network_set_roaming_status(network, info->roaming_status);
-
- switch (info->service_type) {
- case NETWORK_SERVICE_TYPE_UNKNOWN:
- case NETWORK_SERVICE_TYPE_NO_SERVICE:
- telephony_network_set_network_name(network, "No Service");
- break;
-
- case NETWORK_SERVICE_TYPE_EMERGENCY:
- telephony_network_set_network_name(network, "EMERGENCY");
- break;
-
- case NETWORK_SERVICE_TYPE_SEARCH:
- telephony_network_set_network_name(network, "Searching...");
- break;
-
- default:
- break;
- }
-
- return TCORE_HOOK_RETURN_CONTINUE;
-}
-
-static enum tcore_hook_return on_hook_change(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
-{
- const struct tnoti_network_change *info = data;
- TelephonyNetwork *network = user_data;
- struct tcore_network_operator_info *noi = NULL;
- char mcc[4] = { 0, };
- char mnc[4] = { 0, };
- enum telephony_network_service_type svc_type;
- enum tcore_network_name_priority network_name_priority;
- char *tmp;
-
- if (!network)
- return TCORE_HOOK_RETURN_CONTINUE;
-
- telephony_network_set_plmn(network, info->plmn);
- telephony_network_set_lac(network, info->gsm.lac);
-
- snprintf(mcc, 4, "%s", info->plmn);
- snprintf(mnc, 4, "%s", info->plmn+3);
-
- if (mnc[2] == '#')
- mnc[2] = '\0';
-
- tcore_network_get_network_name_priority(source, &network_name_priority);
- telephony_network_set_name_priority(network, network_name_priority);
-
- tmp = tcore_network_get_network_name(source, TCORE_NETWORK_NAME_TYPE_SPN);
- if (tmp) {
- telephony_network_set_spn_name(network, tmp);
- free(tmp);
- }
-
- tcore_network_get_service_type(source, &svc_type);
- switch(svc_type) {
- case NETWORK_SERVICE_TYPE_UNKNOWN:
- case NETWORK_SERVICE_TYPE_NO_SERVICE:
- telephony_network_set_network_name(network, "No Service");
- break;
-
- case NETWORK_SERVICE_TYPE_EMERGENCY:
- telephony_network_set_network_name(network, "EMERGENCY");
- break;
-
- case NETWORK_SERVICE_TYPE_SEARCH:
- telephony_network_set_network_name(network, "Searching...");
- break;
-
- default:
- tmp = tcore_network_get_network_name(source, TCORE_NETWORK_NAME_TYPE_SHORT);
- if (tmp) {
- telephony_network_set_network_name(network, tmp);
- free(tmp);
- }
- else {
- /* pre-defined table */
- noi = tcore_network_operator_info_find(source, mcc, mnc);
- if (noi) {
- dbg("%s-%s: country=[%s], oper=[%s]", mcc, mnc, noi->country, noi->name);
- dbg("NWNAME = pre-define table[%s]", noi->name);
- telephony_network_set_network_name(network, noi->name);
- }
- else {
- dbg("%s-%s: no network operator name", mcc, mnc);
- telephony_network_set_network_name(network, info->plmn);
- }
- }
- break;
- }
-
- return TCORE_HOOK_RETURN_CONTINUE;
-}
-
-static enum tcore_hook_return on_hook_ps_protocol_status(Server *s, CoreObject *source, enum tcore_notification_command command, unsigned int data_len, void *data, void *user_data)
-{
- const struct tnoti_ps_protocol_status *info = data;
- TelephonyNetwork *network = user_data;
-
- if (!network)
- return TCORE_HOOK_RETURN_CONTINUE;
-
- telephony_network_set_network_type(network, info->status);
-
- return TCORE_HOOK_RETURN_CONTINUE;
-}
-
-static gboolean
-on_network_search (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "x") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SEARCH);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- GVariant *network_response = network_build_empty_array();
- telephony_network_complete_search(network, invocation, network_response, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_search_cancel (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "x") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_CANCEL_MANUAL_SEARCH);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_search_cancel(network, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_selection_mode (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PLMN_SELECTION_MODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_get_selection_mode(network, invocation, -1, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_selection_mode (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gint mode,
- const gchar *plmn,
- gint act,
- gpointer user_data)
-{
- struct treq_network_set_plmn_selection_mode req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "w") == FALSE)
- return FALSE;
-
- memset(&req, 0, sizeof(struct treq_network_set_plmn_selection_mode));
-
- if (mode == 0) {
- /* Automatic */
- req.mode = NETWORK_SELECT_MODE_AUTOMATIC;
- }
- else if (mode == 1) {
- /* Manual */
- req.mode = NETWORK_SELECT_MODE_MANUAL;
- snprintf(req.plmn, 7, "%s", plmn);
- if (strlen(plmn) <= 5)
- req.plmn[5] = '#';
- req.act = act;
- }
- else {
- telephony_network_complete_set_selection_mode(network, invocation, -1);
- return TRUE;
- }
-
- dbg("mode = %d, plmn = [%s], act = %d",
- req.mode, req.plmn, req.act);
-
- ur = MAKE_UR(ctx, network, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_plmn_selection_mode), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PLMN_SELECTION_MODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_set_selection_mode(network, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-
-static gboolean
-on_network_set_service_domain (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gint domain,
- gpointer user_data)
-{
- struct treq_network_set_service_domain req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- req.domain = domain;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_service_domain), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_SERVICE_DOMAIN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_set_service_domain(network, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_service_domain (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVICE_DOMAIN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_get_service_domain(network, invocation, -1, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_band (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gint band,
- gint mode,
- gpointer user_data)
-{
- struct treq_network_set_band req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- req.mode = mode;
- req.band = band;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_band), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_BAND);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_set_band(network, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_band (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_BAND);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_get_band(network, invocation, -1, -1, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_mode (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gint mode,
- gpointer user_data)
-{
- struct treq_network_set_mode req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- req.mode = mode;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_mode), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_MODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_set_mode(network, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_mode (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_MODE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_get_mode(network, invocation, -1, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_set_preferred_plmn (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gint mode,
- gint index,
- gint act,
- const gchar *plmn,
- gpointer user_data)
-{
- struct treq_network_set_preferred_plmn req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
-
- req.operation = mode;
- req.index = index;
- req.act = act;
-
- memcpy(req.plmn, plmn, 6);
-
- if (strlen(plmn) <= 5) {
- req.plmn[5] = '#';
- }
-
- tcore_user_request_set_data(ur, sizeof(struct treq_network_set_preferred_plmn), &req);
- tcore_user_request_set_command(ur, TREQ_NETWORK_SET_PREFERRED_PLMN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_set_preferred_plmn(network, invocation, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_preferred_plmn (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_PREFERRED_PLMN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- GVariant *network_response = network_build_empty_array();
- telephony_network_complete_get_preferred_plmn(network, invocation, network_response, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_serving_network (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_SERVING_NETWORK);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_network_complete_get_serving_network(network, invocation, 0, NULL, 0, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_network_get_neighboring_cell_info (TelephonyNetwork *network,
- GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_NETWORK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, network, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_NETWORK_GET_NEIGHBORING_CELL_INFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- GVariant *network_response = network_build_empty_array();
- telephony_network_complete_get_ngbr_cell_info(network, invocation, network_response, ret);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_network_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyNetwork *network;
-
- network = telephony_network_skeleton_new();
- telephony_object_skeleton_set_network(object, network);
- g_object_unref(network);
-
- dbg("network = %p", network);
-
- g_signal_connect (network,
- "handle-search",
- G_CALLBACK (on_network_search),
- ctx);
-
- g_signal_connect (network,
- "handle-search-cancel",
- G_CALLBACK (on_network_search_cancel),
- ctx);
-
- g_signal_connect (network,
- "handle-set-selection-mode",
- G_CALLBACK (on_network_set_selection_mode),
- ctx);
-
- g_signal_connect (network,
- "handle-get-selection-mode",
- G_CALLBACK (on_network_get_selection_mode),
- ctx);
-
- g_signal_connect (network,
- "handle-set-service-domain",
- G_CALLBACK (on_network_set_service_domain),
- ctx);
-
- g_signal_connect (network,
- "handle-get-service-domain",
- G_CALLBACK (on_network_get_service_domain),
- ctx);
-
- g_signal_connect (network,
- "handle-set-band",
- G_CALLBACK (on_network_set_band),
- ctx);
-
- g_signal_connect (network,
- "handle-get-band",
- G_CALLBACK (on_network_get_band),
- ctx);
-
- g_signal_connect (network,
- "handle-set-mode",
- G_CALLBACK (on_network_set_mode),
- ctx);
-
- g_signal_connect (network,
- "handle-get-mode",
- G_CALLBACK (on_network_get_mode),
- ctx);
-
- g_signal_connect (network,
- "handle-set-preferred-plmn",
- G_CALLBACK (on_network_set_preferred_plmn),
- ctx);
-
- g_signal_connect (network,
- "handle-get-preferred-plmn",
- G_CALLBACK (on_network_get_preferred_plmn),
- ctx);
-
- g_signal_connect (network,
- "handle-get-serving-network",
- G_CALLBACK (on_network_get_serving_network),
- ctx);
-
- g_signal_connect (network,
- "handle-get-ngbr-cell-info",
- G_CALLBACK (on_network_get_neighboring_cell_info),
- ctx);
-
- tcore_server_add_notification_hook(ctx->server, TNOTI_NETWORK_LOCATION_CELLINFO, on_hook_location_cellinfo, network);
- tcore_server_add_notification_hook(ctx->server, TNOTI_NETWORK_ICON_INFO, on_hook_icon_info, network);
- tcore_server_add_notification_hook(ctx->server, TNOTI_NETWORK_REGISTRATION_STATUS, on_hook_registration_status, network);
- tcore_server_add_notification_hook(ctx->server, TNOTI_NETWORK_CHANGE, on_hook_change, network);
- tcore_server_add_notification_hook(ctx->server, TNOTI_PS_PROTOCOL_STATUS, on_hook_ps_protocol_status, network);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_network_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- const struct tresp_network_search *resp_network_search = data;
- const struct tresp_network_set_cancel_manual_search *resp_set_cancel_manual_search = data;
- const struct tresp_network_get_plmn_selection_mode *resp_get_plmn_selection_mode = data;
- const struct tresp_network_set_plmn_selection_mode *resp_set_plmn_selection_mode = data;
- const struct tresp_network_set_service_domain *resp_set_service_domain = data;
- const struct tresp_network_get_service_domain *resp_get_service_domain = data;
- const struct tresp_network_set_band *resp_set_band = data;
- const struct tresp_network_get_band *resp_get_band = data;
- const struct tresp_network_set_preferred_plmn *resp_set_preferred_plmn = data;
- const struct tresp_network_get_preferred_plmn *resp_get_preferred_plmn = data;
- const struct tresp_network_get_serving_network *resp_get_serving_network = data;
- const struct tresp_network_set_mode *resp_set_mode = data;
- const struct tresp_network_get_mode *resp_get_mode = data;
- const struct tresp_network_get_neighboring_cell_info *resp_get_ngbr_cell_info = data;
-
- int i = 0;
- char *buf;
-
- CoreObject *co_network;
- char *modem_name = NULL;
- TcorePlugin *p = NULL;
-
- modem_name = tcore_user_request_get_modem_name(ur);
- if (!modem_name)
- return FALSE;
-
- p = tcore_server_find_plugin(ctx->server, modem_name);
- free(modem_name);
- if (!p)
- return FALSE;
-
- co_network = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_NETWORK);
- if (!co_network)
- return FALSE;
-
- switch (command) {
- case TRESP_NETWORK_SEARCH: {
- GVariant *result = NULL;
- GVariantBuilder b;
-
- dbg("receive TRESP_NETWORK_SEARCH");
- dbg("resp->result = %d", resp_network_search->result);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i = 0; i < resp_network_search->list_count; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
- g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string(resp_network_search->list[i].plmn));
- g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(resp_network_search->list[i].act));
- g_variant_builder_add(&b, "{sv}", "type", g_variant_new_int32(resp_network_search->list[i].status));
-
- if (strlen(resp_network_search->list[i].name) > 0) {
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_network_search->list[i].name));
- }
- else {
- buf = _get_network_name_by_plmn(co_network, resp_network_search->list[i].plmn);
- if (buf)
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(buf));
- else
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(resp_network_search->list[i].plmn));
- }
-
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_network_complete_search(dbus_info->interface_object, dbus_info->invocation, result, resp_network_search->result);
- }
-
- break;
-
- case TRESP_NETWORK_SET_PLMN_SELECTION_MODE:
- dbg("receive TRESP_SET_PLMN_SELECTION_MODE");
- dbg("resp->result = %d", resp_set_plmn_selection_mode->result);
- telephony_network_complete_set_selection_mode(dbus_info->interface_object, dbus_info->invocation, resp_set_plmn_selection_mode->result);
- break;
-
- case TRESP_NETWORK_GET_PLMN_SELECTION_MODE:
- dbg("receive TRESP_GET_PLMN_SELECTION_MODE");
- dbg("resp->mode = %d", resp_get_plmn_selection_mode->mode);
- switch (resp_get_plmn_selection_mode->mode) {
- case NETWORK_SELECT_MODE_AUTOMATIC:
- telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, 0, resp_get_plmn_selection_mode->result);
- break;
-
- case NETWORK_SELECT_MODE_MANUAL:
- telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, 1, resp_get_plmn_selection_mode->result);
- break;
-
- default:
- telephony_network_complete_get_selection_mode(dbus_info->interface_object, dbus_info->invocation, -1, resp_get_plmn_selection_mode->result);
- break;
- }
- break;
-
- case TRESP_NETWORK_SET_SERVICE_DOMAIN:
- dbg("receive TRESP_NETWORK_SET_SERVICE_DOMAIN");
- dbg("resp->result = %d", resp_set_service_domain->result);
- telephony_network_complete_set_service_domain(dbus_info->interface_object, dbus_info->invocation, resp_set_service_domain->result);
- break;
-
- case TRESP_NETWORK_GET_SERVICE_DOMAIN:
- dbg("receive TRESP_NETWORK_GET_SERVICE_DOMAIN");
- dbg("resp->domain = %d", resp_get_service_domain->domain);
- telephony_network_complete_get_service_domain(dbus_info->interface_object, dbus_info->invocation, resp_get_service_domain->domain, resp_get_service_domain->result);
- break;
-
- case TRESP_NETWORK_SET_BAND:
- dbg("receive TRESP_NETWORK_SET_BAND");
- dbg("resp->result = %d", resp_set_band->result);
- telephony_network_complete_set_band(dbus_info->interface_object, dbus_info->invocation, resp_set_band->result);
- break;
-
- case TRESP_NETWORK_GET_BAND:
- dbg("receive TRESP_NETWORK_GET_BAND");
- dbg("resp->mode = %d", resp_get_band->mode);
- dbg("resp->band = %d", resp_get_band->band);
- telephony_network_complete_get_band(dbus_info->interface_object, dbus_info->invocation, resp_get_band->band, resp_get_band->mode, resp_get_band->result);
- break;
-
- case TRESP_NETWORK_SET_MODE:
- dbg("receive TRESP_NETWORK_SET_MODE");
- dbg("resp->result = %d", resp_set_mode->result);
- telephony_network_complete_set_mode(dbus_info->interface_object, dbus_info->invocation, resp_set_mode->result);
- break;
-
- case TRESP_NETWORK_GET_MODE:
- dbg("receive TRESP_NETWORK_GET_MODE");
- dbg("resp->mode = %d", resp_get_mode->mode);
- telephony_network_complete_get_mode(dbus_info->interface_object, dbus_info->invocation, resp_get_mode->mode, resp_get_mode->result);
- break;
-
- case TRESP_NETWORK_GET_NEIGHBORING_CELL_INFO:
- {
- GVariant *result = NULL;
- GVariant *value = NULL;
- GVariantBuilder b;
-
- dbg("receive TRESP_NETWORK_GET_NEIGHBORING_CELL_INFO. result=%d", resp_get_ngbr_cell_info->result);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i = 0; i < resp_get_ngbr_cell_info->info.geran_list_count; i++) {
- value = g_variant_new("(iiiii)", resp_get_ngbr_cell_info->info.geran_list[i].cell_id,
- resp_get_ngbr_cell_info->info.geran_list[i].lac,
- resp_get_ngbr_cell_info->info.geran_list[i].bcch,
- resp_get_ngbr_cell_info->info.geran_list[i].bsic,
- resp_get_ngbr_cell_info->info.geran_list[i].rxlev);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "geran", value);
- g_variant_builder_close(&b);
- }
-
- for (i = 0; i < resp_get_ngbr_cell_info->info.umts_list_count; i++) {
- value = g_variant_new("(iiiii)", resp_get_ngbr_cell_info->info.umts_list[i].cell_id,
- resp_get_ngbr_cell_info->info.umts_list[i].lac,
- resp_get_ngbr_cell_info->info.umts_list[i].arfcn,
- resp_get_ngbr_cell_info->info.umts_list[i].psc,
- resp_get_ngbr_cell_info->info.umts_list[i].rscp);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "umts", value);
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
- telephony_network_complete_get_ngbr_cell_info(dbus_info->interface_object, dbus_info->invocation, result, resp_get_ngbr_cell_info->result);
- }
- break;
-
- case TRESP_NETWORK_SET_PREFERRED_PLMN:
- dbg("receive TRESP_NETWORK_SET_PREFERRED_PLMN");
- dbg("resp->result = %d", resp_set_preferred_plmn->result);
- telephony_network_complete_set_preferred_plmn(dbus_info->interface_object, dbus_info->invocation, resp_set_preferred_plmn->result);
- break;
-
- case TRESP_NETWORK_GET_PREFERRED_PLMN:
- dbg("receive TRESP_NETWORK_GET_PREFERRED_PLMN");
- dbg("resp->result = %d", resp_get_preferred_plmn->result);
- {
- GVariant *result = NULL;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i = 0; i < resp_get_preferred_plmn->list_count; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
- g_variant_builder_add(&b, "{sv}", "plmn",
- g_variant_new_string(resp_get_preferred_plmn->list[i].plmn));
- g_variant_builder_add(&b, "{sv}", "act", g_variant_new_int32(resp_get_preferred_plmn->list[i].act));
- g_variant_builder_add(&b, "{sv}", "index",
- g_variant_new_int32(resp_get_preferred_plmn->list[i].index));
-
- buf = _get_network_name_by_plmn(co_network, resp_get_preferred_plmn->list[i].plmn);
- if (buf)
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(buf));
- else
- g_variant_builder_add(&b, "{sv}", "name",
- g_variant_new_string(resp_get_preferred_plmn->list[i].plmn));
-
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_network_complete_get_preferred_plmn(dbus_info->interface_object, dbus_info->invocation,
- result, resp_get_preferred_plmn->result);
- }
- break;
-
- case TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH:
- dbg("receive TRESP_NETWORK_SET_CANCEL_MANUAL_SEARCH");
- dbg("resp->result = %d", resp_set_cancel_manual_search->result);
- telephony_network_complete_search_cancel(dbus_info->interface_object, dbus_info->invocation, resp_set_cancel_manual_search->result);
- break;
-
- case TRESP_NETWORK_GET_SERVING_NETWORK:
- dbg("receive TRESP_NETWORK_GET_SERVING_NETWORK");
- dbg("resp->act = %d", resp_get_serving_network->act);
- dbg("resp->plmn = %s", resp_get_serving_network->plmn);
- dbg("resp->lac = %d", resp_get_serving_network->gsm.lac);
- telephony_network_complete_get_serving_network(dbus_info->interface_object, dbus_info->invocation,
- resp_get_serving_network->act,
- resp_get_serving_network->plmn,
- resp_get_serving_network->gsm.lac,
- resp_get_serving_network->result);
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_network_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonyNetwork *network;
- const struct tnoti_network_registration_status *registration = data;
- const struct tnoti_network_change *change = data;
- const struct tnoti_network_icon_info *icon_info = data;
- const struct tnoti_network_timeinfo *time_info = data;
- const struct tnoti_network_identity *identity = data;
- const struct tnoti_network_location_cellinfo *location = data;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
-
- network = telephony_object_peek_network(TELEPHONY_OBJECT(object));
- dbg("network = %p", network);
-
- switch (command) {
- case TNOTI_NETWORK_REGISTRATION_STATUS:
- telephony_network_emit_registration_status(network,
- registration->cs_domain_status,
- registration->ps_domain_status,
- registration->service_type,
- registration->roaming_status);
- break;
-
- case TNOTI_NETWORK_CHANGE:
- telephony_network_emit_change(network,
- change->act,
- change->plmn,
- change->gsm.lac);
- break;
-
- case TNOTI_NETWORK_ICON_INFO:
- telephony_network_emit_info(network,
- icon_info->rssi,
- icon_info->battery);
- break;
-
- case TNOTI_NETWORK_TIMEINFO:
- telephony_network_emit_time_info(network,
- time_info->year,
- time_info->month,
- time_info->day,
- time_info->hour,
- time_info->minute,
- time_info->second,
- time_info->wday,
- time_info->gmtoff,
- time_info->dstoff,
- time_info->isdst,
- time_info->plmn);
- break;
-
- case TNOTI_NETWORK_IDENTITY:
- telephony_network_emit_identity(network,
- identity->plmn,
- identity->short_name,
- identity->full_name);
- break;
-
- case TNOTI_NETWORK_LOCATION_CELLINFO:
- telephony_network_emit_cell_info(network,
- location->lac,
- location->cell_id);
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <glib-object.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_phonebook.h>
-#include <co_sim.h>
-
-#include "generated-code.h"
-#include "common.h"
-#include "sat_manager.h"
-
-static char* dbg_dbus_pb_type_name[] = {"PB_TYPE_FDN", "PB_TYPE_ADN", "PB_TYPE_SDN",
- "PB_TYPE_USIM", "PB_TYPE_AAS", "PB_TYPE_GAS", };
-static char* dbg_dbus_pb_adf_field_name[] = { "NO VALUE 0", "PB_FIELD_NAME", "PB_FIELD_NUMBER",
- "PB_FIELD_ANR1", "PB_FIELD_ANR2", "PB_FIELD_ANR3", "PB_FIELD_EMAIL1",
- "PB_FIELD_EMAIL2", "PB_FIELD_EMAIL3", "PB_FIELD_EMAIL4", "PB_FIELD_SNE",
- "PB_FIELD_GRP", "PB_FIELD_PBC" };
-static char* dbg_dbus_pb_ton_name[] = { "PB_TON_UNKNOWN", "PB_TON_INTERNATIONAL",
- "PB_TON_NATIONAL", "PB_TON_NETWORK_SPECIFIC", "PB_TON_DEDICATED_ACCESS",
- "PB_TON_ALPHA_NUMERIC", "PB_TON_ABBREVIATED_NUMBER",
- "PB_TON_RESERVED_FOR_EXT", };
-static char* dbg_dbus_pb_dcs_name[] = { "PB_TEXT_ASCII", "PB_TEXT_GSM7BIT",
- "PB_TEXT_UCS2", "PB_TEXT_HEX", };
-
-static gboolean on_phonebook_get_init_status(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- gboolean pb_status = FALSE;
- struct tel_phonebook_support_list *list = NULL;
- CoreObject *co_pb = NULL;
- TcorePlugin *plugin = NULL;
- char *cp_name = GET_PLUGIN_NAME(invocation);
-
- if (check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
- return FALSE;
-
- dbg("Func Entrance");
-
- plugin = tcore_server_find_plugin(ctx->server, cp_name);
- co_pb = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_PHONEBOOK);
- if (!co_pb) {
- dbg("error- co_pb is NULL");
- return FALSE;
- }
-
- pb_status = tcore_phonebook_get_status(co_pb);
- list = tcore_phonebook_get_support_list(co_pb);
-
- dbg("list->b_fdn[%d]",list->b_fdn);
- dbg("list->b_adn[%d]",list->b_adn);
- dbg("list->b_sdn[%d]",list->b_sdn);
- dbg("list->b_usim[%d]",list->b_usim);
- dbg("list->b_aas[%d]",list->b_aas);
- dbg("list->b_gas[%d]",list->b_gas);
-
- telephony_phonebook_complete_get_init_status(phonebook, invocation,
- pb_status,
- list->b_fdn,
- list->b_adn,
- list->b_sdn,
- list->b_usim,
- list->b_aas,
- list->b_gas);
-
- g_free(list);
-
- return TRUE;
-}
-
-static gboolean on_phonebook_get_count(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gint arg_req_type, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_get_count pb_count;
-
- if (check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- memset(&pb_count, 0, sizeof(struct treq_phonebook_get_count));
-
- pb_count.phonebook_type = arg_req_type;
- dbg("req phonebook_type[%d][%s]", pb_count.phonebook_type, dbg_dbus_pb_type_name[pb_count.phonebook_type]);
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_count), &pb_count);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETCOUNT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_phonebook_complete_get_count(phonebook, invocation, PB_FAIL, 0, 0, 0);
- tcore_user_request_unref(ur);
- }
- return TRUE;
-}
-
-static gboolean on_phonebook_get_info(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gint arg_req_type, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_get_info pb_info;
-
- if (check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- memset(&pb_info, 0, sizeof(struct treq_phonebook_get_info));
-
- pb_info.phonebook_type = arg_req_type;
- dbg("req phonebook_type[%d][%s]", pb_info.phonebook_type, dbg_dbus_pb_type_name[pb_info.phonebook_type]);
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_get_info), &pb_info);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETMETAINFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_phonebook_complete_get_info(phonebook, invocation, PB_FAIL, 0, 0, 0, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_phonebook_get_usim_info(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- tcore_user_request_set_data(ur, 0, NULL);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_GETUSIMINFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariant *gv = NULL;
- GVariantBuilder b;
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv = g_variant_builder_end(&b);
- telephony_phonebook_complete_get_usim_meta_info (phonebook, invocation, PB_FAIL, gv);
- g_variant_unref(gv);
- tcore_user_request_unref(ur);
- }
- return TRUE;
-}
-
-static gboolean on_phonebook_read_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
- gint arg_req_type, gint arg_index, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_read_record pb_read;
-
- if (check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- memset(&pb_read, 0, sizeof(struct treq_phonebook_read_record));
-
- pb_read.index = (unsigned short)arg_index;
- pb_read.phonebook_type = arg_req_type;
- dbg("req phonebook_type[%d][%s]", pb_read.phonebook_type, dbg_dbus_pb_type_name[pb_read.phonebook_type]);
- dbg("req index[%d]", pb_read.index);
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_read_record), &pb_read);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_READRECORD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_phonebook_complete_read_record(phonebook, invocation, PB_FAIL,
- 0, 0, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, 0, NULL, NULL, NULL, NULL, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_phonebook_update_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
- gint arg_type, gint arg_index, const gchar *arg_name, gint arg_dcs,
- const gchar *arg_number, gint arg_ton,
- const gchar *arg_sne, gint arg_sne_dcs,
- const gchar *arg_number2, gint arg_number2_ton,
- const gchar *arg_number3,gint arg_number3_ton, const gchar *arg_number4, gint arg_number4_ton,
- const gchar *arg_email1, const gchar *arg_email2, const gchar *arg_email3, const gchar *arg_email4,
- gint arg_group_index, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_update_record pb_update;
- int i=0;
- int dest_len = 0;
- int temp_len = 0;
-
- if (check_access_control(invocation, AC_PHONEBOOK, "r") == FALSE)
- return FALSE;
-
- memset(&pb_update, 0, sizeof(struct treq_phonebook_update_record));
-
- dbg("arg_type[%d]",arg_type);
- dbg("arg_index[%d]",arg_index);
- dbg("arg_name[%s]",arg_name);
- dbg("arg_dcs[%d]",arg_dcs);
- dbg("arg_number[%s]",arg_number);
- dbg("arg_ton[%d]",arg_ton);
-
- if(arg_type == PB_TYPE_USIM) {
- dbg("arg_sne[%s]",arg_sne);
- dbg("arg_sne_dcs[%d]",arg_sne_dcs);
- dbg("arg_number2[%s]",arg_number2 );
- dbg("arg_number2_ton[%d]",arg_number2_ton );
- dbg("arg_number3[%s]",arg_number3 );
- dbg("arg_number3_ton[%d]",arg_number3_ton );
- dbg("arg_number4[%s]",arg_number4 );
- dbg("arg_number4_ton[%d]",arg_number4_ton );
- dbg("arg_email1[%s]",arg_email1 );
- dbg("arg_email2[%s]",arg_email2 );
- dbg("arg_email3[%s]",arg_email3 );
- dbg("arg_email4[%s]",arg_email4 );
- dbg("arg_group_index[%d]",arg_group_index );
- //dbg("arg_pb_control[%d]",arg_pb_control );
- }
-
- pb_update.index = (unsigned short)arg_index;
- pb_update.phonebook_type = arg_type;
- dbg("req phonebook_type[%d][%s]", pb_update.phonebook_type, dbg_dbus_pb_type_name[pb_update.phonebook_type]);
- dbg("req index[%d]", pb_update.index);
-
- if(arg_name != NULL && (temp_len=strlen(arg_name))){
- dest_len = 0;
-
- if(tcore_util_convert_utf8_to_gsm(pb_update.name, &dest_len, (unsigned char*)arg_name, temp_len)) {
- pb_update.dcs = PB_TEXT_GSM7BIT;
- pb_update.name_len = temp_len;
- dbg("arg_name is converted successfully.");
- dbg("pb_update.name=[%s]", pb_update.name);
- }
- else if(tcore_util_convert_utf8_to_ucs2(pb_update.name, &dest_len, (unsigned char*)arg_name, temp_len)) {
- //swap string to a little-endian ucs2 string. ex) ABC : 41 00 42 00 43 00
- unsigned short *src = NULL, *dest = NULL;
- src = (unsigned short*)malloc(dest_len);
- dest = (unsigned short*)malloc(dest_len);
- if(src==NULL || dest==NULL) {
- dbg("malloc is failed.");
- return FALSE;
- }
- memcpy(src, pb_update.name, dest_len);
- tcore_util_swap_byte_order(dest, src, dest_len/2);
- memcpy(pb_update.name, dest, dest_len);
- if(src!=NULL) free(src);
- if(dest!=NULL) free(dest);
-
- pb_update.dcs = PB_TEXT_UCS2;
- pb_update.name_len = dest_len;
- dbg("arg_name is converted successfully.");
- for(i=0; i<pb_update.name_len; i++) {
- dbg("pb_update.name[%d]=[%02x]", i, pb_update.name[i]);
- }
- }
- else {
- dbg("converting arg_name is failed.");
- return FALSE;
- }
- }
- if(arg_sne != NULL && (temp_len=strlen(arg_sne))){
- dest_len = 0;
- if(tcore_util_convert_utf8_to_gsm(pb_update.sne, &dest_len, (unsigned char*)arg_sne, temp_len)) {
- pb_update.sne_dcs = PB_TEXT_GSM7BIT;
- pb_update.sne_len = temp_len;
- dbg("arg_sne is converted successfully.");
- dbg("pb_update.sne=[%s]", pb_update.sne);
- }
- else if(tcore_util_convert_utf8_to_ucs2(pb_update.sne, &dest_len, (unsigned char*)arg_sne, temp_len)) {
- //swap string to a little-endian ucs2 string. ex) ABC : 41 00 42 00 43 00
- unsigned short *src = NULL, *dest = NULL;
- src = (unsigned short*)malloc(dest_len);
- dest = (unsigned short*)malloc(dest_len);
- if(src==NULL || dest==NULL) {
- dbg("malloc is failed.");
- return FALSE;
- }
- memcpy(src, pb_update.sne, dest_len);
- tcore_util_swap_byte_order(dest, src, dest_len/2);
- memcpy(pb_update.sne, dest, dest_len);
- if(src!=NULL) free(src);
- if(dest!=NULL) free(dest);
-
- pb_update.sne_dcs = PB_TEXT_UCS2;
- pb_update.sne_len = dest_len;
- dbg("arg_sne is converted successfully.");
- for(i=0; i<pb_update.sne_len; i++) {
- dbg("pb_update.sne[%d]=[%02x]", i, pb_update.sne[i]);
- }
- }
- else {
- dbg("converting arg_sne is failed.");
- return FALSE;
- }
- }
- if(arg_number != NULL && (temp_len=strlen(arg_number))){
- dest_len = 0;
- if(arg_number[0]=='+') {
- dbg("arg_number[0] is '+'. TON should be a INTERNATIONAL number.");
- arg_number++;
- temp_len--;
- pb_update.ton = PB_TON_INTERNATIONAL;
- }
- else {
- pb_update.ton = arg_ton;
- }
- if(tcore_util_convert_utf8_to_gsm(pb_update.number, &dest_len, (unsigned char*)arg_number, temp_len) == FALSE) {
- return FALSE;
- }
- dbg("arg_number is converted successfully.");
- dbg("pb_update.number=[%s]", pb_update.number);
- }
- if(arg_number2 != NULL && (temp_len=strlen(arg_number2))){
- dest_len = 0;
- if(arg_number2[0]=='+') {
- dbg("arg_number[0] is '+'. TON should be a INTERNATIONAL number.");
- arg_number2++;
- temp_len--;
- pb_update.anr1_ton = PB_TON_INTERNATIONAL;
- }
- else {
- pb_update.anr1_ton = arg_number2_ton;
- }
- if(tcore_util_convert_utf8_to_gsm(pb_update.anr1, &dest_len, (unsigned char*)arg_number2, temp_len) == FALSE) {
- return FALSE;
- }
- dbg("arg_number2 is converted successfully.");
- dbg("pb_update.anr1=[%s]", pb_update.anr1);
- }
-
- if(arg_number3 != NULL && (temp_len=strlen(arg_number3))){
- dest_len = 0;
- if(arg_number3[0]=='+') {
- dbg("arg_number[0] is '+'. TON should be a INTERNATIONAL number.");
- arg_number3++;
- temp_len--;
- pb_update.anr2_ton = PB_TON_INTERNATIONAL;
- }
- else {
- pb_update.anr2_ton = arg_number3_ton;
- }
- if(tcore_util_convert_utf8_to_gsm(pb_update.anr2, &dest_len, (unsigned char*)arg_number3, temp_len) == FALSE) {
- return FALSE;
- }
- dbg("arg_number3 is converted successfully.");
- dbg("pb_update.anr2=[%s]", pb_update.anr2);
- }
-
- if(arg_number4 != NULL && (temp_len=strlen(arg_number4))){
- dest_len = 0;
- if(arg_number4[0]=='+') {
- dbg("arg_number[0] is '+'. TON should be a INTERNATIONAL number.");
- arg_number4++;
- temp_len--;
- pb_update.anr3_ton = PB_TON_INTERNATIONAL;
- }
- else {
- pb_update.anr3_ton = arg_number4_ton;
- }
- if(tcore_util_convert_utf8_to_gsm(pb_update.anr3, &dest_len, (unsigned char*)arg_number4, temp_len) == FALSE) {
- return FALSE;
- }
- dbg("arg_number4 is converted successfully.");
- dbg("pb_update.anr3=[%s]", pb_update.anr3);
- }
-
- if(arg_email1 != NULL && (temp_len=strlen(arg_email1))){
- dest_len = 0;
- if(tcore_util_convert_utf8_to_gsm(pb_update.email1, &dest_len, (unsigned char*)arg_email1, temp_len) == FALSE) {
- return FALSE;
- }
- pb_update.email1_len = dest_len;
- dbg("arg_email1 is converted successfully.");
- for(i=0; i<pb_update.email1_len; i++) {
- dbg("pb_update.email1[%d]=[%02x]", i, pb_update.email1[i]);
- }
- }
-
- /*doesn't support additional e-mail fields in CP team*/
- /*
- if(arg_email2 != NULL && (temp_len=strlen(arg_email2))){
- dest_len = 0;
- if(tcore_util_convert_utf8_to_gsm(pb_update.email2, &dest_len, (unsigned char*) arg_email2, strlen(arg_email2)) == FALSE) {
- return FALSE;
- }
- pb_update.email2_len = dest_len;
- dbg("arg_email2 is converted successfully.")
- for(i=0; i<pb_update.email2_len; i++) {
- dbg("pb_update.email2[%d]=[%02x]", i, pb_update.email2[i]);
- }
- }
-
- if(arg_email3 != NULL && (temp_len=strlen(arg_email3))){
- dest_len = 0;
- if(tcore_util_convert_utf8_to_gsm(pb_update.email3, &dest_len, (unsigned char*)arg_email3, strlen(arg_email3)) == FALSE) {
- return FALSE;
- }
- pb_update.email3_len = dest_len;
- dbg("arg_email3 is converted successfully.")
- for(i=0; i<pb_update.email3_len; i++) {
- dbg("pb_update.email3[%d]=[%02x]", i, pb_update.email3[i]);
- }
- }
-
- if(arg_email4 != NULL && (temp_len=strlen(arg_email4))){
- dest_len = 0;
- if(tcore_util_convert_utf8_to_gsm(pb_update.email4, &dest_len, (unsigned char*)arg_email4, strlen(arg_email4)) == FALSE) {
- return FALSE;
- }
- pb_update.email4_len = dest_len;
- dbg("arg_email4 is converted successfully.")
- for(i=0; i<pb_update.email4_len; i++) {
- dbg("pb_update.email4[%d]=[%02x]", i, pb_update.email4[i]);
- }
- }
- */
-
- pb_update.group_index = (unsigned short)arg_group_index;
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_update_record), &pb_update);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_UPDATERECORD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_phonebook_complete_update_record(phonebook, invocation, PB_FAIL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_phonebook_delete_record(TelephonyPhonebook *phonebook, GDBusMethodInvocation *invocation,
- gint arg_type, gint arg_index, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_phonebook_delete_record pb_delete;
-
- if (check_access_control(invocation, AC_PHONEBOOK, "x") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, phonebook, invocation);
- memset(&pb_delete, 0, sizeof(struct treq_phonebook_delete_record));
-
- pb_delete.index = (unsigned short)arg_index;
- pb_delete.phonebook_type = arg_type;
- dbg("req phonebook_type[%d][%s]", pb_delete.phonebook_type, dbg_dbus_pb_type_name[pb_delete.phonebook_type]);
- dbg("req index[%d]", pb_delete.index);
- tcore_user_request_set_data(ur, sizeof(struct treq_phonebook_delete_record), &pb_delete);
- tcore_user_request_set_command(ur, TREQ_PHONEBOOK_DELETERECORD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_phonebook_complete_delete_record(phonebook, invocation, PB_FAIL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_phonebook_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonyPhonebook *phonebook;
-
- phonebook = telephony_phonebook_skeleton_new();
- telephony_object_skeleton_set_phonebook(object, phonebook);
- g_object_unref(phonebook);
-
- dbg("phonebook = %p", phonebook);
-
- g_signal_connect (phonebook,
- "handle-get-init-status",
- G_CALLBACK (on_phonebook_get_init_status),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-get-count",
- G_CALLBACK (on_phonebook_get_count),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-get-info",
- G_CALLBACK (on_phonebook_get_info),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-get-usim-meta-info",
- G_CALLBACK (on_phonebook_get_usim_info),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-read-record",
- G_CALLBACK (on_phonebook_read_record),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-update-record",
- G_CALLBACK (on_phonebook_update_record),
- ctx);
-
- g_signal_connect (phonebook,
- "handle-delete-record",
- G_CALLBACK (on_phonebook_delete_record),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_phonebook_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- const struct tresp_phonebook_get_count *resp_pbcnt = data;
- const struct tresp_phonebook_get_info *resp_entry = data;
- const struct tresp_phonebook_get_usim_info *resp_capa = data;
- const struct tresp_phonebook_read_record *resp_pbread = data;
- const struct tresp_phonebook_update_record *resp_pbupdate = data;
- const struct tresp_phonebook_delete_record *resp_pbdelete = data;
-
- dbg("application command = [0x%x], data_len = %d", command, data_len);
-
- switch (command) {
- case TRESP_PHONEBOOK_GETCOUNT:
- dbg("dbus comm - TRESP_PHONEBOOK_GETCOUNT");
- dbg("resp pb type[%d][%s]", resp_pbcnt->type, dbg_dbus_pb_type_name[resp_pbcnt->type]);
- dbg("used[%d]total[%d]", resp_pbcnt->used_count, resp_pbcnt->total_count);
- telephony_phonebook_complete_get_count(dbus_info->interface_object, dbus_info->invocation,
- resp_pbcnt->result, resp_pbcnt->type, resp_pbcnt->used_count, resp_pbcnt->total_count);
- break;
-
- case TRESP_PHONEBOOK_GETMETAINFO:
- dbg("dbus comm - TRESP_PHONEBOOK_GETMETAINFO");
- dbg("resp pb type[%d][%s]", resp_entry->type, dbg_dbus_pb_type_name[resp_entry->type]);
- dbg("index min[%d]max[%d], num len max[%d] text len max[%d]", resp_entry->index_min, resp_entry->index_max, resp_entry->number_length_max, resp_entry->text_length_max);
- telephony_phonebook_complete_get_info(dbus_info->interface_object, dbus_info->invocation,
- resp_entry->result, resp_entry->type, resp_entry->index_min, resp_entry->index_max,
- resp_entry->number_length_max, resp_entry->text_length_max);
- break;
-
- case TRESP_PHONEBOOK_GETUSIMINFO:{
- GVariant *gv = NULL;
- GVariantBuilder b;
- int i;
- dbg("resp comm - TRESP_PHONEBOOK_GETUSIMINFO");
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for(i=0;i < resp_capa->field_count; i++){
- g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
- dbg("resp pb field type[%d][%s]", resp_capa->field_list[i].field, dbg_dbus_pb_adf_field_name[resp_capa->field_list[i].field]);
- dbg("field_type[%d], index_max[%d], text_max[%d], used_count[%d]", resp_capa->field_list[i].field, resp_capa->field_list[i].index_max, resp_capa->field_list[i].text_max, resp_capa->field_list[i].used_count);
- g_variant_builder_add(&b, "{sv}", "field_type", g_variant_new_int32(resp_capa->field_list[i].field));
- g_variant_builder_add(&b, "{sv}", "index_max", g_variant_new_int32(resp_capa->field_list[i].index_max));
- g_variant_builder_add(&b, "{sv}", "text_max", g_variant_new_int32(resp_capa->field_list[i].text_max));
- g_variant_builder_add(&b, "{sv}", "used_count", g_variant_new_int32(resp_capa->field_list[i].used_count));
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- telephony_phonebook_complete_get_usim_meta_info (dbus_info->interface_object, dbus_info->invocation,
- resp_capa->result,
- gv);
- g_variant_unref(gv);
- }
- break;
-
- case TRESP_PHONEBOOK_READRECORD: {
- unsigned char dest_pb_name[256];
- unsigned short dest_pb_name_len = 0;
- unsigned char dest_pb_sne[256];
- unsigned short dest_pb_sne_len = 0;
- unsigned char dest_pb_email1[256];
- unsigned short dest_pb_email1_len = 0;
- int i=0;
-
- memset(dest_pb_name, 0x00, sizeof(unsigned char)*256);
- memset(dest_pb_sne, 0x00, sizeof(unsigned char)*256);
- memset(dest_pb_email1, 0x00, sizeof(unsigned char)*256);
-
- dbg("dbus comm - TRESP_PHONEBOOK_READRECORD");
- dbg("resp_pbread->type[%d][%s]", resp_pbread->phonebook_type, dbg_dbus_pb_type_name[resp_pbread->phonebook_type]);
- dbg("resp_pbread->index[%d]",resp_pbread->index );
- dbg("resp_pbread->next_index[%d]",resp_pbread->next_index );
- dbg("resp_pbread->name_len[%d]",resp_pbread->name_len);
- for(i=0; i<resp_pbread->name_len; i++)
- dbg("resp_pbread->name[%02d][0x%02x]", i, resp_pbread->name[i]);
- dbg("resp_pbread->dcs[%d][%s]",resp_pbread->dcs, dbg_dbus_pb_dcs_name[resp_pbread->dcs] );
-
- if(resp_pbread->name_len>0) {
- switch(resp_pbread->dcs) {
- case PB_TEXT_ASCII:
- case PB_TEXT_GSM7BIT:
- // should implement differently whether ASCII or GSM7BIT LATER
- tcore_util_convert_string_to_utf8(dest_pb_name, &dest_pb_name_len, ALPHABET_FORMAT_8BIT_DATA, resp_pbread->name, resp_pbread->name_len);
- break;
- case PB_TEXT_UCS2: {
- //swap a little-endian ucs2 string to BIG-ENDIAN UCS2 string
- unsigned short *src = NULL, *dest = NULL;
- src = (unsigned short*)malloc(resp_pbread->name_len);
- if (NULL == src){
- dbg("src alloc is failed!");
- return FALSE;
- }
- dest = (unsigned short*)malloc(resp_pbread->name_len);
- if (NULL == dest) {
- dbg("dest alloc is failed!");
- free(src);
- return FALSE;
- }
- memcpy(src, resp_pbread->name, resp_pbread->name_len);
- tcore_util_swap_byte_order(dest, src, resp_pbread->name_len/2);
- for(i=0; i<resp_pbread->name_len; i++)
- dbg("after swap : resp_pbread->name[%02d][0x%02x]", i, dest[i]);
- tcore_util_convert_string_to_utf8(dest_pb_name, &dest_pb_name_len, ALPHABET_FORMAT_UCS2, (unsigned char*)dest, resp_pbread->name_len);
- free(src);
- free(dest);
- } break;
- default:
- tcore_util_convert_string_to_utf8(dest_pb_name, &dest_pb_name_len, 0xff , resp_pbread->name, resp_pbread->name_len);
- break;
- }
- }
-
- dbg("resp_pbread->number[%s]",resp_pbread->number );
- dbg("resp_pbread->ton[%d][%s]",resp_pbread->ton, dbg_dbus_pb_ton_name[resp_pbread->ton] );
-
- if(resp_pbread->phonebook_type == PB_TYPE_USIM) {
- dbg("resp_pbread->sne_len[%d]",resp_pbread->sne_len);
- for(i=0; i<resp_pbread->sne_len; i++)
- dbg("resp_pbread->sne[%02d][0x%02x]", i, resp_pbread->sne[i]);
- dbg("resp_pbread->sne_dcs[%d][%s]",resp_pbread->sne_dcs, dbg_dbus_pb_dcs_name[resp_pbread->sne_dcs] );
-
- if(resp_pbread->sne_len>0) {
- switch(resp_pbread->sne_dcs) {
- case PB_TEXT_ASCII:
- case PB_TEXT_GSM7BIT:
- // should implement differently whether ASCII or GSM7BIT LATER
- tcore_util_convert_string_to_utf8(dest_pb_sne, &dest_pb_sne_len, ALPHABET_FORMAT_8BIT_DATA, resp_pbread->sne, resp_pbread->sne_len);
- break;
- case PB_TEXT_UCS2: {
- //swap a little-endian ucs2 string to BIG-ENDIAN UCS2 string
- unsigned short *src = NULL, *dest = NULL;
- src = (unsigned short*)malloc(resp_pbread->sne_len);
- if (NULL == src){
- dbg("src alloc is failed!");
- return FALSE;
- }
- dest = (unsigned short*)malloc(resp_pbread->sne_len);
- if (NULL == dest) {
- dbg("dest alloc is failed!");
- free(src);
- return FALSE;
- }
- memcpy(src, resp_pbread->sne, resp_pbread->sne_len);
- tcore_util_swap_byte_order(dest, src, resp_pbread->sne_len/2);
- for(i=0; i<resp_pbread->sne_len; i++)
- dbg("after swap : resp_pbread->sne[%02d][0x%02x]", i, dest[i]);
- tcore_util_convert_string_to_utf8(dest_pb_sne, &dest_pb_sne_len, ALPHABET_FORMAT_UCS2, (unsigned char*)dest, resp_pbread->sne_len);
- free(src);
- free(dest);
-
- } break;
- default:
- tcore_util_convert_string_to_utf8(dest_pb_sne, &dest_pb_sne_len, 0xff , resp_pbread->sne, resp_pbread->sne_len);
- break;
- }
- }
- dbg("resp_pbread->anr1[%s]",resp_pbread->anr1 );
- dbg("resp_pbread->anr1_ton[%d][%s]",resp_pbread->anr1_ton, dbg_dbus_pb_ton_name[resp_pbread->anr1_ton] );
- dbg("resp_pbread->anr2[%s]",resp_pbread->anr2 );
- dbg("resp_pbread->anr2_ton[%d][%s]",resp_pbread->anr2_ton, dbg_dbus_pb_ton_name[resp_pbread->anr2_ton] );
- dbg("resp_pbread->anr3[%s]",resp_pbread->anr3 );
- dbg("resp_pbread->anr3_ton[%d][%s]",resp_pbread->anr3_ton, dbg_dbus_pb_ton_name[resp_pbread->anr3_ton] );
-
- dbg("resp_pbread->email1_len[%d]",resp_pbread->email1_len);
- for(i=0; i<resp_pbread->email1_len; i++) {
- dbg("resp_pbread->email1[%02d][0x%02x]", i, resp_pbread->email1[i]);
- }
- if(resp_pbread->email1_len > 0) {
- tcore_util_convert_string_to_utf8(dest_pb_email1, &dest_pb_email1_len, ALPHABET_FORMAT_8BIT_DATA, resp_pbread->email1, resp_pbread->email1_len);
- }
- /*doesn't support additional e-mail fields in CP team*/
- /*
- dbg("resp_pbread->email2_len[%d]",resp_pbread->email2_len);
- for(i=0; i<resp_pbread->email2_len; i++) {
- dbg("resp_pbread->email2[%02d][0x%02x]", i, resp_pbread->email2[i]);
- }
- if(resp_pbread->email2_len > 0 && resp_pbread->email2 != NULL) {
- tcore_util_convert_string_to_utf8(dest_pb_email2, &dest_pb_email2_len, ALPHABET_FORMAT_8BIT_DATA, resp_pbread->email2, resp_pbread->email2_len);
- }
- dbg("resp_pbread->email3_len[%d]",resp_pbread->email3_len);
- for(i=0; i<resp_pbread->email3_len; i++) {
- dbg("resp_pbread->email3[%02d][0x%02x]", i, resp_pbread->email3[i]);
- }
- if(resp_pbread->email3_len > 0 && resp_pbread->email3 != NULL) {
- tcore_util_convert_string_to_utf8(dest_pb_email3, &dest_pb_email3_len, ALPHABET_FORMAT_8BIT_DATA, resp_pbread->email3, resp_pbread->email3_len);
- }
- dbg("resp_pbread->email4_len[%d]",resp_pbread->email4_len);
- for(i=0; i<resp_pbread->email4_len; i++) {
- dbg("resp_pbread->email4[%02d][0x%02x]", i, resp_pbread->email4[i]);
- }
- if(resp_pbread->email4_len > 0 && resp_pbread->email4 != NULL) {
- tcore_util_convert_string_to_utf8(dest_pb_email4, &dest_pb_email4_len, ALPHABET_FORMAT_8BIT_DATA, resp_pbread->email4, resp_pbread->email4_len);
- }
- */
- dbg("resp_pbread->group_index[%d]",resp_pbread->group_index );
- dbg("resp_pbread->pb_control[%d]",resp_pbread->pb_control );
- }
-
- telephony_phonebook_complete_read_record(dbus_info->interface_object, dbus_info->invocation,
- resp_pbread->result, resp_pbread->phonebook_type, resp_pbread->index, resp_pbread->next_index,
- (const gchar *)dest_pb_name, resp_pbread->dcs,
- (const gchar *)resp_pbread->number, resp_pbread->ton,
- (const gchar *)dest_pb_sne, resp_pbread->sne_dcs,
- (const gchar *)resp_pbread->anr1, resp_pbread->anr1_ton,
- (const gchar *)resp_pbread->anr2, resp_pbread->anr2_ton,
- (const gchar *)resp_pbread->anr3, resp_pbread->anr3_ton,
- (const gchar *)dest_pb_email1, //(const gchar *)resp_pbread->email1,
- (const gchar *)resp_pbread->email2, (const gchar *)resp_pbread->email3, (const gchar *)resp_pbread->email4,
- resp_pbread->group_index);
-
- } break;
-
- case TRESP_PHONEBOOK_UPDATERECORD:
- dbg("dbus comm - TRESP_PHONEBOOK_UPDATERECORD");
- telephony_phonebook_complete_update_record(dbus_info->interface_object, dbus_info->invocation,resp_pbupdate->result);
- break;
-
- case TRESP_PHONEBOOK_DELETERECORD:
- dbg("dbus comm - TRESP_PHONEBOOK_DELETERECORD");
- telephony_phonebook_complete_delete_record(dbus_info->interface_object, dbus_info->invocation, resp_pbdelete->result);
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_phonebook_notification(struct custom_data *ctx, const char *plugin_name,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonyPhonebook *phonebook;
- const struct tnoti_phonebook_status *n_pb_status = data;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
-
- phonebook = telephony_object_peek_phonebook(TELEPHONY_OBJECT(object));
- dbg("phonebook = %p", phonebook);
-
- switch (command) {
- case TNOTI_PHONEBOOK_STATUS :
- telephony_phonebook_emit_status(phonebook, n_pb_status->b_init);
- break;
-
- default:
- dbg("not handled cmd[0x%x]", command);
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <glib-object.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_sap.h>
-#include <co_sim.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-static gboolean on_sap_connect(TelephonySap *sap, GDBusMethodInvocation *invocation,
- gint arg_req_max_size, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sap_req_connect req_conn;
-
- if (check_access_control(invocation, AC_SAP, "x") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sap, invocation);
- memset(&req_conn, 0, sizeof(struct treq_sap_req_connect));
-
- req_conn.max_msg_size = (unsigned short)arg_req_max_size;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sap_req_connect), &req_conn);
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_CONNECT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sap_complete_connect(sap, invocation, SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_disconnect(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SAP, "x") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sap, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_DISCONNECT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sap_complete_disconnect(sap, invocation, SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_get_status(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SAP, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sap, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sap_complete_get_status(sap, invocation, SAP_STATUS_UNKNOWN);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_get_atr(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SAP, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sap, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_ATR);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariantBuilder *builder = NULL;
- GVariant * atr_gv = NULL;
- GVariant *inner_gv = NULL;
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- inner_gv = g_variant_builder_end(builder);
- atr_gv = g_variant_new("v", inner_gv);
-
- telephony_sap_complete_get_atr(sap, invocation, SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, atr_gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_transfer_apdu(TelephonySap *sap, GDBusMethodInvocation *invocation,
- GVariant *arg_req_apdu, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- struct treq_sap_transfer_apdu t_apdu;
- TReturn ret;
- GVariantIter *iter = NULL;
- GVariant *inner_gv = NULL;
- guchar rt_i;
- int i =0;
-
- if (check_access_control(invocation, AC_SAP, "x") == FALSE)
- return FALSE;
-
- dbg("Func Entrance");
- memset(&t_apdu, 0, sizeof(struct treq_sap_transfer_apdu));
-
- inner_gv = g_variant_get_variant(arg_req_apdu);
-
- g_variant_get(inner_gv, "ay", &iter);
- while ( g_variant_iter_loop (iter, "y", &rt_i)) {
- t_apdu.apdu_data[i] = rt_i;
- i++;
- }
- t_apdu.apdu_length = (unsigned int)i;
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
- g_variant_unref(arg_req_apdu);
-
- for(i=0; i < (int)t_apdu.apdu_length; i++)
- dbg("apdu[%d][0x%02x]",i, t_apdu.apdu_data[i]);
-
- ur = MAKE_UR(ctx, sap, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sap_transfer_apdu), &t_apdu);
- tcore_user_request_set_command(ur, TREQ_SAP_TRANSFER_APDU);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariantBuilder *builder = NULL;
- GVariant * apdu_gv = NULL;
- GVariant *in_gv = NULL;
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- in_gv = g_variant_builder_end(builder);
- apdu_gv = g_variant_new("v", in_gv);
-
- telephony_sap_complete_transfer_apdu(sap, invocation, SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, apdu_gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_set_protocol(TelephonySap *sap, GDBusMethodInvocation *invocation,
- gint arg_protocol, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sap_set_protocol set_protocol;
-
- if (check_access_control(invocation, AC_SAP, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sap, invocation);
- memset(&set_protocol, 0, sizeof(struct treq_sap_set_protocol));
-
- set_protocol.protocol = arg_protocol;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sap_set_protocol), &set_protocol);
- tcore_user_request_set_command(ur, TREQ_SAP_SET_PROTOCOL);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sap_complete_set_protocol(sap, invocation, SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_set_power(TelephonySap *sap, GDBusMethodInvocation *invocation,
- gint arg_mode, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sap_set_power set_power;
-
- if (check_access_control(invocation, AC_SAP, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sap, invocation);
- memset(&set_power, 0, sizeof(struct treq_sap_set_power));
-
- set_power.mode = arg_mode;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sap_set_power), &set_power);
- tcore_user_request_set_command(ur, TREQ_SAP_SET_POWER);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sap_complete_set_power(sap, invocation, SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sap_get_card_reader_status(TelephonySap *sap, GDBusMethodInvocation *invocation, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SAP, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sap, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SAP_REQ_CARDREADERSTATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sap_complete_get_card_reader_status(sap, invocation, SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_sap_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySap *sap;
-
- sap = telephony_sap_skeleton_new();
- telephony_object_skeleton_set_sap(object, sap);
- g_object_unref(sap);
-
- dbg("sap = %p", sap);
-
- g_signal_connect (sap,
- "handle-connect",
- G_CALLBACK (on_sap_connect),
- ctx);
-
- g_signal_connect (sap,
- "handle-disconnect",
- G_CALLBACK (on_sap_disconnect),
- ctx);
-
- g_signal_connect (sap,
- "handle-get-status",
- G_CALLBACK (on_sap_get_status),
- ctx);
-
- g_signal_connect (sap,
- "handle-get-atr",
- G_CALLBACK (on_sap_get_atr),
- ctx);
-
- g_signal_connect (sap,
- "handle-transfer-apdu",
- G_CALLBACK (on_sap_transfer_apdu),
- ctx);
-
- g_signal_connect (sap,
- "handle-set-protocol",
- G_CALLBACK (on_sap_set_protocol),
- ctx);
-
- g_signal_connect (sap,
- "handle-set-power",
- G_CALLBACK (on_sap_set_power),
- ctx);
-
- g_signal_connect (sap,
- "handle-get-card-reader-status",
- G_CALLBACK (on_sap_get_card_reader_status),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sap_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- const struct tresp_sap_req_connect *sap_conn = data;
- const struct tresp_sap_req_disconnect *sap_disconn = data;
- const struct tresp_sap_req_status *sap_status = data;
- const struct tresp_sap_req_atr *sap_atr = data;
- const struct tresp_sap_transfer_apdu *sap_apdu = data;
- const struct tresp_sap_set_protocol *sap_protocol = data;
- const struct tresp_sap_set_power *sap_power = data;
- const struct tresp_sap_req_cardreaderstatus *sap_reader = data;
-
- dbg("application Command = [0x%x], data_len = %d",command, data_len);
-
- switch (command) {
- case TRESP_SAP_REQ_CONNECT:
- dbg("dbus comm - TRESP_SAP_REQ_CONNECT");
- telephony_sap_complete_connect(dbus_info->interface_object, dbus_info->invocation,
- sap_conn->status, sap_conn->max_msg_size);
- break;
-
- case TRESP_SAP_REQ_DISCONNECT:
- dbg("dbus comm - TRESP_SAP_REQ_DISCONNECT");
- telephony_sap_complete_disconnect(dbus_info->interface_object, dbus_info->invocation,
- sap_disconn->result);
- break;
-
- case TRESP_SAP_REQ_STATUS:
- dbg("dbus comm - TRESP_SAP_REQ_STATUS");
- telephony_sap_complete_get_status(dbus_info->interface_object, dbus_info->invocation,
- sap_status->status);
- break;
-
- case TRESP_SAP_REQ_ATR: {
- GVariantBuilder *builder = NULL;
- GVariant * atr_gv = NULL;
- GVariant *inner_gv = NULL;
- int i =0;
-
- dbg("dbus comm - TRESP_SAP_REQ_ATR");
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)sap_atr->atr_length; i++) {
- dbg("sap_atr->atr[%d][0x%02x]", i,sap_atr->atr[i]);
- g_variant_builder_add (builder, "y", sap_atr->atr[i]);
- }
- inner_gv = g_variant_builder_end(builder);
-/* g_variant_builder_unref (builder);*/
- atr_gv = g_variant_new("v", inner_gv);
-
- telephony_sap_complete_get_atr(dbus_info->interface_object, dbus_info->invocation,
- sap_atr->result, atr_gv);
- }
- break;
-
- case TRESP_SAP_TRANSFER_APDU: {
- GVariantBuilder *builder = NULL;
- GVariant * apdu_gv = NULL;
- GVariant *inner_gv = NULL;
- int i =0;
-
- dbg("dbus comm - TRESP_SAP_TRANSFER_APDU");
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)sap_apdu->resp_apdu_length; i++) {
- dbg("sap_apdu->resp_adpdu[%d][0x%02x]", i,sap_apdu->resp_adpdu[i]);
- g_variant_builder_add (builder, "y", sap_apdu->resp_adpdu[i]);
- }
- inner_gv = g_variant_builder_end(builder);
-/* g_variant_builder_unref (builder);*/
- apdu_gv = g_variant_new("v", inner_gv);
-
- telephony_sap_complete_transfer_apdu(dbus_info->interface_object, dbus_info->invocation,
- sap_apdu->result, apdu_gv);
- }
- break;
-
- case TRESP_SAP_SET_PROTOCOL:
- dbg("dbus comm - TRESP_SAP_SET_PROTOCOL");
- telephony_sap_complete_set_protocol(dbus_info->interface_object, dbus_info->invocation,
- sap_protocol->result);
- break;
-
- case TRESP_SAP_SET_POWER:
- dbg("dbus comm - TRESP_SAP_SET_POWER");
- telephony_sap_complete_set_power(dbus_info->interface_object, dbus_info->invocation,
- sap_power->result);
- break;
-
- case TRESP_SAP_REQ_CARDREADERSTATUS:
- dbg("dbus comm - TRESP_SAP_REQ_CARDREADERSTATUS");
- telephony_sap_complete_get_card_reader_status(dbus_info->interface_object, dbus_info->invocation,
- sap_reader->result, sap_reader->reader_status);
- break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sap_notification(struct custom_data *ctx, const char *plugin_name,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonySap *sap;
- const struct tnoti_sap_status_changed *n_sap_status = data;
- const struct tnoti_sap_disconnect *n_sap_disconn = data;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
-
- sap = telephony_object_peek_sap(TELEPHONY_OBJECT(object));
- dbg("sap = %p", sap);
-
- dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
-
- switch (command) {
- case TNOTI_SAP_STATUS:
- dbg("notified sap_status[%d]", n_sap_status->status);
- telephony_sap_emit_status(sap, n_sap_status->status);
- break;
- case TNOTI_SAP_DISCONNECT:
- dbg("notified sap_disconnect type[%d]", n_sap_disconn->type);
- telephony_sap_emit_disconnect(sap, n_sap_disconn->type);
- break;
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <glib-object.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_sat.h>
-
-#include "generated-code.h"
-#include "common.h"
-#include "sat_manager.h"
-#include "sat_ui_support/sat_ui_support.h"
-
-static gboolean on_sat_get_main_menu_info(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- GVariant *main_menu = NULL;
-
- gchar *title;
- gint result = 1, command_id, item_cnt;
- gboolean b_present, b_help_info, b_updated;
- GVariant *items;
-
- if (check_access_control(invocation, AC_SAT, "r") == FALSE)
- return FALSE;
-
- if(!ctx->cached_sat_main_menu){
- dbg("no main menu");
- return FALSE;
- }
-
- main_menu = ctx->cached_sat_main_menu;
-
- g_variant_get(main_menu, "(ibs@vibb)", &command_id, &b_present, &title, &items, &item_cnt,
- &b_help_info, &b_updated);
-
- telephony_sat_complete_get_main_menu_info(sat, invocation, result, command_id, b_present, title,
- items, item_cnt, b_help_info, b_updated);
-
- return TRUE;
-}
-
-static gboolean on_sat_send_display_status(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gint arg_command_id, gboolean arg_display_status,
- gpointer user_data)
-{
- TcorePlugin *plg = NULL;
- char *plugin_name;
- struct custom_data *ctx = user_data;
- gboolean result = FALSE;
- gint out_param = 1;
-
- if (check_access_control(invocation, AC_SAT, "x") == FALSE)
- return FALSE;
-
- plugin_name = GET_PLUGIN_NAME(invocation);
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- out_param = 0;
- telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
- return TRUE;
- }
-
- result = sat_manager_handle_ui_display_status(ctx, plg, arg_command_id, arg_display_status);
- if(!result){
- dbg("fail to send exec result");
- }
-
- out_param = (result ? 1 : 0);
- telephony_sat_complete_send_ui_display_status(sat, invocation, out_param);
- return TRUE;
-}
-
-static gboolean on_sat_send_user_confirm(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gint arg_command_id, gint arg_command_type, gint arg_user_confirm_type,
- GVariant *arg_additional_data, gpointer user_data)
-{
- TcorePlugin *plg = NULL;
- char *plugin_name;
- struct custom_data *ctx = user_data;
-
- gboolean result = FALSE;
- gint out_param = 1;
- GVariant *confirm_data = NULL;
-
- if (check_access_control(invocation, AC_SAT, "x") == FALSE)
- return FALSE;
-
- plugin_name = GET_PLUGIN_NAME(invocation);
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- out_param = 0;
- telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
- return TRUE;
- }
-
- confirm_data = g_variant_new("(iiv)", arg_command_id, arg_user_confirm_type, arg_additional_data);
-
- result = sat_manager_handle_user_confirm(ctx, plg, confirm_data);
- if(!result){
- dbg("fail to send user confirm");
- }
-
- out_param = (result ? 1 : 0);
- telephony_sat_complete_send_user_confirm(sat, invocation, out_param);
-
- return TRUE;
-}
-
-static gboolean on_sat_send_app_exec_result(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gint arg_command_id, gint arg_command_type, GVariant *arg_exec_result,
- gpointer user_data)
-{
- TcorePlugin *plg = NULL;
- char *plugin_name;
- struct custom_data *ctx = user_data;
-
- gboolean result = FALSE;
- gint out_param = 1;
-
- if (check_access_control(invocation, AC_SAT, "x") == FALSE)
- return FALSE;
-
- plugin_name = GET_PLUGIN_NAME(invocation);
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- out_param = 0;
- telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
- return TRUE;
- }
-
- dbg("processing app exec result");
- result = sat_manager_handle_app_exec_result(ctx, plg, arg_command_id, arg_command_type, arg_exec_result);
- if(!result){
- dbg("fail to send exec result");
- }
-
- out_param = (result ? 1 : 0);
- telephony_sat_complete_send_app_exec_result(sat, invocation, out_param);
- return TRUE;
-}
-
-static gboolean on_sat_select_menu(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- guchar arg_item_identifier, gboolean arg_help_request,
- gpointer user_data)
-{
- TReturn rv;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- struct treq_sat_envelop_cmd_data envelop_data;
-
- if (check_access_control(invocation, AC_SAT, "x") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sat, invocation);
- memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
- envelop_data.sub_cmd = ENVELOP_MENU_SELECTION;
- envelop_data.envelop_data.menu_select.device_identitie.src = DEVICE_ID_KEYPAD;
- envelop_data.envelop_data.menu_select.device_identitie.dest = DEVICE_ID_SIM;
- envelop_data.envelop_data.menu_select.item_identifier.item_identifier = arg_item_identifier;
- envelop_data.envelop_data.menu_select.help_request = arg_help_request;
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), &envelop_data);
- tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
- rv = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(rv != TCORE_RETURN_SUCCESS){
- telephony_sat_complete_select_menu(sat, invocation, -1, ENVELOPE_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sat_download_event(TelephonySAT *sat, GDBusMethodInvocation *invocation,
- gint arg_event_download_type, gint arg_src_device,gint arg_dest_device,
- GVariant *arg_download_data, gpointer user_data)
-{
- TReturn rv;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- struct treq_sat_envelop_cmd_data envelop_data;
-
- if (check_access_control(invocation, AC_SAT, "x") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sat, invocation);
- memset(&envelop_data, 0, sizeof(struct treq_sat_envelop_cmd_data));
- envelop_data.sub_cmd = ENVELOP_EVENT_DOWNLOAD;
- envelop_data.envelop_data.event_download.event = arg_event_download_type;
- sat_manager_handle_event_download_envelop(arg_event_download_type, arg_src_device, arg_dest_device,
- &envelop_data.envelop_data.event_download, arg_download_data);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sat_envelop_cmd_data), &envelop_data);
- tcore_user_request_set_command(ur, TREQ_SAT_REQ_ENVELOPE);
- rv = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(rv != TCORE_RETURN_SUCCESS){
- telephony_sat_complete_download_event(sat, invocation, -1, ENVELOPE_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_sat_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySAT *sat;
-
- sat = telephony_sat_skeleton_new();
- telephony_object_skeleton_set_sat(object, sat);
- g_object_unref(sat);
-
- dbg("sat = %p", sat);
-
- g_signal_connect (sat,
- "handle-get-main-menu-info",
- G_CALLBACK (on_sat_get_main_menu_info),
- ctx);
-
- g_signal_connect (sat,
- "handle-send-ui-display-status",
- G_CALLBACK (on_sat_send_display_status),
- ctx);
-
- g_signal_connect (sat,
- "handle-send-user-confirm",
- G_CALLBACK (on_sat_send_user_confirm),
- ctx);
-
- g_signal_connect (sat,
- "handle-send-app-exec-result",
- G_CALLBACK (on_sat_send_app_exec_result),
- ctx);
-
- g_signal_connect (sat,
- "handle-select-menu",
- G_CALLBACK (on_sat_select_menu),
- ctx);
-
- g_signal_connect (sat,
- "handle-download-event",
- G_CALLBACK (on_sat_download_event),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sat_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- const struct tresp_sat_envelop_data *envelop_rsp = NULL;
-
- dbg("sat response command = [0x%x], data_len = %d", command, data_len);
-
- switch (command) {
- case TRESP_SAT_REQ_ENVELOPE: {
- envelop_rsp = (struct tresp_sat_envelop_data *)data;
-
- dbg("envelop sub_cmd(%d) result(%d) rsp(%d)", envelop_rsp->sub_cmd, envelop_rsp->result, envelop_rsp->envelop_resp);
-
- if(envelop_rsp->sub_cmd == ENVELOP_MENU_SELECTION){
- telephony_sat_complete_select_menu(dbus_info->interface_object, dbus_info->invocation,
- envelop_rsp->result, envelop_rsp->envelop_resp);
- }
- else if(envelop_rsp->sub_cmd == ENVELOP_EVENT_DOWNLOAD){
- telephony_sat_complete_download_event(dbus_info->interface_object, dbus_info->invocation,
- envelop_rsp->result, envelop_rsp->envelop_resp);
- }
- } break;
-
- case TRESP_SAT_REQ_TERMINALRESPONSE:
- dbg("receive TRESP_SAT_REQ_TERMINALRESPONSE");
- break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
- return TRUE;
-}
-
-gboolean dbus_plugin_sat_notification(struct custom_data *ctx, const char *plugin_name,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TcorePlugin *plg = NULL;
- TelephonySAT *sat;
- struct tnoti_sat_proactive_ind *p_ind = (struct tnoti_sat_proactive_ind *)data;
-
- if (!object || !ctx) {
- dbg("NULL data is detected!!");
- return FALSE;
- }
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return FALSE;
- }
-
- sat_ui_support_storage_init(ctx->server);
-
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
- dbg("sat = %p", sat);
-
- dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
-
- if (command == TNOTI_SAT_SESSION_END) {
-
- dbg("notified sat session end evt");
- sat_manager_init_queue(ctx);
-
- sat_ui_support_terminate_sat_ui();
- telephony_sat_emit_end_proactive_session(sat, SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
- return TRUE;
- }
-
- //Proactive Command Notification
- dbg("notified sat proactive command(%d)", p_ind->cmd_type);
-
- switch (p_ind->cmd_type) {
- case SAT_PROATV_CMD_SETUP_MENU:{
- gboolean rv = FALSE;
- GVariant *menu_info = NULL;
- GVariant *resp = NULL;
- GVariant *exec_result = NULL;
-
- gchar *title;
- gint command_id, menu_cnt;
- gboolean b_present, b_helpinfo, b_updated;
- GVariant *items;
-
- menu_info = sat_manager_caching_setup_menu_info(ctx, plugin_name, (struct tel_sat_setup_menu_tlv*) &p_ind->proactive_ind_data.setup_menu);
- ctx->cached_sat_main_menu = menu_info;
-
- if(!menu_info){
- dbg("no main menu data");
- sat_ui_support_remove_desktop_file();
- sat_ui_support_terminate_sat_ui();
- telephony_sat_emit_end_proactive_session(sat, SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
- return TRUE;
- }
-
- dbg("menu_info type_format(%s)", g_variant_get_type_string(menu_info));
- g_variant_get(menu_info, "(ibs@vibb)", &command_id, &b_present, &title, &items,
- &menu_cnt, &b_helpinfo, &b_updated);
-
- rv = sat_ui_support_create_desktop_file(title);
-
- dbg("return value (%d)", rv);
- if(rv)
- resp = g_variant_new("(i)", RESULT_SUCCESS);
- else
- resp = g_variant_new("(i)", RESULT_ME_UNABLE_TO_PROCESS_COMMAND);
-
- exec_result = g_variant_new_variant(resp);
- sat_manager_handle_app_exec_result(ctx, plg, command_id, SAT_PROATV_CMD_SETUP_MENU, exec_result);
-
- //sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SETUP_MENU, menu_info);
-
- telephony_sat_emit_setup_menu(sat, command_id, b_present, title, items, menu_cnt,
- b_helpinfo, b_updated);
- } break;
-
- case SAT_PROATV_CMD_DISPLAY_TEXT:{
- GVariant *display_text = NULL;
-
- gint command_id, text_len, duration;
- gboolean high_priority, user_rsp_required, immediately_rsp;
- gchar text[SAT_TEXT_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
- int ret;
-
- display_text = sat_manager_display_text_noti(ctx, plugin_name, (struct tel_sat_display_text_tlv*) &p_ind->proactive_ind_data.display_text);
-
- if(!display_text){
- dbg("no display text data");
- return TRUE;
- }
-
- dbg("display text type_format(%s)", g_variant_get_type_string(display_text));
- g_variant_get(display_text, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
- &high_priority, &user_rsp_required, &immediately_rsp, &icon_id);
-
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_DISPLAY_TEXT, display_text);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
- telephony_sat_emit_display_text(sat, command_id, text, text_len, duration,
- high_priority, user_rsp_required, immediately_rsp);
-
- } break;
-
- case SAT_PROATV_CMD_SELECT_ITEM:{
- GVariant *select_menu = NULL;
-
- gboolean help_info ;
- gchar *selected_text;
- gint command_id, default_item_id, menu_cnt, text_len =0;
- GVariant *menu_items, *icon_id, *icon_list;
- int ret;
-
- select_menu = sat_manager_select_item_noti(ctx, plugin_name, (struct tel_sat_select_item_tlv*) &p_ind->proactive_ind_data.select_item);
-
- if(!select_menu){
- dbg("no select menu data");
- return TRUE;
- }
-
- dbg("select menu type_format(%s)", g_variant_get_type_string(select_menu));
- g_variant_get(select_menu, "(ibsiii@v@v@v)", &command_id, &help_info, &selected_text,
- &text_len, &default_item_id, &menu_cnt, &menu_items, &icon_id, &icon_list);
-
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SELECT_ITEM, select_menu);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
- telephony_sat_emit_select_item (sat, command_id, help_info, selected_text, text_len,
- default_item_id, menu_cnt, menu_items);
- } break;
-
- case SAT_PROATV_CMD_GET_INKEY:{
- GVariant *get_inkey = NULL;
- gint command_id, key_type, input_character_mode;
- gint text_len, duration;
- gboolean b_numeric, b_help_info;
- gchar *text;
- GVariant *icon_id;
- int ret;
-
- get_inkey = sat_manager_get_inkey_noti(ctx, plugin_name, (struct tel_sat_get_inkey_tlv*) &p_ind->proactive_ind_data.get_inkey);
-
- if(!get_inkey){
- dbg("no get inkey data");
- return TRUE;
- }
-
- dbg("get inkey type_format(%s)", g_variant_get_type_string(get_inkey));
- g_variant_get(get_inkey, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
- &b_numeric,&b_help_info, &text, &text_len, &duration, &icon_id);
-
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INKEY, get_inkey);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
- telephony_sat_emit_get_inkey(sat, command_id, key_type, input_character_mode,
- b_numeric, b_help_info, text, text_len, duration);
- } break;
-
- case SAT_PROATV_CMD_GET_INPUT:{
- GVariant *get_input = NULL;
- gint command_id, input_character_mode;
- gint text_len, def_text_len, rsp_len_min, rsp_len_max;
- gboolean b_numeric, b_help_info, b_echo_input;
- gchar *text, *def_text;
- GVariant *icon_id;
- int ret;
-
- get_input = sat_manager_get_input_noti(ctx, plugin_name, (struct tel_sat_get_input_tlv*) &p_ind->proactive_ind_data.get_input);
-
- if(!get_input){
- dbg("no get input data");
- return TRUE;
- }
-
- dbg("get input type_format(%s)", g_variant_get_type_string(get_input));
- g_variant_get(get_input, "(iibbbsiiisi@v)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input,
- &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len, &icon_id);
-
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_GET_INPUT, get_input);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
- telephony_sat_emit_get_input(sat, command_id, input_character_mode, b_numeric, b_help_info,
- b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len);
- } break;
-
- case SAT_PROATV_CMD_PLAY_TONE:{
- GVariant *play_tone = NULL;
- gint command_id, tone_type, duration;
- gint text_len;
- gchar* text;
- GVariant *icon_id;
- int ret;
-
- play_tone = sat_manager_play_tone_noti(ctx, plugin_name, (struct tel_sat_play_tone_tlv*) &p_ind->proactive_ind_data.play_tone);
-
- if(!play_tone){
- dbg("no play tone data");
- return TRUE;
- }
-
- dbg("play tone type_format(%s)", g_variant_get_type_string(play_tone));
- g_variant_get(play_tone, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
-
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_PLAY_TONE, play_tone);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
- telephony_sat_emit_play_tone(sat, command_id, text, text_len, tone_type, duration);
- } break;
-
- case SAT_PROATV_CMD_SEND_SMS:{
- GVariant *send_sms = NULL;
-
- gint command_id, ton, npi, tpdu_type;
- gboolean b_packing_required;
- gint text_len, number_len, tpdu_data_len;
- gchar* text, *dialling_number;
- GVariant *tpdu_data, *icon_id;
-
- send_sms = sat_manager_send_sms_noti(ctx, plugin_name, (struct tel_sat_send_sms_tlv*) &p_ind->proactive_ind_data.send_sms);
-
- if(!send_sms){
- dbg("no send sms data");
- return TRUE;
- }
-
- dbg("send sms type_format(%s)", g_variant_get_type_string(send_sms));
- g_variant_get(send_sms, "(isi@vbiisii@vi)", &command_id, &text, &text_len, &icon_id, &b_packing_required, &ton, &npi,
- &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
-
- dbg("check display text : text(%s) text len(%d)", text, text_len);
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = FALSE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("send sms is pending!!!");
-
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- return TRUE;
- }
-
- telephony_sat_emit_send_sms(sat, command_id, text, text_len, b_packing_required,
- ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
- } break;
-
- case SAT_PROATV_CMD_SEND_SS:{
- GVariant *send_ss = NULL;
-
- gint command_id, ton, npi;
- gint text_len, ss_str_len;
- gchar* text, *ss_string;
-
- GVariant *icon_id;
-
- send_ss = sat_manager_send_ss_noti(ctx, plugin_name, (struct tel_sat_send_ss_tlv*) &p_ind->proactive_ind_data.send_ss);
-
- if(!send_ss){
- dbg("no send ss data");
- return TRUE;
- }
-
- dbg("send ss type_format(%s)", g_variant_get_type_string(send_ss));
- g_variant_get(send_ss, "(isi@viiis)", &command_id, &text, &text_len, &icon_id,
- &ton, &npi, &ss_str_len, &ss_string);
-
- dbg("check display text : text(%s) text len(%d)", text, text_len);
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = FALSE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("send ss is pending!!!");
-
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- return TRUE;
- }
-
- telephony_sat_emit_send_ss(sat, command_id, text, text_len, ton, npi, ss_string);
-
- //tizen ciss
- sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_SS, send_ss);
-
- } break;
-
- case SAT_PROATV_CMD_SEND_USSD:{
- GVariant *send_ussd = NULL;
-
- gint command_id;
- gint text_len, ussd_str_len;
- gchar* text, *ussd_string;
-
- GVariant *icon_id;
-
- send_ussd = sat_manager_send_ussd_noti(ctx, plugin_name, (struct tel_sat_send_ussd_tlv*) &p_ind->proactive_ind_data.send_ussd);
-
- if(!send_ussd){
- dbg("no send ussd data");
- return TRUE;
- }
-
- dbg("send ussd type_format(%s)", g_variant_get_type_string(send_ussd));
- g_variant_get(send_ussd, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &ussd_str_len, &ussd_string);
-
- dbg("check display text : text(%s) text len(%d)", text, text_len);
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = FALSE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("send ussd is pending!!!");
-
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- return TRUE;
- }
-
- telephony_sat_emit_setup_ussd(sat, command_id, text, text_len, ussd_string);
-
- //tizen ciss ui
- sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_USSD, send_ussd);
- } break;
-
- case SAT_PROATV_CMD_SETUP_CALL:{
- GVariant *setup_call = NULL;
-
- gint command_id, call_type, confirmed_text_len, text_len, duration;
- gchar *confirmed_text, *text, *call_number;
- GVariant *icon_id;
-
- setup_call = sat_manager_setup_call_noti(ctx, plugin_name, (struct tel_sat_setup_call_tlv*) &p_ind->proactive_ind_data.setup_call);
-
- if(!setup_call){
- dbg("no setup call data");
- return TRUE;
- }
-
- dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
- g_variant_get(setup_call, "(isisi@visi)", &command_id, &confirmed_text, &confirmed_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
-
- dbg("check display text : text(%s) text len(%d)", confirmed_text, confirmed_text_len);
- if(confirmed_text_len > 1 && (g_strcmp0(confirmed_text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = TRUE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("setup call is pending!!!");
-
- ui_info = g_variant_new("(isib)", command_id, confirmed_text, confirmed_text_len, user_confirm);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- return TRUE;
- }
-
- telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len,text, text_len, call_type, call_number, duration);
- }break;
-
- case SAT_PROATV_CMD_SETUP_EVENT_LIST:{
- GVariant *event_list = NULL;
-
- gint event_cnt;
- GVariant *evt_list;
-
- event_list = sat_manager_setup_event_list_noti(ctx, plugin_name, (struct tel_sat_setup_event_list_tlv*) &p_ind->proactive_ind_data.setup_event_list);
-
- if(!event_list){
- dbg("no setup event list data");
- return TRUE;
- }
-
- dbg("setup event list type_format(%s)", g_variant_get_type_string(event_list));
- g_variant_get(event_list, "(i@v)", &event_cnt, &evt_list);
-
- telephony_sat_emit_setup_event_list(sat, event_cnt, evt_list);
-
- //bip proactive command is only handled by BIP Manager
- {
- gboolean b_sig = FALSE;
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- /* TODO: SAT Event Downloader should execute event_list as well. */
- b_sig = sat_ui_support_exec_evtdw(conn, g_path, SAT_PROATV_CMD_SETUP_EVENT_LIST, event_list);
-
- b_sig = sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_SETUP_EVENT_LIST, event_list);
- }
- } break;
-
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:{
- GVariant *setup_idle_mode = NULL;
- int ret;
-
- gint command_id, text_len;
- gchar* text;
- GVariant *icon_id;
-
- setup_idle_mode = sat_manager_setup_idle_mode_text_noti(ctx, plugin_name, (struct tel_sat_setup_idle_mode_text_tlv*) &p_ind->proactive_ind_data.setup_idle_mode_text);
-
- if(!setup_idle_mode){
- dbg("no setup idle mode text data");
- return TRUE;
- }
-
- dbg("setup idle mode text type_format(%s)", g_variant_get_type_string(setup_idle_mode));
- g_variant_get(setup_idle_mode, "(isi@v)", &command_id, &text, &text_len, &icon_id);
-
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT, setup_idle_mode);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
-
- telephony_sat_emit_setup_idle_mode_text(sat, command_id, text, text_len);
- } break;
-
- case SAT_PROATV_CMD_OPEN_CHANNEL:{
- GVariant *open_channel = NULL;
-
- gint command_id, bearer_type, protocol_type, dest_addr_type;
- gboolean immediate_link, auto_reconnection, bg_mode;
- gint text_len, buffer_size, port_number;
- gchar *text, *dest_address;
- GVariant *icon_id;
- GVariant *bearer_param;
- GVariant *bearer_detail;
-
- open_channel = sat_manager_open_channel_noti(ctx, plugin_name, (struct tel_sat_open_channel_tlv*) &p_ind->proactive_ind_data.open_channel);
-
- if(!open_channel){
- dbg("no open channel data");
- return TRUE;
- }
-
- dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
- g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
-
- dbg("check display text : text(%s) text len(%d)", text, text_len);
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = TRUE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("open channel text is displayed!!!");
-
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- return TRUE;
- }
-
- /*telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- gboolean b_sig = FALSE;
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- b_sig = sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
- }
-
- } break;
-
- case SAT_PROATV_CMD_CLOSE_CHANNEL:{
- GVariant *close_channel = NULL;
-
- gint command_id, channel_id, text_len;
- gchar *text;
- GVariant *icon_id;
-
- close_channel = sat_manager_close_channel_noti(ctx, plugin_name, (struct tel_sat_close_channel_tlv*) &p_ind->proactive_ind_data.close_channel);
-
- if(!close_channel){
- dbg("no close channel data");
- return TRUE;
- }
-
- //TODO check the data for sat-ui
-
- dbg("close channel type_format(%s)", g_variant_get_type_string(close_channel));
- g_variant_get(close_channel, "(isi@vi)", &command_id, &text, &text_len, &icon_id, &channel_id);
-
- /*telephony_sat_emit_close_channel(sat, command_id, text, text_len, channel_id);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- gboolean b_sig = FALSE;
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- b_sig = sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_CLOSE_CHANNEL, close_channel);
- }
-
- } break;
-
- case SAT_PROATV_CMD_RECEIVE_DATA:{
- GVariant *receive_data = NULL;
-
- gint command_id, text_len, channel_id, channel_data_len = 0;
- gchar *text;
- GVariant *icon_id;
-
- receive_data = sat_manager_receive_data_noti(ctx, plugin_name, (struct tel_sat_receive_channel_tlv*) &p_ind->proactive_ind_data.receive_data);
-
- if(!receive_data){
- dbg("no receive data data");
- return TRUE;
- }
-
- //TODO check the data for sat-ui
-
- dbg("receive data type_format(%s)", g_variant_get_type_string(receive_data));
- g_variant_get(receive_data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &channel_id, &channel_data_len);
-
- /*telephony_sat_emit_receive_data(sat, command_id, text, text_len, channel_id, channel_data_len);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- gboolean b_sig = FALSE;
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- b_sig = sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_RECEIVE_DATA, receive_data);
- }
-
- } break;
-
- case SAT_PROATV_CMD_SEND_DATA:{
- GVariant *send_data = NULL;
-
- gint command_id, channel_id, text_len, channel_data_len;
- gboolean send_data_immediately;
- gchar *text;
- GVariant *channel_data;
- GVariant *icon_id;
-
- send_data = sat_manager_send_data_noti(ctx, plugin_name, (struct tel_sat_send_channel_tlv*) &p_ind->proactive_ind_data.send_data);
-
- if(!send_data){
- dbg("no send data data");
- return TRUE;
- }
-
- //TODO check the data for sat-ui
-
- dbg("send data type_format(%s)", g_variant_get_type_string(send_data));
- g_variant_get(send_data, "(isi@vib@vi)", &command_id, &text, &text_len, &icon_id, &channel_id, &send_data_immediately, &channel_data, &channel_data_len);
-
- /*telephony_sat_emit_send_data(sat, command_id, text, text_len, channel_id, send_data_immediately, channel_data, channel_data_len);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- gboolean b_sig = FALSE;
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- b_sig = sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_SEND_DATA, send_data);
- }
- } break;
-
- case SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
- GVariant *channel_status = NULL;
-
- gint command_id;
-
- channel_status = sat_manager_get_channel_status_noti(ctx, plugin_name, (struct tel_sat_get_channel_status_tlv*) &p_ind->proactive_ind_data.get_channel_status);
-
- if(!channel_status){
- dbg("no get channel status data");
- return TRUE;
- }
-
- //TODO check the data for sat-ui
-
- dbg("get channel status type_format(%s)", g_variant_get_type_string(channel_status));
- g_variant_get(channel_status, "(i)", &command_id);
-
- /*telephony_sat_emit_get_channel_status(sat, command_id);*/
-
- //bip proactive command is only handled by BIP Manager
- {
- gboolean b_sig = FALSE;
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- b_sig = sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_GET_CHANNEL_STATUS, channel_status);
- }
- } break;
-
- case SAT_PROATV_CMD_REFRESH:{
- GVariant *refresh = NULL;
- gint command_id = 0;
- gint refresh_type =0;
- GVariant *file_list = NULL;
- int ret;
-
- refresh = sat_manager_refresh_noti(ctx, plugin_name, (struct tel_sat_refresh_tlv*) &p_ind->proactive_ind_data.refresh);
-
- if(!refresh){
- dbg("no refresh data");
- return TRUE;
- }
-
- dbg("refresh type_format(%s)", g_variant_get_type_string(refresh));
- g_variant_get(refresh, "(ii@v)", &command_id, &refresh_type, &file_list);
-
- telephony_sat_emit_refresh(sat, command_id, refresh_type, file_list);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_REFRESH, refresh);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- }break;
-
- case SAT_PROATV_CMD_MORE_TIME:{
- sat_manager_more_time_noti(ctx, plugin_name, (struct tel_sat_more_time_tlv*) &p_ind->proactive_ind_data.more_time);
- telephony_sat_emit_more_time(sat);
- }break;
-
- case SAT_PROATV_CMD_SEND_DTMF:{
- GVariant *send_dtmf = NULL;
- gint command_id = 0;
- gint text_len = 0, dtmf_str_len = 0;
- gchar *text = NULL;
- gchar *dtmf_str = NULL;
- GVariant *icon_id = NULL;
-
- send_dtmf = sat_manager_send_dtmf_noti(ctx, plugin_name, (struct tel_sat_send_dtmf_tlv*) &p_ind->proactive_ind_data.send_dtmf);
- if(!send_dtmf){
- dbg("no send_dtmf data");
- return TRUE;
- }
-
- dbg("send_dtmf type_format(%s)", g_variant_get_type_string(send_dtmf));
- g_variant_get(send_dtmf, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &dtmf_str_len, &dtmf_str);
-
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = FALSE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("send dtmf is displayed!!!");
-
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_SEND_DTMF, ui_info);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- return TRUE;
- }
-
- telephony_sat_emit_send_dtmf(sat, command_id, text, text_len, dtmf_str, dtmf_str_len);
- }break;
-
- case SAT_PROATV_CMD_LAUNCH_BROWSER:{
- GVariant *launch_browser = NULL;
- gint command_id = 0;
- gint browser_launch_type = 0, browser_id = 0;
- gint url_len = 0, text_len = 0, gateway_proxy_len =0;
- gchar *url = NULL;
- gchar *text = NULL;
- gchar *gateway_proxy = NULL;
- GVariant *icon_id = NULL;
-
- launch_browser = sat_manager_launch_browser_noti(ctx, plugin_name, (struct tel_sat_launch_browser_tlv*) &p_ind->proactive_ind_data.launch_browser);
- if(!launch_browser){
- dbg("no launch_browser data");
- return TRUE;
- }
-
- dbg("launch_browser type_format(%s)", g_variant_get_type_string(launch_browser));
- g_variant_get(launch_browser, "(iiisisisi@v)", &command_id, &browser_launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
-
- if(text_len > 1 && (g_strcmp0(text,"") != 0) ){
- GVariant *ui_info = NULL;
- gboolean user_confirm = TRUE;
- int ret;
- dbg("text should be displayed by ui");
- dbg("launch browser is displayed!!!");
-
- ui_info = g_variant_new("(isib)", command_id, text, text_len, user_confirm);
- ret = sat_ui_support_launch_sat_ui(SAT_PROATV_CMD_NONE, ui_info);
- if(!ret) {
- int rv;
- dbg("fail to launch sat-ui, remove the queued data!!\n");
- rv = sat_manager_remove_cmd_by_id(ctx, command_id);
- if(!rv)
- dbg("fail to dequeue data\n");
- }
- return TRUE;
- }
-
- telephony_sat_emit_launch_browser(sat, command_id, browser_launch_type, browser_id, url, url_len, gateway_proxy, gateway_proxy_len, text, text_len);
- }break;
-
- case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:{
- GVariant *provide_info = NULL;
- gint info_type = 0;
-
- provide_info = sat_manager_provide_local_info_noti(ctx, plugin_name, (struct tel_sat_provide_local_info_tlv*) &p_ind->proactive_ind_data.provide_local_info);
- if(!provide_info){
- dbg("no provide_info data");
- return TRUE;
- }
-
- dbg("provide_info type_format(%s)", g_variant_get_type_string(provide_info));
- g_variant_get(provide_info, "(i)", &info_type);
-
- telephony_sat_emit_provide_local_info(sat, info_type);
- }break;
-
- case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:{
- GVariant *language_noti = NULL;
- gint command_id = 0;
- gint language = 0;
- gboolean b_specified = FALSE;
-
- language_noti = sat_manager_language_notification_noti(ctx, plugin_name, (struct tel_sat_language_notification_tlv*) &p_ind->proactive_ind_data.language_notification);
- if(!language_noti){
- dbg("no language_noti data");
- return TRUE;
- }
-
- dbg("language_noti type_format(%s)", g_variant_get_type_string(language_noti));
- g_variant_get(language_noti, "(iib)", &command_id, &language, &b_specified);
-
- sat_manager_update_language(ctx, plugin_name, language_noti);
-
- telephony_sat_emit_language_notification(sat, command_id, language, b_specified);
- }break;
-
- default:
- dbg("not handled ind->cmd_type[0x%x]", p_ind->cmd_type);
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <sys/time.h>
-#include <glib-object.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <storage.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_sat.h>
-#include <type/call.h>
-#include <type/sim.h>
-
-#include "generated-code.h"
-#include "common.h"
-#include "sat_manager.h"
-#include "sat_ui_support/sat_ui_support.h"
-
-#define SAT_DEF_CMD_Q_MAX 10
-#define SAT_TIME_OUT 30000
-
-static struct sat_manager_queue_data *sat_queue[SAT_DEF_CMD_Q_MAX] = {NULL, };
-
-static unsigned char _convert_decimal_to_bcd(int dec)
-{
- int tmp1, tmp0;
- unsigned char tmp3;
-
- tmp1 = dec/10;
- tmp0 = dec - tmp1*10;
- tmp3 = tmp0 << 4;
- tmp3 += tmp1;
-
- dbg("input decimal(%d), bcd(%d%d), endian(%x)", dec, tmp1, tmp0, tmp3);
- return tmp3;
-}
-
-static const gchar* _convert_sim_lang_to_string(enum tel_sim_language_type lang)
-{
- dbg("convert lang(%d)", lang);
- switch(lang){
- case SIM_LANG_GERMAN:
- return "de_DE.UTF-8";
- case SIM_LANG_ENGLISH:
- return "en_GB.UTF-8";
- case SIM_LANG_ITALIAN:
- return "it_IT.UTF-8";
- case SIM_LANG_FRENCH:
- return "fr_FR.UTF-8";
- case SIM_LANG_SPANISH:
- return "es_ES.UTF-8";
- case SIM_LANG_DUTCH:
- return "nl_NL.UTF-8";
- case SIM_LANG_SWEDISH:
- return "sv_SE.UTF-8";
- case SIM_LANG_DANISH:
- return "da_DK.UTF-8";
- case SIM_LANG_PORTUGUESE:
- return "pt_PT.UTF-8";
- case SIM_LANG_FINNISH:
- return "fi_FI.UTF-8";
- case SIM_LANG_NORWEGIAN:
- return "nb_NO.UTF-8";
- case SIM_LANG_GREEK:
- return "el_GR.UTF-8";
- case SIM_LANG_TURKISH:
- return "tr_TR.UTF-8";
- case SIM_LANG_HUNGARIAN:
- return "hu_HU.UTF-8";
- case SIM_LANG_POLISH:
- return "pl_PL.UTF-8";
- case SIM_LANG_KOREAN:
- return "ko_KR.UTF-8";
- case SIM_LANG_CHINESE:
- return "zh_CH.UTF-8";
- case SIM_LANG_RUSSIAN:
- return "ru_RU.UTF-8";
- case SIM_LANG_JAPANESE:
- return "ja_JP.UTF-8";
- default:
- return NULL;
- }//end of switch
-
- return NULL;
-}
-
-static enum tel_sim_language_type _convert_string_to_sim_lang(const gchar* lang_str)
-{
- dbg("convert lang(%s)", lang_str);
-
- if (g_str_equal(lang_str, "de_DE.UTF-8") == TRUE) {
- return SIM_LANG_GERMAN;
- }
- else if (g_str_equal(lang_str, "en_GB.UTF-8") == TRUE) {
- return SIM_LANG_ENGLISH;
- }
- else if (g_str_equal(lang_str, "it_IT.UTF-8") == TRUE) {
- return SIM_LANG_ITALIAN;
- }
- else if (g_str_equal(lang_str, "fr_FR.UTF-8") == TRUE) {
- return SIM_LANG_FRENCH;
- }
- else if (g_str_equal(lang_str, "es_ES.UTF-8") == TRUE) {
- return SIM_LANG_SPANISH;
- }
- else if (g_str_equal(lang_str, "nl_NL.UTF-8") == TRUE) {
- return SIM_LANG_DUTCH;
- }
- else if (g_str_equal(lang_str, "sv_SE.UTF-8") == TRUE) {
- return SIM_LANG_SWEDISH;
- }
- else if (g_str_equal(lang_str, "da_DK.UTF-8") == TRUE) {
- return SIM_LANG_DANISH;
- }
- else if (g_str_equal(lang_str, "pt_PT.UTF-8") == TRUE) {
- return SIM_LANG_PORTUGUESE;
- }
- else if (g_str_equal(lang_str, "fi_FI.UTF-8") == TRUE) {
- return SIM_LANG_FINNISH;
- }
- else if (g_str_equal(lang_str, "nb_NO.UTF-8") == TRUE) {
- return SIM_LANG_NORWEGIAN;
- }
- else if (g_str_equal(lang_str, "el_GR.UTF-8") == TRUE) {
- return SIM_LANG_GREEK;
- }
- else if (g_str_equal(lang_str, "tr_TR.UTF-8") == TRUE) {
- return SIM_LANG_TURKISH;
- }
- else if (g_str_equal(lang_str, "hu_HU.UTF-8") == TRUE) {
- return SIM_LANG_HUNGARIAN;
- }
- else if (g_str_equal(lang_str, "pl_PL.UTF-8") == TRUE) {
- return SIM_LANG_POLISH;
- }
- else if (g_str_equal(lang_str, "ko_KR.UTF-8") == TRUE) {
- return SIM_LANG_KOREAN;
- }
- else if (g_str_equal(lang_str, "zh_CH.UTF-8") == TRUE) {
- return SIM_LANG_CHINESE;
- }
- else if (g_str_equal(lang_str, "ru_RU.UTF-8") == TRUE) {
- return SIM_LANG_RUSSIAN;
- }
- else if (g_str_equal(lang_str, "ja_JP.UTF-8") == TRUE) {
- return SIM_LANG_JAPANESE;
- }
-
- dbg("there is no matched language");
- return SIM_LANG_UNSPECIFIED;
-}
-
-static unsigned int _get_time_in_ms(struct tel_sat_duration *dr)
-{
- switch (dr->time_unit) {
- case TIME_UNIT_MINUTES:
- return (unsigned int)dr->time_interval * 60000;
- break;
-
- case TIME_UNIT_SECONDS:
- return (unsigned int)dr->time_interval * 1000;
- break;
-
- case TIME_UNIT_TENTHS_OF_SECONDS:
- return (unsigned int)dr->time_interval * 100;
- break;
-
- case TIME_UNIT_RESERVED:
- default:
- return 0; // set default
- break;
- }
-
- return 0;
-}
-
-static int _get_queue_empty_index(void)
-{
- int cnt = 0;
- int i;
- int index = -1;
-
- for(i =0; i<SAT_DEF_CMD_Q_MAX ; i++) {
- if(sat_queue[i]) {
- dbg("index[%d] is being used",i);
- cnt++;
- }
- }
- for(i =0; i<SAT_DEF_CMD_Q_MAX ; i++) {
- if(!sat_queue[i]) {
- dbg("found empty slot [%p] at index [%d]", sat_queue[i] ,i);
- index = i;
- break;
- }
- }
- dbg("[SAT]SAT Command Queue current length [%d], MAX [%d]. \n", cnt, SAT_DEF_CMD_Q_MAX);
- return index;
-}
-
-static gboolean _push_data(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj)
-{
- struct sat_manager_queue_data *item;
- int index = cmd_obj->cmd_id;
-
- if (sat_queue[index]) {
- dbg("[SAT] sat_queue[%d] is not null [%p].\n", sat_queue[index]);
- return FALSE;
- }
-
- item = g_new0(struct sat_manager_queue_data, 1);
-
- if(!item) {
- dbg("[SAT] FAILED TO ALLOC QUEUE ITEM!\n");
- return FALSE;
- }
-
- memcpy((void*)item, (void*)cmd_obj, sizeof(struct sat_manager_queue_data));
- sat_queue[index] = item;
- dbg("push data to queue at index[%d], [%p].\n",index, item);
- return TRUE;
-}
-
-static gboolean _pop_nth_data(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int command_id)
-{
- struct sat_manager_queue_data *item;
- int index = command_id;
-
- if(!sat_queue[index]) {
- dbg("[SAT] sat_queue[%d] is null !!\n", index);
- return FALSE;
- }
-
- item = sat_queue[index];
-
- memcpy((void*)cmd_obj, (void*)item, sizeof(struct sat_manager_queue_data));
- dbg("pop data from queue at index[%d],[%p].\n",index, item);
- sat_queue[index] = NULL;
- g_free(item);
- return TRUE;
-}
-
-static gboolean _peek_nth_data(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int command_id)
-{
- struct sat_manager_queue_data *item = NULL;
-
- int index = command_id;
-
- if(!sat_queue[index]) {
- dbg("[SAT] sat_queue[%d] is null !!\n", index);
- return FALSE;
- }
-
- item = sat_queue[index];
- memcpy((void*)cmd_obj, (void*)item, sizeof(struct sat_manager_queue_data));
- dbg("peek data from queue at index[%d],[%p].\n",index, item);
- return TRUE;
-}
-
-void sat_manager_init_queue(struct custom_data *ctx)
-{
- int i;
- dbg("Enter");
- for(i=0;i<SAT_DEF_CMD_Q_MAX;i++) {
- sat_queue[i] = NULL;
- }
-}
-
-static gboolean sat_manager_enqueue_cmd(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj)
-{
- int id;
-
- id = _get_queue_empty_index();
- if(id < 0) {
- dbg("Fail to get empty index.\n");
- return FALSE;
- }
- cmd_obj->cmd_id = id;
- return _push_data(ctx, cmd_obj);
-}
-
-static gboolean sat_manager_dequeue_cmd_by_id(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int cmd_id)
-{
- return _pop_nth_data(ctx, cmd_obj, cmd_id);
-}
-
-static gboolean sat_manager_queue_peek_data_by_id(struct custom_data *ctx, struct sat_manager_queue_data *cmd_obj, int command_id)
-{
- return _peek_nth_data(ctx, cmd_obj, command_id);
-}
-
-static gboolean sat_manager_check_availiable_event_list(struct tel_sat_setup_event_list_tlv *event_list_tlv)
-{
- gboolean rv = TRUE;
- int index = 0;
-
- for(index = 0; index < event_list_tlv->event_list.event_list_cnt; index++){
- if(event_list_tlv->event_list.evt_list[index] == EVENT_USER_ACTIVITY){
- dbg("do user activity");
- }
- else if(event_list_tlv->event_list.evt_list[index] == EVENT_IDLE_SCREEN_AVAILABLE){
- dbg("do idle screen");
- }
- else if(event_list_tlv->event_list.evt_list[index] == EVENT_LANGUAGE_SELECTION){
- dbg("do language selection");
- }
- else if(event_list_tlv->event_list.evt_list[index] == EVENT_BROWSER_TERMINATION){
- dbg("do browser termination");
- }
- else if(event_list_tlv->event_list.evt_list[index] == EVENT_DATA_AVAILABLE){
- dbg("do data available (bip)");
- }
- else if(event_list_tlv->event_list.evt_list[index] == EVENT_CHANNEL_STATUS){
- dbg("do channel status (bip)");
- }
- else{
- dbg("unmanaged event (%d)", event_list_tlv->event_list.evt_list[index]);
- rv = FALSE;
- }
- }
-
- return rv;
-}
-
-static TReturn sat_manager_send_terminal_response(Communicator *comm, TcorePlugin *target_plg, struct treq_sat_terminal_rsp_data *tr)
-{
- TReturn rv = TCORE_RETURN_SUCCESS;
- UserRequest *ur = NULL;
-
- ur = tcore_user_request_new(comm, tcore_server_get_cp_name_by_plugin(target_plg));
- if (!ur) {
- dbg("ur is NULL");
- return TCORE_RETURN_FAILURE;
- }
-
- tcore_user_request_set_command(ur, TREQ_SAT_REQ_TERMINALRESPONSE);
- tcore_user_request_set_data(ur, sizeof(struct treq_sat_terminal_rsp_data), (void *)tr);
- rv = tcore_communicator_dispatch_request(comm, ur);
- if (rv != TCORE_RETURN_SUCCESS) {
- dbg("fail to send terminal response",rv);
- tcore_user_request_unref(ur);
- rv = TCORE_RETURN_FAILURE;
- }
-
- return rv;
-}
-
-gboolean sat_manager_remove_cmd_by_id(struct custom_data *ctx, int cmd_id)
-{
- struct sat_manager_queue_data *item;
- int index = cmd_id;
-
- if(!sat_queue[index]) {
- dbg("[SAT] sat_queue[%d] is already null !!\n", index);
- return FALSE;
- }
- item = sat_queue[index];
-
- dbg("remove data from queue at index[%d],[%p].\n",index, item);
- sat_queue[index] = NULL;
- g_free(item);
- return TRUE;
-}
-
-GVariant* sat_manager_caching_setup_menu_info(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_menu_tlv* setup_menu_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *setup_menu_info = NULL;
- struct sat_manager_queue_data q_data;
-
- gushort title_len = 0;
- gint command_id = 0, menu_cnt = 0;
- gboolean menu_present = FALSE, help_info = FALSE, updated = FALSE;
- gchar main_title[SAT_ALPHA_ID_LEN_MAX];
- GVariantBuilder *v_builder = NULL;
- GVariant *menu_items = NULL;
-
- dbg("interpreting setup menu notification");
- memset(&main_title, 0 , SAT_ALPHA_ID_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if ((setup_menu_tlv->icon_id.is_exist)
- && (setup_menu_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- && (!setup_menu_tlv->alpha_id.is_exist || setup_menu_tlv->alpha_id.alpha_data_len == 0)){
-
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("exceptional case to fix gcf case 2.4 command not understood");
-
- tr = g_new0(struct treq_sat_terminal_rsp_data, 1);
- tr->cmd_number = setup_menu_tlv->command_detail.cmd_num;
- tr->cmd_type = setup_menu_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.setup_menu.command_detail, &setup_menu_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_menu.device_id.src = setup_menu_tlv->device_id.dest;
- tr->terminal_rsp_data.setup_menu.device_id.dest = setup_menu_tlv->device_id.src;
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
- return NULL;
- }
-
- //check menu update
- if(ctx->cached_sat_main_menu){
- dbg("main menu info is updated");
- updated = TRUE;
- }
-
- //menu helpinfo
- help_info = setup_menu_tlv->command_detail.cmd_qualifier.setup_menu.help_info;
-
- //menu presence
- menu_present = setup_menu_tlv->command_detail.cmd_qualifier.setup_menu.select_preference;
-
- //menu item count
- menu_cnt = setup_menu_tlv->menu_item_cnt;
-
- //check the validation of content
- if(!menu_cnt || (setup_menu_tlv->menu_item_cnt == 1 && setup_menu_tlv->menu_item[0].text_len == 0)){
- //support GCF case 27.22.4.8.1 - 1.1 setup menu
-
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("no menu item");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = setup_menu_tlv->command_detail.cmd_num;
- tr->cmd_type = setup_menu_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.setup_menu.command_detail, &setup_menu_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_menu.device_id.src = setup_menu_tlv->device_id.dest;
- tr->terminal_rsp_data.setup_menu.device_id.dest = setup_menu_tlv->device_id.src;
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //get title
- if(setup_menu_tlv->alpha_id.alpha_data_len)
- tcore_util_convert_string_to_utf8((unsigned char*)&main_title,(unsigned short *)&title_len,
- setup_menu_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&setup_menu_tlv->alpha_id.alpha_data,
- (unsigned short)setup_menu_tlv->alpha_id.alpha_data_len);
- dbg("sat main menu title(%s)",main_title);
-
- v_builder = g_variant_builder_new(G_VARIANT_TYPE ("a(si)"));
-
- //get menu items
- if(!setup_menu_tlv->next_act_ind_list.cnt){
- int index = 0;
-
- dbg("setup_menu_tlv->next_act_ind_list.cnt == 0");
-
- for(index = 0; index < menu_cnt; index++){
- gushort item_len;
- gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
-
- if(!setup_menu_tlv->alpha_id.alpha_data_len)
- setup_menu_tlv->alpha_id.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
-
- memset(&item_str, 0 , SAT_ITEM_TEXT_LEN_MAX + 1);
- tcore_util_convert_string_to_utf8((unsigned char*)&item_str, (unsigned short *)&item_len,
- setup_menu_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&setup_menu_tlv->menu_item[index].text,
- (unsigned short)setup_menu_tlv->menu_item[index].text_len);
-
- dbg( "index(%d) item_id(%d) item_string(%s)", index, setup_menu_tlv->menu_item[index].item_id, item_str);
-
- //g_variant_builder_add(v_builder, "(sy)", &item_str, setup_menu_tlv->menu_item[index].item_id);
- g_variant_builder_add(v_builder, "(si)", item_str, (gint32)(setup_menu_tlv->menu_item[index].item_id));
- }
- }
- else{
- int index = 0;
-
- dbg("setup_menu_tlv->next_act_ind_list.cnt == 0");
-
- for(index = 0; index < menu_cnt; index++){
- gushort item_len;
- gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
-
- if(setup_menu_tlv->alpha_id.alpha_data_len == 0)
- setup_menu_tlv->alpha_id.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
-
- memset(&item_str, '\0' , SAT_ITEM_TEXT_LEN_MAX + 1);
- tcore_util_convert_string_to_utf8((unsigned char*)&item_str, (unsigned short *)&item_len,
- setup_menu_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&setup_menu_tlv->menu_item[index].text,
- (unsigned short)setup_menu_tlv->menu_item[index].text_len);
-
- if( setup_menu_tlv->next_act_ind_list.indicator_list[index] == SAT_PROATV_CMD_SEND_SMS) {
- g_strlcat(item_str," [Send SMS]", 11);
- }
- else if (setup_menu_tlv->next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_SETUP_CALL) {
- g_strlcat(item_str," [Set Up Call]", 14);
- }
- else if (setup_menu_tlv->next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_LAUNCH_BROWSER){
- g_strlcat(item_str," [Launch Browser]", 17);
- }
- else if (setup_menu_tlv->next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_PROVIDE_LOCAL_INFO) {
- g_strlcat(item_str," [Provide Terminal Information]", 31);
- }
-
- dbg( "index(%d) item_id(%d) item_string(%s)", index, setup_menu_tlv->menu_item[index].item_id, item_str);
-
- //g_variant_builder_add(v_builder, "(sy)", g_strdup(item_str), setup_menu_tlv->menu_item[index].item_id);
- g_variant_builder_add(v_builder, "(si)", item_str, (gint32)(setup_menu_tlv->menu_item[index].item_id));
- }
-
- }
- menu_items = g_variant_builder_end(v_builder);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SETUP_MENU;
- memcpy((void*)&(q_data.cmd_data.setupMenuInd), setup_menu_tlv, sizeof(struct tel_sat_setup_menu_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- setup_menu_info = g_variant_new("(ibsvibb)", command_id, menu_present, main_title, menu_items,
- menu_cnt, help_info, updated);
-
- return setup_menu_info;
-}
-
-GVariant* sat_manager_display_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_display_text_tlv* display_text_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *display_text = NULL;
- struct sat_manager_queue_data q_data;
-
- gushort text_len = 0;
- gint command_id = 0, duration= 0, tmp_duration = 0;
- gboolean immediately_rsp = FALSE, high_priority = FALSE, user_rsp_required = FALSE;
- gchar text[SAT_TEXT_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting display text notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if ( (display_text_tlv->icon_id.is_exist && display_text_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- || !display_text_tlv->text.string_length ){
-
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = display_text_tlv->command_detail.cmd_num;
- tr->cmd_type = display_text_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.display_text.command_detail, &display_text_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.display_text.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.display_text.device_id.dest = display_text_tlv->device_id.src;
- tr->terminal_rsp_data.display_text.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //user resp required & time_duration
- if(display_text_tlv->command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG){
- user_rsp_required = TRUE;
- duration = SAT_TIME_OUT;
- }
- else{
- duration = 15000;
- }
-
- //immediate response requested
- if (display_text_tlv->immediate_response_requested)
- immediately_rsp = TRUE;
-
- //high priority
- if (display_text_tlv->command_detail.cmd_qualifier.display_text.text_priority == TEXT_PRIORITY_HIGH)
- high_priority = TRUE;
- dbg("user rsp required(%d), immediately rsp(%d) priority(%d)",user_rsp_required, immediately_rsp, high_priority);
-
- //get text
- tcore_util_convert_string_to_utf8((unsigned char*) &text, (unsigned short *) &text_len,
- display_text_tlv->text.dcs.a_format,
- (unsigned char*) &display_text_tlv->text.string,
- (unsigned short) display_text_tlv->text.string_length);
- dbg("sat display text(%s)",text);
-
- //duration
- if(!display_text_tlv->duration.time_interval){
- tmp_duration = _get_time_in_ms(&display_text_tlv->duration);
- }
-
- if(tmp_duration > 0)
- duration = tmp_duration;
-
-/* ETSI TS 102 223 6.4.1 DISPLAY TEXT
- If help information is requested by the user, this command may be used to display help information on the screen. The
- help information should be sent as high priority text and with the option that it should be cleared after a short delay.*/
-
-/* if (ctx->help_requested == TRUE) {
- ad->bIsPriorityHigh = TRUE;
- ad->duration = 7000;
- ctx->help_requested = FALSE;
- }*/
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_DISPLAY_TEXT;
- memcpy((void*)&(q_data.cmd_data.displayTextInd), display_text_tlv, sizeof(struct tel_sat_display_text_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- display_text = g_variant_new("(isiibbbv)", command_id, text, text_len, duration,
- high_priority, user_rsp_required, immediately_rsp, icon_id);
-
- return display_text;
-}
-
-GVariant* sat_manager_select_item_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_select_item_tlv* select_item_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *select_item = NULL;
- struct sat_manager_queue_data q_data;
-
- int index = 0;
- gushort text_len = 0;
- gint command_id = 0, default_item_id = 0, menu_cnt = 0;
- gboolean help_info = FALSE;
- gchar text[SAT_TEXT_STRING_LEN_MAX];
- GVariantBuilder *v_builder = NULL;
- GVariant *menu_items = NULL;
- GVariant *icon_id = NULL;
- GVariant *icon_list = NULL;
-
- dbg("interpreting select item notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if ((select_item_tlv->icon_id.is_exist)
- && (select_item_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- && ( !select_item_tlv->alpha_id.is_exist || select_item_tlv->alpha_id.alpha_data_len == 0) ) {
-
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *) calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-
- tr->cmd_number = select_item_tlv->command_detail.cmd_num;
- tr->cmd_type = select_item_tlv->command_detail.cmd_type;
-
- memcpy((void*) &tr->terminal_rsp_data.select_item.command_detail, &select_item_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.select_item.device_id.src = select_item_tlv->device_id.dest;
- tr->terminal_rsp_data.select_item.device_id.dest = select_item_tlv->device_id.src;
- tr->terminal_rsp_data.select_item.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- // help info
- help_info = select_item_tlv->command_detail.cmd_qualifier.select_item.help_info;
-
- if(!select_item_tlv->alpha_id.is_exist){
- dbg("set the item dcs value to ALPHABET_FORMAT_8BIT_DATA");
- select_item_tlv->alpha_id.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- }
-
- // select item text
- if(select_item_tlv->alpha_id.is_exist && select_item_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- select_item_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&select_item_tlv->alpha_id.alpha_data,
- (unsigned short)select_item_tlv->alpha_id.alpha_data_len);
- dbg("select item text(%s)",text);
-
- //default item id
- default_item_id = select_item_tlv->item_identifier.item_identifier;
- dbg( "default item id(%d)", default_item_id);
-
- //item count
- menu_cnt = select_item_tlv->menu_item_cnt;
- dbg( "menu item count(%d)", menu_cnt);
-
- //items
- v_builder = g_variant_builder_new(G_VARIANT_TYPE ("a(iis)"));
- for(index= 0; index< menu_cnt; index++){
- gushort item_len;
- gchar item_str[SAT_ITEM_TEXT_LEN_MAX + 1];
-
- memset(&item_str, 0 , SAT_ITEM_TEXT_LEN_MAX + 1);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &item_str, (unsigned short *) &item_len,
- select_item_tlv->alpha_id.dcs.a_format,
- (unsigned char*) &select_item_tlv->menu_item[index].text,
- (unsigned short) select_item_tlv->menu_item[index].text_len);
-
- if (select_item_tlv->item_next_act_ind_list.cnt != 0) {
- if( select_item_tlv->item_next_act_ind_list.indicator_list[index] == SAT_PROATV_CMD_SEND_SMS) {
- g_strlcat(item_str," [Send SMS]", 11);
- }
- else if (select_item_tlv->item_next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_SETUP_CALL) {
- g_strlcat(item_str," [Set Up Call]", 14);
- }
- else if (select_item_tlv->item_next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_LAUNCH_BROWSER){
- g_strlcat(item_str," [Launch Browser]", 17);
- }
- else if (select_item_tlv->item_next_act_ind_list.indicator_list[index]== SAT_PROATV_CMD_PROVIDE_LOCAL_INFO) {
- g_strlcat(item_str," [Provide Terminal Information]", 31);
- }
- }
-
- item_len = strlen(item_str);
- dbg( "index(%d) item_id(%d) item_len(%d) item_string(%s)", index, select_item_tlv->menu_item[index].item_id, item_len, item_str);
- g_variant_builder_add(v_builder, "(iis)", (gint32)(select_item_tlv->menu_item[index].item_id), item_len, item_str);
- }
- menu_items = g_variant_builder_end(v_builder);
-
- // generate command id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SELECT_ITEM;
- memcpy((void*)&(q_data.cmd_data.selectItemInd), select_item_tlv, sizeof(struct tel_sat_select_item_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new_variant(menu_items);
- icon_list = g_variant_new_variant(menu_items);
-
- select_item = g_variant_new("(ibsiiivvv)", command_id, help_info, text, text_len,
- default_item_id, menu_cnt, menu_items, icon_id, icon_list);
-
- return select_item;
-}
-
-GVariant* sat_manager_get_inkey_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_inkey_tlv* get_inkey_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *get_inkey = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0, key_type = 0, input_character_mode = 0;
- gushort text_len = 0;
- gint duration = 0, tmp_duration = 0;
- gboolean b_numeric = FALSE, b_help_info = FALSE;
- gchar text[SAT_TEXT_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting get inkey notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if (get_inkey_tlv->icon_id.is_exist && !get_inkey_tlv->text.string_length
- && (get_inkey_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)){
-
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = get_inkey_tlv->command_detail.cmd_num;
- tr->cmd_type = get_inkey_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.get_inkey.command_detail, &get_inkey_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.get_inkey.device_id.src = get_inkey_tlv->device_id.dest;
- tr->terminal_rsp_data.get_inkey.device_id.dest = get_inkey_tlv->device_id.src;
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //key type
- key_type = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.inkey_type;
-
- //time duration
- duration = SAT_TIME_OUT;
- tmp_duration = _get_time_in_ms(&get_inkey_tlv->duration);
- if (tmp_duration > 0)
- duration = tmp_duration;
-
- //input mode
- input_character_mode = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_type;
-
- //numeric
- b_numeric = !get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.alphabet_set;
-
- //help info
- b_help_info = get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.help_info;
-
- //text & text len
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- get_inkey_tlv->text.dcs.a_format ,
- (unsigned char*)&get_inkey_tlv->text.string,
- (unsigned short)get_inkey_tlv->text.string_length);
-
- dbg("get inkey text(%s)",text);
-
- if (get_inkey_tlv->command_detail.cmd_qualifier.get_inkey.immediate_rsp_required) {
- dbg("get_inkey immediate_rsp_require is TRUE");
- //Send TR if UI display success
- }
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_GET_INKEY;
- memcpy((void*)&(q_data.cmd_data.getInkeyInd), get_inkey_tlv, sizeof(struct tel_sat_get_inkey_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- get_inkey = g_variant_new("(iiibbsiiv)", command_id, key_type, input_character_mode, b_numeric,
- b_help_info, text, text_len, duration, icon_id);
-
- return get_inkey;
-}
-
-GVariant* sat_manager_get_input_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_input_tlv* get_input_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *get_input = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0, input_character_mode = 0;
- gushort text_len = 0, def_text_len = 0;
- gint rsp_len_min = 0, rsp_len_max = 0;
- gboolean b_numeric = FALSE, b_help_info = FALSE, b_echo_input = FALSE;
- gchar text[SAT_TEXT_STRING_LEN_MAX], def_text[SAT_TEXT_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting get input notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if(get_input_tlv->icon_id.is_exist && get_input_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY ){
-
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = get_input_tlv->command_detail.cmd_num;
- tr->cmd_type = get_input_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.get_input.command_detail, &get_input_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.get_input.device_id.src = get_input_tlv->device_id.dest;
- tr->terminal_rsp_data.get_input.device_id.dest = get_input_tlv->device_id.src;
- tr->terminal_rsp_data.get_input.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
-
- g_free(tr);
- return NULL;
- }
-
- dbg( "[SAT] is SMS7 packing required [%d]",get_input_tlv->command_detail.cmd_qualifier.get_input.user_input_unpacked_format);
-
- //input mode
- input_character_mode = get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_type;
-
- //numeric
- b_numeric = !get_input_tlv->command_detail.cmd_qualifier.get_input.alphabet_set;
-
- //help info
- b_help_info = get_input_tlv->command_detail.cmd_qualifier.get_input.help_info;
-
- //echo input
- b_echo_input = get_input_tlv->command_detail.cmd_qualifier.get_input.me_echo_user_input;
- dbg("numeric (%d), help info(%d), echo input(%d)", b_numeric, b_help_info, b_echo_input);
-
- //text & text len
- if(get_input_tlv->text.string_length){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- get_input_tlv->text.dcs.a_format ,
- (unsigned char*)&get_input_tlv->text.string,
- (unsigned short)get_input_tlv->text.string_length);
- dbg("get input text(%s)",text);
- }
- else{
- memcpy(text,"", 1);
- text_len = 0;
- }
-
- //response length min & max
- rsp_len_min = get_input_tlv->rsp_len.min;
- rsp_len_max = get_input_tlv->rsp_len.max;
-
- //default text & default text len
- if(get_input_tlv->default_text.string_length){
- tcore_util_convert_string_to_utf8((unsigned char*)&def_text,(unsigned short *)&def_text_len,
- get_input_tlv->text.dcs.a_format ,
- (unsigned char*)&get_input_tlv->default_text.string,
- (unsigned short)get_input_tlv->default_text.string_length);
- dbg("get input default text(%s)",text);
- }
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_GET_INPUT;
- memcpy((void*)&(q_data.cmd_data.getInputInd), get_input_tlv, sizeof(struct tel_sat_get_input_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- get_input = g_variant_new("(iibbbsiiisiv)", command_id, input_character_mode, b_numeric, b_help_info,
- b_echo_input, text, text_len, rsp_len_max, rsp_len_min, def_text, def_text_len, icon_id);
-
- return get_input;
-}
-
-GVariant* sat_manager_play_tone_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_play_tone_tlv* play_tone_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *play_tone = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0, tone_type = 0, duration = 0, tmp_duration = 0;
- gushort text_len = 0;
- gchar text[SAT_TEXT_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting play tone notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if( (play_tone_tlv->icon_id.is_exist) && ( play_tone_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- && (!play_tone_tlv->alpha_id.is_exist || !play_tone_tlv->alpha_id.alpha_data_len))
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = play_tone_tlv->command_detail.cmd_num;
- tr->cmd_type = play_tone_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.play_tone.command_detail, &play_tone_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.play_tone.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.play_tone.device_id.dest = play_tone_tlv->device_id.src;
- tr->terminal_rsp_data.play_tone.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //text and text len
- if( play_tone_tlv->alpha_id.is_exist && play_tone_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- play_tone_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&play_tone_tlv->alpha_id.alpha_data,
- (unsigned short)play_tone_tlv->alpha_id.alpha_data_len);
- dbg("play tone ui display text (%s)",text);
- }
-
- //tone type
- tone_type = play_tone_tlv->tone.tone_type;
-
- //time duration
- duration = SAT_TIME_OUT;
- tmp_duration = _get_time_in_ms(&play_tone_tlv->duration);
- if (tmp_duration > 0)
- duration = tmp_duration;
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_PLAY_TONE;
- memcpy((void*)&(q_data.cmd_data.play_tone), play_tone_tlv, sizeof(struct tel_sat_play_tone_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- play_tone = g_variant_new("(isivii)", command_id, text, text_len, icon_id, tone_type, duration);
-
- return play_tone;
-}
-
-GVariant* sat_manager_send_sms_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_sms_tlv* send_sms_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *send_sms = NULL;
- struct sat_manager_queue_data q_data;
-
- int index = 0;
- gint command_id = 0, ton = 0, npi = 0, tpdu_type = 0;
- gboolean b_packing_required = FALSE;
- gushort text_len = 0;
- gint number_len = 0, tpdu_data_len = 0;
- gchar text[SAT_TEXT_STRING_LEN_MAX], dialling_number[SAT_DIALING_NUMBER_LEN_MAX];
- GVariantBuilder *builder = NULL;
- GVariant *tpdu_data = NULL;
- GVariant *icon_id = NULL;
-
- dbg("interpreting send sms notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&dialling_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if( (send_sms_tlv->icon_id.is_exist) && ( send_sms_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- && (!send_sms_tlv->alpha_id.is_exist || !send_sms_tlv->alpha_id.alpha_data_len))
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = send_sms_tlv->command_detail.cmd_num;
- tr->cmd_type = send_sms_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.send_sms.command_detail, &send_sms_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.send_sms.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_sms.device_id.dest = send_sms_tlv->device_id.src;
- tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //text and text len
- if( send_sms_tlv->alpha_id.is_exist && send_sms_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- send_sms_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&send_sms_tlv->alpha_id.alpha_data,
- (unsigned short)send_sms_tlv->alpha_id.alpha_data_len);
- dbg("send sms ui display text (%s)",text);
- }
- else{
- memcpy(text,"",1);
- text_len = 0;
- }
-
- //packing required
- b_packing_required = send_sms_tlv->command_detail.cmd_qualifier.send_sms.packing_by_me_required;
-
- //address : ton, npi, dialling number, number len
- ton = send_sms_tlv->address.ton;
- npi = send_sms_tlv->address.npi;
- number_len = send_sms_tlv->address.dialing_number_len;
- memcpy(dialling_number, send_sms_tlv->address.dialing_number, SAT_DIALING_NUMBER_LEN_MAX);
-
- //tpdu data : type, data, data len
- tpdu_type = send_sms_tlv->sms_tpdu.tpdu_type;
- tpdu_data_len = send_sms_tlv->sms_tpdu.data_len;
- builder = g_variant_builder_new(G_VARIANT_TYPE ("ay"));
- for (index = 0; index < tpdu_data_len; index++) {
- g_variant_builder_add(builder, "y", send_sms_tlv->sms_tpdu.data[index]);
- }
- tpdu_data = g_variant_builder_end(builder);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SEND_SMS;
- memcpy((void*)&(q_data.cmd_data.sendSMSInd), send_sms_tlv, sizeof(struct tel_sat_send_sms_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- send_sms = g_variant_new("(isivbiisiivi)", command_id, text, text_len, icon_id, b_packing_required,
- ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
-
- return send_sms;
-}
-
-GVariant* sat_manager_send_ss_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ss_tlv* send_ss_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *send_ss = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0, ton = 0, npi = 0;
- gushort text_len = 0;
- guchar ss_str_len = 0;
- gchar text[SAT_TEXT_STRING_LEN_MAX], ss_string[SAT_SS_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting send ss notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&ss_string, 0 , SAT_SS_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if( (send_ss_tlv->icon_id.is_exist) && ( send_ss_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- && (!send_ss_tlv->alpha_id.is_exist || !send_ss_tlv->alpha_id.alpha_data_len))
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = send_ss_tlv->command_detail.cmd_num;
- tr->cmd_type = send_ss_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.send_ss.command_detail, &send_ss_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.send_ss.device_id.src = send_ss_tlv->device_id.dest;
- tr->terminal_rsp_data.send_ss.device_id.dest = send_ss_tlv->device_id.src;
- tr->terminal_rsp_data.send_ss.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //text and text len
- if( send_ss_tlv->alpha_id.is_exist && send_ss_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- send_ss_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&send_ss_tlv->alpha_id.alpha_data,
- (unsigned short)send_ss_tlv->alpha_id.alpha_data_len);
- dbg("send ss ui display text (%s)",text);
- }
-
- //ss string: ton, npi, ss string len, ss string
- ton = send_ss_tlv->ss_string.ton;
- npi = send_ss_tlv->ss_string.npi;
- ss_str_len = send_ss_tlv->ss_string.string_len;
- memcpy(ss_string, send_ss_tlv->ss_string.ss_string, SAT_SS_STRING_LEN_MAX);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SEND_SS;
- memcpy((void*)&(q_data.cmd_data.send_ss), send_ss_tlv, sizeof(struct tel_sat_send_ss_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- send_ss = g_variant_new("(isiviiis)", command_id, text, text_len, icon_id,
- ton, npi, ss_str_len, ss_string);
-
- return send_ss;
-}
-
-GVariant* sat_manager_send_ussd_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ussd_tlv* send_ussd_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *send_ussd = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0;
- gushort text_len = 0, ussd_str_len = 0;
- gchar text[SAT_TEXT_STRING_LEN_MAX], ussd_string[SAT_USSD_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting send ussd notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&ussd_string, 0 , SAT_USSD_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if( (send_ussd_tlv->icon_id.is_exist) && ( send_ussd_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- && (!send_ussd_tlv->alpha_id.is_exist || !send_ussd_tlv->alpha_id.alpha_data_len))
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = send_ussd_tlv->command_detail.cmd_num;
- tr->cmd_type = send_ussd_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.send_ussd.command_detail, &send_ussd_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.send_ussd.device_id.src = send_ussd_tlv->device_id.dest;
- tr->terminal_rsp_data.send_ussd.device_id.dest = send_ussd_tlv->device_id.src;
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //text and text len
- if( send_ussd_tlv->alpha_id.is_exist && send_ussd_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- send_ussd_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&send_ussd_tlv->alpha_id.alpha_data,
- (unsigned short)send_ussd_tlv->alpha_id.alpha_data_len);
- dbg("send ussd ui display text (%s)",text);
- }
-
- //ussd string
- tcore_util_convert_string_to_utf8((unsigned char*)&ussd_string,(unsigned short *)&ussd_str_len,
- send_ussd_tlv->ussd_string.dsc.a_format,
- (unsigned char*)&send_ussd_tlv->ussd_string.ussd_string,
- (unsigned short)send_ussd_tlv->ussd_string.string_len);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SEND_USSD;
- memcpy((void*)&(q_data.cmd_data.send_ussd), send_ussd_tlv, sizeof(struct tel_sat_send_ussd_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- send_ussd = g_variant_new("(isivis)", command_id, text, text_len, icon_id, ussd_str_len, ussd_string);
-
- return send_ussd;
-}
-
-GVariant* sat_manager_setup_call_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_call_tlv* setup_call_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *setup_call = NULL;
- struct sat_manager_queue_data q_data;
-
- gushort text_len = 0, confirm_text_len = 0;
- gint command_id = 0, call_type = 0, duration = 0;
- gchar confirm_text[SAT_TEXT_STRING_LEN_MAX], text[SAT_TEXT_STRING_LEN_MAX], call_number[SAT_DIALING_NUMBER_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting setup call notification");
- memset(&confirm_text, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&call_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if(setup_call_tlv->duration.time_interval > 0)
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] redial is not supported.\n");
-
- tr = g_new0(struct treq_sat_terminal_rsp_data, 1);
- tr->cmd_number = setup_call_tlv->command_detail.cmd_num;
- tr->cmd_type = setup_call_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.setup_call.command_detail, &setup_call_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_call.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.setup_call.device_id.dest = setup_call_tlv->device_id.src;
- tr->terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
- return NULL;
- }
-
- //check for subaddress field
- if(setup_call_tlv->subaddress.subaddress_len > 0)
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] Sub address is not supported > 0)");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = setup_call_tlv->command_detail.cmd_num;
- tr->cmd_type = setup_call_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.setup_call.command_detail, &setup_call_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_call.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.setup_call.device_id.dest = setup_call_tlv->device_id.src;
- tr->terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
- return NULL;
- }
-
- //call type
- call_type = setup_call_tlv->command_detail.cmd_qualifier.setup_call.setup_call;
-
- //call display data
- if(setup_call_tlv->call_setup_alpha_id.alpha_data_len != 0){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- setup_call_tlv->call_setup_alpha_id.dcs.a_format,
- (unsigned char*)&setup_call_tlv->call_setup_alpha_id.alpha_data,
- (unsigned short)setup_call_tlv->call_setup_alpha_id.alpha_data_len);
- }
- else{
- memcpy(text, setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
- text_len = setup_call_tlv->address.dialing_number_len;
- }
- dbg("setup call display text (%s)",text);
-
- if(setup_call_tlv->user_confirm_alpha_id.alpha_data_len != 0){
- tcore_util_convert_string_to_utf8((unsigned char*)&confirm_text,(unsigned short *)&confirm_text_len,
- setup_call_tlv->user_confirm_alpha_id.dcs.a_format,
- (unsigned char*)&setup_call_tlv->user_confirm_alpha_id.alpha_data,
- (unsigned short)setup_call_tlv->user_confirm_alpha_id.alpha_data_len);
- }
-
- //call number
- if(setup_call_tlv->address.ton == TON_INTERNATIONAL){
- call_number[0] = '+';
- memcpy(&call_number[1],setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
- }
- else{
- memcpy(call_number,setup_call_tlv->address.dialing_number, setup_call_tlv->address.dialing_number_len);
- }
- dbg("setup call call number(%s)",setup_call_tlv->address.dialing_number);
-
- //duration
- if(setup_call_tlv->duration.time_interval > 0)
- duration = _get_time_in_ms(&setup_call_tlv->duration);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SETUP_CALL;
- memcpy((void*)&(q_data.cmd_data.setup_call), setup_call_tlv, sizeof(struct tel_sat_setup_call_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- setup_call = g_variant_new("(isisivisi)", command_id, confirm_text, confirm_text_len, text, text_len, icon_id, call_type, call_number, duration);
-
- return setup_call;
-}
-
-GVariant* sat_manager_setup_event_list_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_event_list_tlv *event_list_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *event_list = NULL;
-
- int index = 0;
- gboolean rv = FALSE;
- gint event_cnt = 0;
- GVariantBuilder *builder = NULL;
- GVariant *evt_list = NULL;
- struct treq_sat_terminal_rsp_data *tr = NULL;
-
- dbg("interpreting event list notification");
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- //event cnt
- event_cnt = event_list_tlv->event_list.event_list_cnt;
- dbg("event cnt(%d)", event_cnt);
-
- //get event
- builder = g_variant_builder_new(G_VARIANT_TYPE ("ai"));
- for (index = 0; index < event_cnt; index++) {
- g_variant_builder_add(builder, "i", event_list_tlv->event_list.evt_list[index]);
- }
- evt_list = g_variant_builder_end(builder);
-
- event_list = g_variant_new("(iv)", event_cnt, evt_list);
-
- //send TR - does not need from application's response
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = event_list_tlv->command_detail.cmd_num;
- tr->cmd_type = event_list_tlv->command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.setup_event_list.command_detail, &event_list_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_event_list.device_id.src = event_list_tlv->device_id.dest;
- tr->terminal_rsp_data.setup_event_list.device_id.dest = event_list_tlv->device_id.src;
- tr->terminal_rsp_data.setup_event_list.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.setup_event_list.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-
- rv = sat_manager_check_availiable_event_list(event_list_tlv);
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return event_list;
-}
-
-GVariant* sat_manager_setup_idle_mode_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_idle_mode_text_tlv *idle_mode_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *idle_mode = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0;
- gushort text_len = 0;
- gchar text[SAT_TEXT_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting setup idle mode text notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if( ((idle_mode_tlv->icon_id.is_exist) && ( idle_mode_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY))
- && idle_mode_tlv->text.string_length == 0 )
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = idle_mode_tlv->command_detail.cmd_num;
- tr->cmd_type = idle_mode_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.setup_idle_mode_text.command_detail, &idle_mode_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_idle_mode_text.device_id.src = idle_mode_tlv->device_id.dest;
- tr->terminal_rsp_data.setup_idle_mode_text.device_id.dest = idle_mode_tlv->device_id.src;
- tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
- return NULL;
- }
-
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- idle_mode_tlv->text.dcs.a_format,
- (unsigned char*)&idle_mode_tlv->text.string,
- (unsigned short)idle_mode_tlv->text.string_length);
-
- dbg("setup idle mode text display text (%s)",text);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT;
- memcpy((void*)&(q_data.cmd_data.idle_mode), idle_mode_tlv, sizeof(struct tel_sat_setup_idle_mode_text_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- idle_mode = g_variant_new("(isiv)", command_id, text, text_len, icon_id);
-
- return idle_mode;
-}
-
-GVariant* sat_manager_open_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_open_channel_tlv *open_channel_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *open_channel = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0, bearer_type = 0, protocol_type = 0, dest_addr_type = 0;
- gboolean immediate_link = FALSE, auto_reconnection = FALSE, bg_mode = FALSE;
- gushort text_len = 0;
- gint buffer_size = 0, port_number = 0;
- gchar text[SAT_ALPHA_ID_LEN_MAX], dest_address[SAT_OTHER_ADDR_LEN_MAX];
- GVariant *icon_id = NULL;
- GVariant *bearer_param = NULL;
- GVariant *bearer_detail = NULL;
-
- dbg("interpreting open channel notification");
- memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
- memset(&dest_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- //immediate link
- immediate_link = open_channel_tlv->command_detail.cmd_qualifier.open_channel.immediate_link;
-
- //auto reconnection
- auto_reconnection = open_channel_tlv->command_detail.cmd_qualifier.open_channel.automatic_reconnection;
-
- //back ground mode
- bg_mode = open_channel_tlv->command_detail.cmd_qualifier.open_channel.background_mode;
-
- //open channel text
- if(open_channel_tlv->alpha_id.is_exist && open_channel_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- open_channel_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&open_channel_tlv->alpha_id.alpha_data,
- (unsigned short)open_channel_tlv->alpha_id.alpha_data_len);
- dbg("open channel text(%s)",text);
-
- //buffer size
- buffer_size = open_channel_tlv->buffer_size.size[0];
- buffer_size = buffer_size << 8;
- buffer_size += open_channel_tlv->buffer_size.size[1];
- //memcpy(&buffer_size, open_channel_tlv->buffer_size.size, sizeof(unsigned char)*2);
- dbg("buffer size(%d)", buffer_size);
-
- //interface transport level
- protocol_type = open_channel_tlv->interface_transport_level.protocol_type;
- port_number = open_channel_tlv->interface_transport_level.port_number;
-
- //data destination address
- dest_addr_type = open_channel_tlv->data_destination_address.address_type;
- memcpy(dest_address, open_channel_tlv->data_destination_address.address, open_channel_tlv->data_destination_address.address_len);
- dbg("destination IP address (%s)", dest_address);
-
- //bearer type
- bearer_type = open_channel_tlv->bearer_desc.bearer_type;
-
- //bearer param & bearer detail
- switch(bearer_type){
- case BEARER_CSD:{
- //bearer param
- gint data_rate = 0, service_type = 0, conn_element_type = 0;
-
- //bearer detail
- gint ton = 0, npi = 0, time_duration1 = 0, time_duration2 = 0, other_addr_type = 0;
- gushort login_len = 0, pwd_len = 0;
- gchar dialling_number[SAT_DIALING_NUMBER_LEN_MAX], sub_addr[SAT_SUB_ADDR_LEN_MAX];
- gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
- gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
-
- memset(&dialling_number, 0 , SAT_DIALING_NUMBER_LEN_MAX);
- memset(&sub_addr, 0 , SAT_SUB_ADDR_LEN_MAX);
- memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
- memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- //bearer parameter
- data_rate = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.data_rate;
- service_type = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.service_type;
- conn_element_type = open_channel_tlv->bearer_desc.bearer_parameter.cs_bearer_param.connection_element_type;
-
- bearer_param = g_variant_new("(iii)", data_rate, service_type, conn_element_type);
-
- //bearer detail
- ton = open_channel_tlv->bearer_detail.cs_bearer.address.ton;
- npi = open_channel_tlv->bearer_detail.cs_bearer.address.npi;
- memcpy(dialling_number, open_channel_tlv->bearer_detail.cs_bearer.address.dialing_number, open_channel_tlv->bearer_detail.cs_bearer.address.dialing_number_len);
-
- memcpy(sub_addr, open_channel_tlv->bearer_detail.cs_bearer.subaddress.subaddress, open_channel_tlv->bearer_detail.cs_bearer.subaddress.subaddress_len);
-
- time_duration1 = _get_time_in_ms(&open_channel_tlv->bearer_detail.cs_bearer.duration1);
- time_duration2 = _get_time_in_ms(&open_channel_tlv->bearer_detail.cs_bearer.duration2);
-
- other_addr_type = open_channel_tlv->bearer_detail.cs_bearer.other_address.address_type;
- memcpy(other_address, open_channel_tlv->bearer_detail.cs_bearer.other_address.address, open_channel_tlv->bearer_detail.cs_bearer.other_address.address_len);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
- open_channel_tlv->bearer_detail.cs_bearer.text_user_login.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string,
- (unsigned short) open_channel_tlv->bearer_detail.cs_bearer.text_user_login.string_length);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
- open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string,
- (unsigned short) open_channel_tlv->bearer_detail.cs_bearer.text_user_pwd.string_length);
-
- bearer_detail= g_variant_new("(iissiiisss)", ton, npi, dialling_number, sub_addr, time_duration1, time_duration2,
- other_addr_type, other_address, login, pwd);
- } break;
- case BEARER_GPRS:{
- //bearer param
- gint precedence_class = 0, delay_class = 0, reliability_class = 0;
- gint peak_class = 0, mean_class = 0, pdp_type = 0;
-
- //bearer detail
- gint other_addr_type = 0;
- gushort login_len = 0, pwd_len = 0;
- gchar network_access_name[SAT_NET_ACC_NAM_LEN_MAX];
- gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
- gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
-
- memset(&network_access_name, 0 , SAT_NET_ACC_NAM_LEN_MAX);
- memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
- memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- //bearer parameter
- precedence_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.precedence_class;
- delay_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.delay_class;
- reliability_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.reliability_class;
- peak_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.peak_throughput_class;
- mean_class = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.mean_throughput_class;
- pdp_type = open_channel_tlv->bearer_desc.bearer_parameter.ps_bearer_param.pdp_type;
-
- bearer_param = g_variant_new("(iiiiii)", precedence_class, delay_class, reliability_class, peak_class, mean_class, pdp_type);
-
- memcpy(network_access_name, open_channel_tlv->bearer_detail.ps_bearer.network_access_name.network_access_name, open_channel_tlv->bearer_detail.ps_bearer.network_access_name.length);
-
- other_addr_type = open_channel_tlv->bearer_detail.ps_bearer.other_address.address_type;
- memcpy(other_address, open_channel_tlv->bearer_detail.ps_bearer.other_address.address, open_channel_tlv->bearer_detail.ps_bearer.other_address.address_len);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
- open_channel_tlv->bearer_detail.ps_bearer.text_user_login.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string,
- (unsigned short) open_channel_tlv->bearer_detail.ps_bearer.text_user_login.string_length);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
- open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string,
- (unsigned short) open_channel_tlv->bearer_detail.ps_bearer.text_user_pwd.string_length);
-
- bearer_detail= g_variant_new("(sisss)", network_access_name, other_addr_type, other_address, login, pwd);
-
- } break;
- case BEARER_DEFAULT_BEARER_FROM_TRANSPORT_LAYER:{
- //bearer param
-
- //bearer detail
- gint other_addr_type = 0;
- gushort login_len = 0, pwd_len = 0;
- gchar other_address[SAT_OTHER_ADDR_LEN_MAX];
- gchar login[SAT_TEXT_STRING_LEN_MAX], pwd[SAT_TEXT_STRING_LEN_MAX];
-
- memset(&other_address, 0 , SAT_OTHER_ADDR_LEN_MAX);
- memset(&login, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- //bearer parameter
- bearer_param = g_variant_new("()");
-
- other_addr_type = open_channel_tlv->bearer_detail.default_bearer.other_address.address_type;
- memcpy(other_address, open_channel_tlv->bearer_detail.default_bearer.other_address.address, open_channel_tlv->bearer_detail.default_bearer.other_address.address_len);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &login, (unsigned short *) &login_len,
- open_channel_tlv->bearer_detail.default_bearer.text_user_login.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_login.string,
- (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_login.string_length);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
- open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
- (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string_length);
-
- bearer_detail= g_variant_new("(isss)", other_addr_type, other_address, login, pwd);
-
- } break;
- case BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT:{
- //bearer param
-
- //bearer detail
- gushort pwd_len = 0;
- gint remote_address_type =0, time_duration1 = 0, time_duration2 = 0;
- gchar remote_address[SAT_REMOTE_ENTITY_ADDR_LEN_MAX];
- gchar pwd[SAT_TEXT_STRING_LEN_MAX];
-
- memset(&remote_address, 0 , SAT_REMOTE_ENTITY_ADDR_LEN_MAX);
- memset(&pwd, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- //bearer parameter
- bearer_param = g_variant_new("()");
-
- time_duration1 = _get_time_in_ms(&open_channel_tlv->bearer_detail.local_bearer.duration1);
- time_duration2 = _get_time_in_ms(&open_channel_tlv->bearer_detail.local_bearer.duration2);
-
- tcore_util_convert_string_to_utf8((unsigned char*) &pwd, (unsigned short *) &pwd_len,
- open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.dcs.a_format,
- (unsigned char*) &open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string,
- (unsigned short) open_channel_tlv->bearer_detail.default_bearer.text_user_pwd.string_length);
-
- remote_address_type = open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.coding_type;
- memcpy(remote_address, open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.remote_entity_address, open_channel_tlv->bearer_detail.local_bearer.remote_entity_address.length);
-
- bearer_detail= g_variant_new("(iisis)", time_duration1, time_duration2, pwd, remote_address_type, remote_address);
-
- } break;
- default:
- dbg("invalid bearer data");
- return NULL;
- }//end of switch
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_OPEN_CHANNEL;
- memcpy((void*)&(q_data.cmd_data.open_channel), open_channel_tlv, sizeof(struct tel_sat_open_channel_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- //execute bip
- //sat_ui_support_exec_bip();
-
- open_channel = g_variant_new("(isivbbbiviiiisv)", command_id, text, text_len, icon_id, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
-
- return open_channel;
-}
-
-GVariant* sat_manager_close_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_close_channel_tlv *close_channel_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *close_channel = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0, channel_id = 0;
- gushort text_len = 0;
- gchar text[SAT_ALPHA_ID_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting close channel notification");
- memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- //channel id
- channel_id = close_channel_tlv->device_id.dest;
-
- //close channel text
- if(close_channel_tlv->alpha_id.is_exist && close_channel_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- close_channel_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&close_channel_tlv->alpha_id.alpha_data,
- (unsigned short)close_channel_tlv->alpha_id.alpha_data_len);
- dbg("close channel text(%s)",text);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_CLOSE_CHANNEL;
- memcpy((void*)&(q_data.cmd_data.close_channel), close_channel_tlv, sizeof(struct tel_sat_close_channel_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- close_channel = g_variant_new("(isivi)", command_id, text, text_len, icon_id, channel_id);
-
- return close_channel;
-}
-
-GVariant* sat_manager_receive_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_receive_channel_tlv *receive_data_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *receive_data = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0, channel_id = 0;
- gushort text_len = 0;
- gint channel_data_len = 0;
- gchar text[SAT_ALPHA_ID_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting receive data notification");
- memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- //channel id
- channel_id = receive_data_tlv->device_id.dest;
-
- //receive data text
- if(receive_data_tlv->alpha_id.is_exist && receive_data_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- receive_data_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&receive_data_tlv->alpha_id.alpha_data,
- (unsigned short)receive_data_tlv->alpha_id.alpha_data_len);
- dbg("receive data text(%s)",text);
-
- channel_data_len = receive_data_tlv->channel_data_len.data_len;
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_RECEIVE_DATA;
- memcpy((void*)&(q_data.cmd_data.receive_data), receive_data_tlv, sizeof(struct tel_sat_receive_channel_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- receive_data = g_variant_new("(isivii)", command_id, text, text_len, icon_id, channel_id, channel_data_len);
-
- return receive_data;
-}
-
-GVariant* sat_manager_send_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_channel_tlv *send_data_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *send_data = NULL;
- struct sat_manager_queue_data q_data;
-
- int index = 0;
- gint command_id = 0, channel_id = 0, data_len = 0;
- gboolean send_data_immediately = FALSE;
- gushort text_len = 0;
- gchar text[SAT_ALPHA_ID_LEN_MAX];
- GVariantBuilder *builder = NULL;
- GVariant *channel_data = NULL;
- GVariant *icon_id = NULL;
-
- dbg("interpreting send data notification");
- memset(&text, 0 , SAT_ALPHA_ID_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- //send data immediately
- send_data_immediately = send_data_tlv->command_detail.cmd_qualifier.send_data.send_data_immediately;
-
- //channel id
- channel_id = send_data_tlv->device_id.dest;
-
- //send data text
- if(send_data_tlv->alpha_id.is_exist && send_data_tlv->alpha_id.alpha_data_len > 0)
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- send_data_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&send_data_tlv->alpha_id.alpha_data,
- (unsigned short)send_data_tlv->alpha_id.alpha_data_len);
- dbg("send data text(%s)",text);
-
- //channel data, data len
- data_len = send_data_tlv->channel_data.data_string_len;
- builder = g_variant_builder_new(G_VARIANT_TYPE ("ay"));
- for (index = 0; index < data_len; index++) {
- dbg("send data index(%d) data(0x%x)",index, send_data_tlv->channel_data.data_string[index]);
- g_variant_builder_add(builder, "y", send_data_tlv->channel_data.data_string[index]);
- }
- channel_data = g_variant_builder_end(builder);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SEND_DATA;
- memcpy((void*)&(q_data.cmd_data.send_data), send_data_tlv, sizeof(struct tel_sat_send_channel_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- send_data = g_variant_new("(isivibvi)", command_id, text, text_len, icon_id, channel_id, send_data_immediately, channel_data, data_len);
-
- return send_data;
-}
-
-GVariant* sat_manager_get_channel_status_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_channel_status_tlv *get_channel_status_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *get_channel_status = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0;
-
- dbg("interpreting get channel status notification");
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_GET_CHANNEL_STATUS;
- memcpy((void*)&(q_data.cmd_data.get_channel_status), get_channel_status_tlv, sizeof(struct tel_sat_get_channel_status_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- get_channel_status = g_variant_new("(i)", command_id);
-
- return get_channel_status;
-}
-
-GVariant* sat_manager_refresh_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_refresh_tlv *refresh_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *refresh = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0;
- gint refresh_type =0;
- GVariantBuilder *builder = NULL;
- GVariant *file_list = NULL;
- int index = 0;
-
- dbg("interpreting refresh notification");
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- refresh_type = refresh_tlv->command_detail.cmd_qualifier.refresh.refresh;
-
- builder = g_variant_builder_new(G_VARIANT_TYPE ("ai"));
- for (index = 0; index < refresh_tlv->file_list.file_count; index++) {
- g_variant_builder_add(builder, "i", refresh_tlv->file_list.file_id[index]);
- }
- file_list = g_variant_builder_end(builder);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_REFRESH;
- memcpy((void*)&(q_data.cmd_data.refresh), refresh_tlv, sizeof(struct tel_sat_refresh_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- refresh = g_variant_new("(iiv)", command_id, refresh_type, file_list);
-
- return refresh;
-}
-
-void sat_manager_more_time_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_more_time_tlv *more_time_tlv)
-{
- TcorePlugin *plg = NULL;
- struct treq_sat_terminal_rsp_data *tr = NULL;
-
- dbg("interpreting more time notification");
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return;
- }
- //send TR - does not need from application's response
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = more_time_tlv->command_detail.cmd_num;
- tr->cmd_type = more_time_tlv->command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.more_time.command_detail, &more_time_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.more_time.device_id.src = more_time_tlv->device_id.dest;
- tr->terminal_rsp_data.more_time.device_id.dest = more_time_tlv->device_id.src;
- tr->terminal_rsp_data.more_time.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.more_time.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return;
-}
-
-GVariant* sat_manager_send_dtmf_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_dtmf_tlv *send_dtmf_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *send_dtmf = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0;
- gushort text_len = 0;
- gint dtmf_str_len =0;
- gchar text[SAT_TEXT_STRING_LEN_MAX], dtmf_str[SAT_DTMF_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting send dtmf notification");
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&dtmf_str, 0 , SAT_DTMF_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if( (send_dtmf_tlv->icon_id.is_exist) && ( send_dtmf_tlv->icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- && (!send_dtmf_tlv->alpha_id.is_exist || !send_dtmf_tlv->alpha_id.alpha_data_len))
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = send_dtmf_tlv->command_detail.cmd_num;
- tr->cmd_type = send_dtmf_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.send_dtmf.command_detail, &send_dtmf_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.send_dtmf.device_id.src = send_dtmf_tlv->device_id.dest;
- tr->terminal_rsp_data.send_dtmf.device_id.dest = send_dtmf_tlv->device_id.src;
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //text and text len
- if( send_dtmf_tlv->alpha_id.is_exist && send_dtmf_tlv->alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- send_dtmf_tlv->alpha_id.dcs.a_format,
- (unsigned char*)&send_dtmf_tlv->alpha_id.alpha_data,
- (unsigned short)send_dtmf_tlv->alpha_id.alpha_data_len);
- dbg("send dtmf ui display text (%s)",text);
- }
-
- //dtmf string len, dtmf string
- dtmf_str_len = send_dtmf_tlv->dtmf_string.dtmf_length;
- memcpy(dtmf_str, send_dtmf_tlv->dtmf_string.dtmf_string, SAT_DTMF_STRING_LEN_MAX);
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_SEND_DTMF;
- memcpy((void*)&(q_data.cmd_data.send_dtmf), send_dtmf_tlv, sizeof(struct tel_sat_send_dtmf_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- send_dtmf = g_variant_new("(isivis)", command_id, text, text_len, icon_id,
- dtmf_str_len, dtmf_str);
-
- return send_dtmf;
-}
-
-GVariant* sat_manager_launch_browser_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_launch_browser_tlv *launch_browser_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *launch_browser = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0;
- gint browser_launch_type = 0, browser_id = 0;
- gint url_len =0;
- gushort text_len = 0, gateway_proxy_len = 0;
- gchar url[SAT_URL_LEN_MAX], text[SAT_TEXT_STRING_LEN_MAX], gateway_proxy[SAT_TEXT_STRING_LEN_MAX];
- GVariant *icon_id = NULL;
-
- dbg("interpreting launch browser notification");
- memset(&url, 0 , SAT_URL_LEN_MAX);
- memset(&text, 0 , SAT_TEXT_STRING_LEN_MAX);
- memset(&gateway_proxy, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if( (launch_browser_tlv->user_confirm_icon_id.is_exist) && ( launch_browser_tlv->user_confirm_icon_id.icon_qualifer == ICON_QUALI_NOT_SELF_EXPLANATORY)
- && (!launch_browser_tlv->user_confirm_alpha_id.is_exist || !launch_browser_tlv->user_confirm_alpha_id.alpha_data_len))
- {
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] exceptional case to fix gcf case 2.4 command not understood");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = launch_browser_tlv->command_detail.cmd_num;
- tr->cmd_type = launch_browser_tlv->command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.launch_browser.command_detail, &launch_browser_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.launch_browser.device_id.src = launch_browser_tlv->device_id.dest;
- tr->terminal_rsp_data.launch_browser.device_id.dest = launch_browser_tlv->device_id.src;
- tr->terminal_rsp_data.launch_browser.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return NULL;
- }
-
- //browser launch type
- browser_launch_type = launch_browser_tlv->command_detail.cmd_qualifier.launch_browser.launch_browser;
-
- //browser id
- browser_id = launch_browser_tlv->browser_id;
-
- //url and url len
- if( launch_browser_tlv->url.url_length){
- url_len = launch_browser_tlv->url.url_length;
- memcpy(url, launch_browser_tlv->url.url, launch_browser_tlv->url.url_length);
- dbg("launch browser url (%s)",url);
- }
-
- //gateway_proxy_text
- if(launch_browser_tlv->gateway_proxy_text.is_digit_only) {
- memcpy(gateway_proxy, launch_browser_tlv->gateway_proxy_text.string, launch_browser_tlv->gateway_proxy_text.string_length);
- dbg("launch browser gateway_proxy digit type string (%s)",gateway_proxy);
- } else {
- if( launch_browser_tlv->gateway_proxy_text.string_length){
- tcore_util_convert_string_to_utf8((unsigned char*)&gateway_proxy,(unsigned short *)&gateway_proxy_len,
- launch_browser_tlv->gateway_proxy_text.dcs.a_format,
- (unsigned char*)&launch_browser_tlv->gateway_proxy_text.string,
- (unsigned short)launch_browser_tlv->gateway_proxy_text.string_length);
- dbg("launch browser gateway_proxy_text (%s)",gateway_proxy);
- }
- }
-
- //user confirm text and user confirm text len
- if( launch_browser_tlv->user_confirm_alpha_id.is_exist && launch_browser_tlv->user_confirm_alpha_id.alpha_data_len){
- tcore_util_convert_string_to_utf8((unsigned char*)&text,(unsigned short *)&text_len,
- launch_browser_tlv->user_confirm_alpha_id.dcs.a_format,
- (unsigned char*)&launch_browser_tlv->user_confirm_alpha_id.alpha_data,
- (unsigned short)launch_browser_tlv->user_confirm_alpha_id.alpha_data_len);
- dbg("launch browser user confirm text (%s)",text);
- }
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_LAUNCH_BROWSER;
- memcpy((void*)&(q_data.cmd_data.launch_browser), launch_browser_tlv, sizeof(struct tel_sat_launch_browser_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- icon_id = g_variant_new("()");
-
- launch_browser = g_variant_new("(iiisisisiv)",
- command_id, browser_launch_type, browser_id, url, url_len, gateway_proxy, gateway_proxy_len, text, text_len, icon_id);
-
- return launch_browser;
-}
-
-GVariant* sat_manager_provide_local_info_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_provide_local_info_tlv *provide_local_info_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *provide_info = NULL;
-
- gint info_type =0;
- struct treq_sat_terminal_rsp_data *tr = NULL;
-
- dbg("interpreting provide local info notification");
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- provide_info = g_variant_new("(i)", info_type);
-
- //send TR - does not need from application's response
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = provide_local_info_tlv->command_detail.cmd_num;
- tr->cmd_type = provide_local_info_tlv->command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.provide_local_info.command_detail, &provide_local_info_tlv->command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.provide_local_info.device_id.src = provide_local_info_tlv->device_id.dest;
- tr->terminal_rsp_data.provide_local_info.device_id.dest = provide_local_info_tlv->device_id.src;
- tr->terminal_rsp_data.provide_local_info.other_info = TRUE;
-
- info_type = provide_local_info_tlv->command_detail.cmd_qualifier.provide_local_info.provide_local_info;
-
- switch(info_type){
- case LOCAL_INFO_DATE_TIME_AND_TIMEZONE:{
- int err = 0; int gmt = 0, n_flg = 0;
- struct timezone c_tz;
- struct timeval c_time;
-
- time_t time_val;
- struct tm time_info;
-
- time(&time_val);
-
- tzset();
- err = gettimeofday(&c_time, &c_tz);
- localtime_r(&time_val, &time_info);
-
- //set the time information
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.year =
- _convert_decimal_to_bcd(time_info.tm_year+1900-2000);
-
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.month =
- _convert_decimal_to_bcd(time_info.tm_mon+1);
-
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.day =
- _convert_decimal_to_bcd(time_info.tm_mday);
-
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.hour =
- _convert_decimal_to_bcd(time_info.tm_hour);
-
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.minute =
- _convert_decimal_to_bcd(time_info.tm_min);
-
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.second =
- _convert_decimal_to_bcd(time_info.tm_sec);
-
- gmt = c_tz.tz_minuteswest/60;
- if(gmt < 0){
- gmt = gmt * -1;
- n_flg = 1;
- }
-
- if(err != 0){
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone = 0xFF;
- }
- else{
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone =
- _convert_decimal_to_bcd(gmt);
-
- if(n_flg == 1){
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone += 0x80;
- }
-
- if(time_info.tm_isdst > 0){
- tr->terminal_rsp_data.provide_local_info.other.date_time_and_timezone.timeZone += 0x40;
- }
- }
-
- tr->terminal_rsp_data.provide_local_info.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- } break;
- case LOCAL_INFO_LANGUAGE:{
- Server *s = NULL;
- static Storage *strg;
- gchar *lang_str = NULL;
- enum tel_sim_language_type lang_type = SIM_LANG_UNSPECIFIED;
-
- tr->terminal_rsp_data.provide_local_info.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-
- s = ctx->server;
- strg = tcore_server_find_storage(s, "vconf");
- lang_str = tcore_storage_get_string(strg, STORAGE_KEY_LANGUAGE_SET);
- if(lang_str)
- lang_type = _convert_string_to_sim_lang(lang_str);
-
- tr->terminal_rsp_data.provide_local_info.other.language = lang_type;
- } break;
- default :{
- tr->terminal_rsp_data.provide_local_info.other_info = FALSE;
- tr->terminal_rsp_data.provide_local_info.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.provide_local_info.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- } break;
- }
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return provide_info;
-}
-
-GVariant* sat_manager_language_notification_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_language_notification_tlv *language_notification_tlv)
-{
- TcorePlugin *plg = NULL;
- GVariant *language_noti = NULL;
- struct sat_manager_queue_data q_data;
-
- gint command_id = 0;
- gint language =0;
- gboolean b_specified = FALSE;
-
- dbg("interpreting langauge notification");
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return NULL;
- }
-
- if (language_notification_tlv->command_detail.cmd_qualifier.language_notification.specific_language == TRUE){
- b_specified = TRUE;
- language = language_notification_tlv->language;
- } else {
- b_specified = FALSE;
- language =SIM_LANG_UNSPECIFIED;
- }
-
- //enqueue data and generate cmd_id
- memset(&q_data, 0x00, sizeof(struct sat_manager_queue_data));
- q_data.cmd_type = SAT_PROATV_CMD_LANGUAGE_NOTIFICATION;
- memcpy((void*)&(q_data.cmd_data.language_notification), language_notification_tlv, sizeof(struct tel_sat_language_notification_tlv));
- sat_manager_enqueue_cmd(ctx, &q_data);
- command_id = q_data.cmd_id;
-
- language_noti = g_variant_new("(iib)", command_id, language, b_specified);
-
- return language_noti;
-}
-
-static gboolean _sat_manager_handle_setup_menu_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] setup menu result data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(i)", &resp);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.setupMenuInd.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.setupMenuInd.command_detail.cmd_type;
-
- memcpy((void*)&tr->terminal_rsp_data.setup_menu.command_detail,
- &q_data.cmd_data.setupMenuInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.setup_menu.device_id.src = q_data.cmd_data.setupMenuInd.device_id.dest;
- tr->terminal_rsp_data.setup_menu.device_id.dest = q_data.cmd_data.setupMenuInd.device_id.src;
-
- dbg("[SAT] Response: [0x%02x]", resp);
-
- switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.setupMenuInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.setup_menu.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- default:
- //check the default case
- tr->terminal_rsp_data.setup_menu.result_type = resp;
- tr->terminal_rsp_data.setup_menu.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- dbg("[SAT] wrong result from app exec resp(%d)", resp);
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
-
- return result;
-}
-
-static gboolean _sat_manager_handle_display_text_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] display text result data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(ii)",&resp, &me_problem);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.displayTextInd.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.displayTextInd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.display_text.command_detail, &q_data.cmd_data.displayTextInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.display_text.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.display_text.device_id.dest = DEVICE_ID_SIM;
-
- switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.display_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.display_text.me_problem_type = me_problem;
- break;
-
- default:
- tr->terminal_rsp_data.display_text.result_type = resp;
- tr->terminal_rsp_data.display_text.me_problem_type = me_problem;
- dbg("[SAT] wrong result from app exec resp(%d) me_problem(%d)", resp, me_problem);
- break;
- }
-
- if (q_data.cmd_data.displayTextInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
-
- return result;
-}
-
-static gboolean _sat_manager_handle_play_tone_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] display text result data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(ii)",&resp, &me_problem);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.play_tone.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.play_tone.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.play_tone.command_detail, &q_data.cmd_data.play_tone.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.play_tone.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.play_tone.device_id.dest = DEVICE_ID_SIM;
-
- switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.play_tone.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.play_tone.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER:
- tr->terminal_rsp_data.play_tone.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- tr->terminal_rsp_data.play_tone.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- default:
- tr->terminal_rsp_data.play_tone.result_type = resp;
- tr->terminal_rsp_data.play_tone.me_problem_type = me_problem;
- dbg("[SAT] wrong result from app exec resp(%d) me_problem(%d)", resp, me_problem);
- break;
- }
-
- if (q_data.cmd_data.displayTextInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-static gboolean _sat_manager_handle_send_sms_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] send sms data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(i)",&resp);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.sendSMSInd.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.sendSMSInd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_sms.command_detail, &q_data.cmd_data.sendSMSInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.send_sms.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_sms.device_id.dest = q_data.cmd_data.sendSMSInd.device_id.src;
-
- switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.sendSMSInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.send_sms.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- break;
-
- case RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
- tr->terminal_rsp_data.send_sms.cc_problem_type = CC_PROBLEM_ACTION_NOT_ALLOWED;
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_BEYOND_ME_CAPABILITIES:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_BEYOND_ME_CAPABILITIES;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_SMS_RP_ERROR:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_SMS_RP_ERROR;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- default:
- tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_sms.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
-
-/* if( q_data.cmd_data.sendSMSInd.alpha_id.alpha_data_len && q_data.cmd_data.sendSMSInd.alpha_id.is_exist)
- sat_ui_support_terminate_sat_ui();*/
-
- return result;
-}
-
-static gboolean _sat_manager_handle_send_ss_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem, ss_cause, call_ctrl_problem, ss_str_len;
- gchar *ss_string;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
- //call ctrl action, result data object, text
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] send ss data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiisii)", &resp, &me_problem, &ss_cause, &ss_string, &ss_str_len, &call_ctrl_problem);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.send_ss.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.send_ss.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_ss.command_detail, &q_data.cmd_data.send_ss.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.send_ss.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_ss.device_id.dest = q_data.cmd_data.send_ss.device_id.src;
-
- switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.send_ss.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.send_ss.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.send_ss.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- if(ss_str_len > 0 && ss_string != NULL){
- memcpy(&tr->terminal_rsp_data.send_ss.text.dcs, &q_data.cmd_data.send_ss.alpha_id.dcs, sizeof(struct data_coding_scheme));
- memcpy((void*)tr->terminal_rsp_data.send_ss.text.string, ss_string, ss_str_len);
- tr->terminal_rsp_data.send_ss.text.string_length = ss_str_len;
- }
- break;
-
- case RESULT_SS_RETURN_ERROR:
- tr->terminal_rsp_data.send_ss.result_type = RESULT_SS_RETURN_ERROR;
- tr->terminal_rsp_data.send_ss.ss_problem = ss_cause;
- break;
-
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_ss.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_ss.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- default:
- tr->terminal_rsp_data.send_ss.result_type = RESULT_SS_RETURN_ERROR;
- tr->terminal_rsp_data.send_ss.ss_problem = SATK_SS_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
- g_free(tr);
-
- if( q_data.cmd_data.send_ss.alpha_id.alpha_data_len && q_data.cmd_data.send_ss.alpha_id.is_exist )
- sat_ui_support_terminate_sat_ui();
-
- return result;
-}
-
-static gboolean _sat_manager_handle_send_ussd_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem, ss_cause, ussd_str_len;
- GVariant *ussd_str = NULL;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
- //call ctrl action, result data object, text, result2, text2
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] send ss data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iii@vi)", &resp, &me_problem, &ss_cause, &ussd_str, &ussd_str_len);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.send_ussd.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.send_ussd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_ussd.command_detail, &q_data.cmd_data.send_ussd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.send_ussd.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_ussd.device_id.dest = q_data.cmd_data.send_ussd.device_id.src;
-
- switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.send_ussd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- if(ussd_str_len > 0 && ussd_str){
- int index = 0;
- guchar data;
- GVariantIter *iter = NULL;
- GVariant *intermediate = NULL;
-
- intermediate = g_variant_get_variant(ussd_str);
- dbg("ussd string format(%s)", g_variant_get_type_string(intermediate));
-
- g_variant_get(intermediate, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- dbg("index(%d) data(%c)", index, data);
-
- if(index == 0){
- tr->terminal_rsp_data.send_ussd.text.dcs.raw_dcs = (data & 0x0F);
- }
- else{
- tr->terminal_rsp_data.send_ussd.text.string[index-1] = data;
- }
-
- index++;
- }
- g_variant_iter_free(iter);
- g_variant_unref(intermediate);
-
- tr->terminal_rsp_data.send_ussd.text.string_length = index-1;
- }
- break;
-
- case RESULT_SS_RETURN_ERROR:
- case RESULT_USSD_RETURN_ERROR:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_USSD_RETURN_ERROR;
- tr->terminal_rsp_data.send_ussd.ussd_problem = ss_cause;
- break;
-
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_ussd.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_ussd.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- default:
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_USSD_RETURN_ERROR;
- tr->terminal_rsp_data.send_ussd.ussd_problem = SATK_USSD_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
- g_free(tr);
-
- if( q_data.cmd_data.send_ussd.alpha_id.alpha_data_len && q_data.cmd_data.send_ussd.alpha_id.is_exist )
- sat_ui_support_terminate_sat_ui();
-
- return result;
-}
-
-static gboolean _sat_manager_handle_setup_call_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem, cc_problem, call_cause;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] setup call data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiii)",&resp, &me_problem, &cc_problem, &call_cause);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.setup_call.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.setup_call.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.setup_call.command_detail, &q_data.cmd_data.setup_call.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_call.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.setup_call.device_id.dest = q_data.cmd_data.setup_call.device_id.src;
-
- switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.setup_call.call_setup_icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.setup_call.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.setup_call.me_problem_type = me_problem;
- break;
-
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:{
- tr->terminal_rsp_data.setup_call.result_type = RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND;
- switch(call_cause){
- case CALL_ERROR_BUSY:
- tr->terminal_rsp_data.setup_call.network_problem_type = NETWORK_PROBLEM_USER_BUSY;
- break;
- default :
- tr->terminal_rsp_data.setup_call.network_problem_type = NETWORK_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- }
- }break;
-
- case RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_USER_CLEAR_DOWN_CALL_BEFORE_CONN;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_BEYOND_ME_CAPABILITIES:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_BEYOND_ME_CAPABILITIES;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = cc_problem;
- break;
-
-
- default:
- break;
- }
-
- //TODO Other infomation set - not supported
- tr->terminal_rsp_data.setup_call.other_info = FALSE;
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-static gboolean _sat_manager_handle_setup_idle_mode_text_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] send ss data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(ii)",&resp, &me_problem);
-
- tr = g_new0(struct treq_sat_terminal_rsp_data, 1);
- tr->cmd_number = q_data.cmd_data.idle_mode.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.idle_mode.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.setup_idle_mode_text.command_detail, &q_data.cmd_data.idle_mode.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_idle_mode_text.device_id.src = q_data.cmd_data.idle_mode.device_id.dest;
- tr->terminal_rsp_data.setup_idle_mode_text.device_id.dest = q_data.cmd_data.idle_mode.device_id.src;
-
- switch (resp) {
- case RESULT_SUCCESS:
- tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS;
- if (q_data.cmd_data.idle_mode.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- break;
- default:
- tr->terminal_rsp_data.setup_idle_mode_text.result_type = resp;
- tr->terminal_rsp_data.setup_idle_mode_text.me_problem_type = me_problem;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
- g_free(tr);
-
- sat_ui_support_terminate_sat_ui();
-
- return result;
-}
-
-static gboolean sat_manager_handle_open_channel_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem, bip_problem;
- gint bearer_type, channel_id, channel_status, channel_status_info, buffer_size;
- gboolean other_info;
- GVariant *desc_tmp, *bearer_desc;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] open channel data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiiiiiiibv)",&resp, &me_problem, &bip_problem,
- &bearer_type, &channel_id, &channel_status, &channel_status_info, &buffer_size,
- &other_info, &desc_tmp);
-
- bearer_desc = g_variant_get_variant(desc_tmp);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.open_channel.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.open_channel.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.open_channel.command_detail, &q_data.cmd_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.open_channel.device_id.src = q_data.cmd_data.open_channel.device_id.dest;
- tr->terminal_rsp_data.open_channel.device_id.dest = q_data.cmd_data.open_channel.device_id.src;
-
- tr->terminal_rsp_data.open_channel.result_type = resp;
- switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.open_channel.me_problem_type = me_problem;
- break;
-
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.open_channel.bip_problem_type = bip_problem;
- break;
-
- default:
- break;
- }
-
- tr->terminal_rsp_data.open_channel.channel_status.channel_id = channel_id;
- tr->terminal_rsp_data.open_channel.channel_status.status = channel_status;
- tr->terminal_rsp_data.open_channel.channel_status.status_info = channel_status_info;
-
- dbg("check channel id(%d) channel status(%d) channel info(%d)", channel_id, channel_status, channel_status_info);
-
- //memcpy(tr->terminal_rsp_data.open_channel.buffer_size.size, &buffer_size, sizeof(unsigned char)*2);
- tr->terminal_rsp_data.open_channel.buffer_size.size[0] = buffer_size >> 8;
- tr->terminal_rsp_data.open_channel.buffer_size.size[1] = buffer_size & 0xFF;
- dbg("check buffer size[0](0x%x) size[1](0x%x)", tr->terminal_rsp_data.open_channel.buffer_size.size[0], tr->terminal_rsp_data.open_channel.buffer_size.size[1]);
-
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_type = bearer_type;
- switch(bearer_type){
- case BEARER_CSD:{
- gint data_rate, service_type, conn_element_type;
-
- dbg("bearer_desc cs bearer type_format(%s)", g_variant_get_type_string(bearer_desc));
- g_variant_get(bearer_desc, "(iii)",&data_rate, &service_type, &conn_element_type);
- dbg("check cs bearer data_rade(%d), service_type(%d), conn_element_type(%d)", data_rate, service_type, conn_element_type);
-
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.data_rate = data_rate;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.service_type = service_type;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.cs_bearer_param.connection_element_type = conn_element_type;
- }break;
- case BEARER_GPRS:{
- gint precedence_class, delay_class, reliability_class;
- gint peak_class, mean_class, pdp_type;
-
- dbg("bearer_desc ps bearer type_format(%s)", g_variant_get_type_string(bearer_desc));
- g_variant_get(bearer_desc, "(iiiiii)",&precedence_class, &delay_class, &reliability_class,
- &peak_class, &mean_class, &pdp_type);
- dbg("check ps bearer precedence class(%d), delay class(%d), reliability class(%d) peak class(%d) mean class(%d) pdp_type(%d)",
- precedence_class, delay_class, reliability_class, peak_class, mean_class, pdp_type);
-
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.precedence_class = precedence_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.delay_class = delay_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.reliability_class = reliability_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.peak_throughput_class = peak_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.mean_throughput_class = mean_class;
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.ps_bearer_param.pdp_type = pdp_type;
- }break;
- case BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT:{
- gint service_type;
- gchar *service_record = NULL;
-
- dbg("bearer_desc link local type_format(%s)", g_variant_get_type_string(bearer_desc));
- g_variant_get(bearer_desc, "(is)",&service_type, &service_record);
- dbg("check link local service_type(%d), service_record(%d)", service_type, service_record);
-
- tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.local_link_bearer_param.service_type = service_type;
-
- if(service_record)
- memcpy(tr->terminal_rsp_data.open_channel.bearer_desc.bearer_parameter.local_link_bearer_param.service_record, service_record, strlen(service_record));
-
- }break;
- default:
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-static gboolean sat_manager_handle_close_channel_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem, bip_problem;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] close channel data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iii)",&resp, &me_problem, &bip_problem);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.close_channel.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.close_channel.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.close_channel.command_detail, &q_data.cmd_data.close_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.close_channel.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.close_channel.device_id.dest = q_data.cmd_data.close_channel.device_id.src;
-
- tr->terminal_rsp_data.close_channel.result_type = resp;
- switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.close_channel.me_problem_type = me_problem;
- break;
-
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.close_channel.bip_problem_type = bip_problem;
- break;
-
- default:
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-static gboolean sat_manager_handle_receive_data_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem, bip_problem;
- gint data_str_len, data_len;
- gboolean other_info;
- GVariant *received_data;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] receive data data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiiiibv)",&resp, &me_problem, &bip_problem, &data_str_len, &data_len, &other_info, &received_data);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.receive_data.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.receive_data.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.receive_data.command_detail, &q_data.cmd_data.receive_data.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.receive_data.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.receive_data.device_id.dest = q_data.cmd_data.receive_data.device_id.src;
-
- tr->terminal_rsp_data.receive_data.result_type = resp;
- switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.receive_data.me_problem_type = me_problem;
- break;
-
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.receive_data.bip_problem_type = bip_problem;
- break;
-
- default:
- break;
- }
-
- tr->terminal_rsp_data.receive_data.channel_data_len.data_len = data_len;
- tr->terminal_rsp_data.receive_data.channel_data.data_string_len = data_str_len;
-
- if(received_data){
- int index = 0;
- guchar data;
- GVariantIter *iter = NULL;
-
- dbg("additional data exist type_format(%s)", g_variant_get_type_string(received_data));
-
- g_variant_get(received_data, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- dbg("index(%d) data(%d)", index, data);
- tr->terminal_rsp_data.receive_data.channel_data.data_string[index] = data;
- index++;
- }
- g_variant_iter_free(iter);
-
- dbg("the last index data(%d), data_total_len(%d)", index, data_str_len);
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-static gboolean sat_manager_handle_send_data_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem, bip_problem;
- gint data_len;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] send data data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiii)",&resp, &me_problem, &bip_problem, &data_len);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.send_data.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.send_data.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_data.command_detail, &q_data.cmd_data.send_data.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.send_data.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_data.device_id.dest = q_data.cmd_data.send_data.device_id.src;
-
- tr->terminal_rsp_data.send_data.result_type = resp;
- switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_data.me_problem_type = me_problem;
- break;
-
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.send_data.bip_problem_type = bip_problem;
- break;
-
- default:
- break;
- }
-
- tr->terminal_rsp_data.send_data.channel_data_len.data_len = data_len;
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-static gboolean sat_manager_handle_get_channel_status_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, me_problem, bip_problem;
- gint channel_id, channel_status, channel_status_info;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] get channel status data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(iiiiii)",&resp, &me_problem, &bip_problem,
- &channel_id, &channel_status, &channel_status_info);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.get_channel_status.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.get_channel_status.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.get_channel_status.command_detail, &q_data.cmd_data.get_channel_status.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.get_channel_status.device_id.src = q_data.cmd_data.get_channel_status.device_id.dest;
- tr->terminal_rsp_data.get_channel_status.device_id.dest = q_data.cmd_data.get_channel_status.device_id.src;
-
- tr->terminal_rsp_data.get_channel_status.result_type = resp;
- switch (resp) {
- case RESULT_SUCCESS:
- case RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED:
- case RESULT_SUCCESS_WITH_MISSING_INFO:
- //channel status
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- case RESULT_NETWORK_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.get_channel_status.me_problem_type = me_problem;
- break;
-
- case RESULT_BEARER_INDEPENDENT_PROTOCOL_ERROR:
- tr->terminal_rsp_data.get_channel_status.bip_problem_type = bip_problem;
- break;
-
- default:
- break;
- }
-
- tr->terminal_rsp_data.get_channel_status.channel_status.channel_id = channel_id;
- tr->terminal_rsp_data.get_channel_status.channel_status.status = channel_status;
- tr->terminal_rsp_data.get_channel_status.channel_status.status_info = channel_status_info;
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-static gboolean sat_manager_handle_send_dtmf_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- g_free(tr);
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] get channel status data is null");
- g_free(tr);
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- g_free(tr);
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(i)",&resp);
-
- tr->cmd_number = q_data.cmd_data.send_dtmf.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.send_dtmf.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_dtmf.command_detail, &q_data.cmd_data.send_dtmf.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.send_dtmf.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_dtmf.device_id.dest = q_data.cmd_data.send_dtmf.device_id.src;
-
- tr->terminal_rsp_data.send_dtmf.result_type = resp;
- switch (resp) {
- case RESULT_SUCCESS:
- if (q_data.cmd_data.send_dtmf.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- break;
-
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NOT_IN_SPEECH_CALL;
- break;
-
- default:
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-static gboolean sat_manager_handle_launch_browser_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, GVariant *exec_result)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint resp, browser_problem;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(!exec_result){
- dbg("[SAT] get channel status data is null");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "(ii)",&resp,&browser_problem);
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.launch_browser.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.launch_browser.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.launch_browser.command_detail, &q_data.cmd_data.launch_browser.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.launch_browser.device_id.src = q_data.cmd_data.launch_browser.device_id.dest;
- tr->terminal_rsp_data.launch_browser.device_id.dest = q_data.cmd_data.launch_browser.device_id.src;
-
- tr->terminal_rsp_data.launch_browser.result_type = resp;
- switch (resp) {
- case RESULT_SUCCESS:
- if (q_data.cmd_data.launch_browser.user_confirm_icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.launch_browser.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- case RESULT_ME_UNABLE_TO_PROCESS_COMMAND:
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- case RESULT_LAUNCH_BROWSER_GENERIC_ERROR_CODE:
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = browser_problem;
- break;
- default:
- tr->terminal_rsp_data.launch_browser.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
-
-gboolean sat_manager_handle_app_exec_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint command_type, GVariant *exec_result)
-{
- gboolean result = FALSE;
- GVariant *resp = NULL;
- dbg("[SAT] app exec result command id(%d) command type(%d)", command_id, command_type);
-
- dbg("exec_result type_format(%s)", g_variant_get_type_string(exec_result));
- g_variant_get(exec_result, "v", &resp);
-
- switch (command_type) {
- case SAT_PROATV_CMD_SETUP_MENU:
- result = _sat_manager_handle_setup_menu_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_DISPLAY_TEXT:
- result = _sat_manager_handle_display_text_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_PLAY_TONE:
- result = _sat_manager_handle_play_tone_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_SEND_SMS:
- result = _sat_manager_handle_send_sms_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_SEND_SS:
- result = _sat_manager_handle_send_ss_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_SEND_USSD:
- result = _sat_manager_handle_send_ussd_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_SETUP_CALL:
- result = _sat_manager_handle_setup_call_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
- result = _sat_manager_handle_setup_idle_mode_text_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_OPEN_CHANNEL:
- result = sat_manager_handle_open_channel_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_CLOSE_CHANNEL:
- result = sat_manager_handle_close_channel_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_RECEIVE_DATA:
- result = sat_manager_handle_receive_data_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_SEND_DATA:
- result = sat_manager_handle_send_data_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_GET_CHANNEL_STATUS:
- result = sat_manager_handle_get_channel_status_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_SEND_DTMF:
- result = sat_manager_handle_send_dtmf_result(ctx, plg, command_id, resp);
- break;
-
- case SAT_PROATV_CMD_LAUNCH_BROWSER:
- result = sat_manager_handle_launch_browser_result(ctx, plg, command_id, resp);
- break;
-
- default:
- dbg("[SAT] invalid command type(%d)", command_type);
- break;
- }
-
- sat_ui_support_terminate_sat_ui();
-
- return result;
-}
-
-static gboolean _sat_manager_handle_menu_select_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint item_id=0;
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- if(addtional_data){
- int index = 0;
- guchar data;
- GVariantIter *iter = NULL;
- GVariant *inner_gv = NULL;
-
- inner_gv = g_variant_get_variant(addtional_data);
- dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
-
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- dbg("index(%d) data(%d)", index, data);
- item_id = data;
- index++;
- }
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
- }
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.selectItemInd.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.selectItemInd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.select_item.command_detail, &q_data.cmd_data.selectItemInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.select_item.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.select_item.device_id.dest = DEVICE_ID_SIM;
-
- switch (confirm_type) {
- case USER_CONFIRM_YES:
- tr->terminal_rsp_data.select_item.item_identifier.item_identifier = item_id;
- tr->terminal_rsp_data.select_item.other_info = FALSE;
- tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-
- if (q_data.cmd_data.selectItemInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.select_item.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- break;
-
- case USER_CONFIRM_HELP_INFO:
- tr->terminal_rsp_data.select_item.item_identifier.item_identifier = item_id;
- tr->terminal_rsp_data.select_item.other_info = FALSE;
- tr->terminal_rsp_data.select_item.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
- tr->terminal_rsp_data.select_item.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- //TODO ctx->help_requested = TRUE;
- break;
-
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.select_item.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- break;
-
- case USER_CONFIRM_NO_OR_CANCEL:
- tr->terminal_rsp_data.select_item.result_type = RESULT_BACKWARD_MOVE_BY_USER;
- break;
-
- case USER_CONFIRM_TIMEOUT:
- tr->terminal_rsp_data.select_item.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
-
- default:
- dbg("not handled value[%d] here", confirm_type);
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
-
- return result;
-}
-
-static gboolean _sat_manager_handle_display_text_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.displayTextInd.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.displayTextInd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.display_text.command_detail, &q_data.cmd_data.displayTextInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.display_text.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.display_text.device_id.dest = DEVICE_ID_SIM;
-
- switch (confirm_type){
- case USER_CONFIRM_YES: {
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.display_text.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
-
- if (q_data.cmd_data.displayTextInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
- } break;
-
- case USER_CONFIRM_NO_OR_CANCEL:
- tr->terminal_rsp_data.display_text.result_type = RESULT_BACKWARD_MOVE_BY_USER;
- break;
-
- case USER_CONFIRM_TIMEOUT:
- tr->terminal_rsp_data.display_text.result_type = RESULT_SUCCESS;
-
- if (q_data.cmd_data.displayTextInd.command_detail.cmd_qualifier.display_text.text_clear_type == TEXT_WAIT_FOR_USER_TO_CLEAR_MSG )
- tr->terminal_rsp_data.display_text.result_type = RESULT_NO_RESPONSE_FROM_USER;
-
- break;
-
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.display_text.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- break;
-
- case USER_CONFIRM_HELP_INFO:
- default:
- dbg("not handled value[%d] here", confirm_type);
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
-
- return result;
-}
-
-static gboolean _sat_manager_handle_get_inkey_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint inkey_data_len = 0;
- gchar inkey_data[SAT_TEXT_STRING_LEN_MAX];
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
- memset(inkey_data, 0, SAT_TEXT_STRING_LEN_MAX);
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- if(addtional_data){
- int index = 0;
- guchar data;
- GVariantIter *iter = NULL;
- GVariant *inner_gv = NULL;
-
- inner_gv = g_variant_get_variant(addtional_data);
- dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
-
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- dbg("index(%d) data(%d)", index, data);
- inkey_data[index] = data;
- index++;
- }
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
- inkey_data_len = index;
- }
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.getInkeyInd.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.getInkeyInd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.get_inkey.command_detail, &q_data.cmd_data.getInkeyInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.get_inkey.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.get_inkey.device_id.dest = DEVICE_ID_SIM;
-
- switch (confirm_type){
- case USER_CONFIRM_YES:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
-
- if (q_data.cmd_data.getInkeyInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
- tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tr->terminal_rsp_data.get_inkey.text.string_length = 1;
- tr->terminal_rsp_data.get_inkey.text.string[0] = 0x01;
- }
- else if(inkey_data_len > 0)
- {
- tr->terminal_rsp_data.get_inkey.text.string_length = inkey_data_len;
-
- if (!q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_set){
- tr->terminal_rsp_data.get_inkey.text.is_digit_only = TRUE;
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
-
- memcpy((void*)tr->terminal_rsp_data.get_inkey.text.string, inkey_data, inkey_data_len);
- }
- else
- {
- tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
-
- if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT )
- {
- int tmp_len;
- char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
-
- dbg("sat gsm7 encoding");
- tcore_util_convert_utf8_to_gsm((unsigned char*) tmp_str, &tmp_len, (unsigned char*)inkey_data, inkey_data_len);
- packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
-
- if(packed_data){
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tr->terminal_rsp_data.get_inkey.text.string_length = strlen(packed_data);
- memcpy((void*) tr->terminal_rsp_data.get_inkey.text.string, packed_data, strlen(packed_data));
-
- g_free(packed_data);
- }
- }
- else if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.alphabet_type == INPUT_ALPHABET_TYPE_UCS2 )
- {
- dbg("UCS2 DATA");
-
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_UCS2;
- tcore_util_convert_utf8_to_ucs2((unsigned char*)tr->terminal_rsp_data.get_inkey.text.string,
- &tr->terminal_rsp_data.get_inkey.text.string_length, (unsigned char*)inkey_data, inkey_data_len);
- }
- else
- {
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_RESERVED;
- dbg("[SAT] invalid DCS[%d]",tr->terminal_rsp_data.get_inkey.text.dcs.a_format);
- }
- }
- }
- break;
-
- case USER_CONFIRM_HELP_INFO:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
- //TODO ctx->help_requested = TRUE;
- break;
-
- case USER_CONFIRM_NO_OR_CANCEL:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_BACKWARD_MOVE_BY_USER;
-
- if (q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_inkey.inkey_type == INKEY_TYPE_YES_NO_REQUESTED) {
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.get_inkey.text.dcs.m_class = MSG_CLASS_RESERVED;
- tr->terminal_rsp_data.get_inkey.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tr->terminal_rsp_data.get_inkey.text.string_length = 1;
- tr->terminal_rsp_data.get_inkey.text.string[0] = 0x00;
- }
- break;
-
- case USER_CONFIRM_TIMEOUT:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
-
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.get_inkey.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- break;
-
- default:
- dbg("not handled value[%d] here", confirm_type);
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
-
- return result;
-}
-
-static gboolean _sat_manager_handle_get_input_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint input_data_len = 0;
- gchar input_data[SAT_TEXT_STRING_LEN_MAX];
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
- memset(input_data, 0, SAT_TEXT_STRING_LEN_MAX);
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- if(addtional_data){
- int index = 0;
- guchar data;
- GVariantIter *iter = NULL;
- GVariant *inner_gv = NULL;
-
- inner_gv = g_variant_get_variant(addtional_data);
- dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
-
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- dbg("index(%d) data(%d)", index, data);
- input_data[index] = data;
- index++;
- }
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
- input_data_len = index;
- }
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.getInputInd.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.getInputInd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.get_input.command_detail, &q_data.cmd_data.getInputInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.get_input.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.get_input.device_id.dest = DEVICE_ID_SIM;
-
- switch (confirm_type){
- case USER_CONFIRM_YES:
- tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS;
- tr->terminal_rsp_data.get_input.text.dcs.m_class = MSG_CLASS_RESERVED;
-
- if(!q_data.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.alphabet_set){
- tr->terminal_rsp_data.get_input.text.is_digit_only = TRUE;
- }
-
- if (q_data.cmd_data.getInputInd.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.get_input.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- if(!q_data.cmd_data.getInputInd.command_detail.cmd_qualifier.get_input.user_input_unpacked_format){
- dbg("[SAT] packing to SMS7 default");
-
- tr->terminal_rsp_data.get_input.text.string_length = 0;
- tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_SMS_DEFAULT;
-
- if (input_data_len > 0){
- int tmp_len;
- char tmp_str[SAT_TEXT_STRING_LEN_MAX + 1], *packed_data;
-
- dbg("sat gsm7 encoding");
- tcore_util_convert_utf8_to_gsm((unsigned char*)tmp_str, &tmp_len, (unsigned char*)input_data, input_data_len);
- packed_data = (char*) tcore_util_pack_gsm7bit((const unsigned char *)tmp_str, tmp_len);
-
- if(packed_data){
- memcpy((void*)tr->terminal_rsp_data.get_input.text.string, packed_data, strlen(packed_data));
- tr->terminal_rsp_data.get_input.text.string_length = strlen(packed_data);
-
- g_free(packed_data);
- }
- }
-
- }
- else
- {
- dbg("[SAT] packing not required");
-
- if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_SMS_DEFAULT){
-
- tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_8BIT_DATA;
- tcore_util_convert_utf8_to_gsm((unsigned char*)tr->terminal_rsp_data.get_input.text.string,
- &tr->terminal_rsp_data.get_input.text.string_length, (unsigned char*)input_data, input_data_len);
-
- }
- else if(q_data.cmd_data.getInkeyInd.command_detail.cmd_qualifier.get_input.alphabet_type == INPUT_ALPHABET_TYPE_UCS2 ){
-
- tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_UCS2;
- tcore_util_convert_utf8_to_ucs2((unsigned char*)tr->terminal_rsp_data.get_input.text.string,
- &tr->terminal_rsp_data.get_input.text.string_length, (unsigned char*)input_data, input_data_len);
-
- }
- else{
- tr->terminal_rsp_data.get_input.text.dcs.a_format = ALPHABET_FORMAT_RESERVED;
- dbg("[SAT] invalid DCS[%d]",tr->terminal_rsp_data.get_input.text.dcs.a_format);
- }
- } break;
-
- case USER_CONFIRM_HELP_INFO:
- tr->terminal_rsp_data.get_input.result_type = RESULT_HELP_INFO_REQUIRED_BY_USER;
- //TODO ctx->help_requested = TRUE;
- break;
-
- case USER_CONFIRM_NO_OR_CANCEL:
- tr->terminal_rsp_data.get_input.result_type = RESULT_BACKWARD_MOVE_BY_USER;
- break;
-
- case USER_CONFIRM_TIMEOUT:
- tr->terminal_rsp_data.get_input.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
-
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.get_input.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- break;
- default:
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
-
- return result;
-}
-
-static gboolean _sat_manager_handle_setup_call_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- gint input_data_len = 0;
- gchar input_data[SAT_TEXT_STRING_LEN_MAX];
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
- memset(input_data, 0, SAT_TEXT_STRING_LEN_MAX);
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- if(addtional_data){
- int index = 0;
- guchar data;
- GVariantIter *iter = NULL;
- GVariant *inner_gv = NULL;
-
- inner_gv = g_variant_get_variant(addtional_data);
- dbg("additional data exist type_format(%s)", g_variant_get_type_string(inner_gv));
-
- g_variant_get(inner_gv, "ay", &iter);
- while( g_variant_iter_loop (iter, "y", &data)){
- dbg("index(%d) data(%d)", index, data);
- input_data[index] = data;
- index++;
- }
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
- input_data_len = index;
- }
-
- tr = g_new0(struct treq_sat_terminal_rsp_data, 1);
- tr->cmd_number = q_data.cmd_data.setup_call.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.setup_call.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.setup_call.command_detail, &q_data.cmd_data.setup_call.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_call.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.setup_call.device_id.dest = q_data.cmd_data.setup_call.device_id.src;
-
- switch(confirm_type){
- case USER_CONFIRM_YES:{
- char *path;
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
- GVariant *setup_call = NULL;
-
- gint command_id, call_type, confirmed_text_len, text_len, duration;
- gchar *confirmed_text, *text, *call_number;
- GVariant *icon_id;
-
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- }
- else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
-
- setup_call = sat_manager_setup_call_noti(ctx, plg_name, &q_data.cmd_data.setup_call);
-
- dbg("setup call type_format(%s)", g_variant_get_type_string(setup_call));
- g_variant_get(setup_call, "(isisi@visi)", &command_id, &confirmed_text, &confirmed_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
-
- telephony_sat_emit_setup_call(sat, command_id, confirmed_text, confirmed_text_len, text, text_len, call_type,
- call_number, duration);
-
- sat_ui_support_launch_call_application(q_data.cmd_data.setup_call.command_detail.cmd_type, setup_call);
- g_free(tr);
- return TRUE;
- }break;
-
- case USER_CONFIRM_NO_OR_CANCEL:{
- tr->terminal_rsp_data.setup_call.result_type = RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
- tr->terminal_rsp_data.setup_call.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.setup_call.cc_problem_type = CC_PROBLEM_NO_SPECIFIC_CAUSE;
- }break;
-
- case USER_CONFIRM_END:{
- tr->terminal_rsp_data.setup_call.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- }break;
-
- case USER_CONFIRM_HELP_INFO:
- default:
- tr->terminal_rsp_data.setup_call.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
- g_free(tr);
- return result;
-}
-
-static gboolean _sat_manager_handle_send_dtmf_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- tr = g_new0(struct treq_sat_terminal_rsp_data, 1);
- tr->cmd_number = q_data.cmd_data.send_dtmf.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.send_dtmf.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_dtmf.command_detail, &q_data.cmd_data.send_dtmf.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.send_dtmf.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_dtmf.device_id.dest = q_data.cmd_data.send_dtmf.device_id.src;
-
- dbg("confirm_type[%d]", confirm_type);
-
- switch(confirm_type){
- case USER_CONFIRM_NO_OR_CANCEL:
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_PROACTIVE_SESSION_TERMINATED_BY_USER;
- tr->terminal_rsp_data.send_dtmf.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
- default:
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
- g_free(tr);
-
- return result;
-}
-
-static gboolean _sat_manager_handle_launch_browser_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.launch_browser.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.launch_browser.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.launch_browser.command_detail, &q_data.cmd_data.launch_browser.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.launch_browser.device_id.src = q_data.cmd_data.launch_browser.device_id.dest;
- tr->terminal_rsp_data.launch_browser.device_id.dest = q_data.cmd_data.launch_browser.device_id.src;
-
- dbg("confirm_type[%d]", confirm_type);
-
- switch(confirm_type){
- case USER_CONFIRM_YES:{
- char *path;
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
- GVariant *launch_browser = NULL;
-
- gint command_id = 0;
- gint browser_launch_type = 0, browser_id = 0;
- gint url_len = 0, text_len = 0, gateway_proxy_len =0;
- gchar *url = NULL;
- gchar *text = NULL;
- gchar *gateway_proxy = NULL;
- GVariant *icon_id = NULL;
-
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- } else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
-
- launch_browser = sat_manager_launch_browser_noti(ctx, plg_name, &q_data.cmd_data.launch_browser);
-
- dbg("launch_browser type_format(%s)", g_variant_get_type_string(launch_browser));
- g_variant_get(launch_browser, "(iiisisisi@v)", &command_id, &browser_launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
-
- telephony_sat_emit_launch_browser(sat, command_id, browser_launch_type, browser_id, url, url_len, gateway_proxy, gateway_proxy_len, text, text_len);
-
- sat_ui_support_launch_browser_application(q_data.cmd_data.launch_browser.command_detail.cmd_type, launch_browser);
-
- g_free(path);
- g_free(tr);
-
- return TRUE;
- }break;
-
- case USER_CONFIRM_NO_OR_CANCEL:
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.launch_browser.result_type = RESULT_BACKWARD_MOVE_BY_USER;
- tr->terminal_rsp_data.launch_browser.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- tr->terminal_rsp_data.launch_browser.browser_problem_type = BROWSER_PROBLEM_NO_SPECIFIC_CAUSE;
- break;
-
- default:
- tr->terminal_rsp_data.launch_browser.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
- g_free(tr);
-
- return result;
-}
-
-static gboolean _sat_manager_handle_open_channel_confirm(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint confirm_type, GVariant *addtional_data)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
- tr->cmd_number = q_data.cmd_data.open_channel.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.open_channel.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.open_channel.command_detail, &q_data.cmd_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.open_channel.device_id.src = q_data.cmd_data.send_dtmf.device_id.dest;
- tr->terminal_rsp_data.open_channel.device_id.dest = q_data.cmd_data.send_dtmf.device_id.src;
-
- dbg("confirm_type[%d]", confirm_type);
-
- switch(confirm_type){
- case USER_CONFIRM_YES:{
- char *path;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
-
- GVariant *open_channel = NULL;
-
- gint command_id, bearer_type, protocol_type, dest_addr_type;
- gboolean immediate_link, auto_reconnection, bg_mode;
- gint text_len, buffer_size, port_number;
- gchar *text, *dest_address;
- GVariant *icon_id;
- GVariant *bearer_param;
- GVariant *bearer_detail;
-
- //emit send_dtmf signal
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- } else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
-
- open_channel = sat_manager_open_channel_noti(ctx, plg_name, &q_data.cmd_data.open_channel);
-
- dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
- g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
-
- /*telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);*/
-
- //BIP Manager
- {
- gboolean b_sig = FALSE;
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- b_sig = sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
- }
-
- g_free(path);
- g_free(tr);
-
- return TRUE;
- }break;
-
- case USER_CONFIRM_NO_OR_CANCEL:
- case USER_CONFIRM_END:
- tr->terminal_rsp_data.open_channel.result_type = RESULT_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ;
- break;
- default:
- tr->terminal_rsp_data.open_channel.result_type = RESULT_NO_RESPONSE_FROM_USER;
- break;
- }
-
- memcpy((void*)&tr->terminal_rsp_data.open_channel.bearer_desc, &q_data.cmd_data.open_channel.bearer_desc, sizeof(struct tel_sat_bearer_description));
- memcpy((void*)&tr->terminal_rsp_data.open_channel.buffer_size, &q_data.cmd_data.open_channel.buffer_size, sizeof(struct tel_sat_buffer_size));
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
- g_free(tr);
-
- return result;
-}
-
-gboolean sat_manager_handle_user_confirm(struct custom_data *ctx, TcorePlugin *plg, GVariant *user_confirm_data)
-{
- gboolean rv = FALSE;
- gboolean result = FALSE;
- struct sat_manager_queue_data q_data;
-
- gint command_id, command_type, confirm_type;
- GVariant *additional_data = NULL;
-
- dbg("user_confirm_data type_format(%s)", g_variant_get_type_string(user_confirm_data));
- g_variant_get(user_confirm_data, "(iiv)", &command_id, &confirm_type, &additional_data);
-
- dbg("[SAT] user confirm data command id(%d), confirm_type(%d)", command_id, confirm_type);
-
- rv = sat_manager_queue_peek_data_by_id(ctx, &q_data, command_id);
- if(!rv){
- dbg("[SAT] no commands in queue");
- return result;
- }
-
- command_type = (gint)q_data.cmd_type;
- dbg("[SAT] command type(%d)", command_type);
-
- switch(command_type){
- case SAT_PROATV_CMD_SELECT_ITEM:
- result = _sat_manager_handle_menu_select_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_DISPLAY_TEXT:
- result = _sat_manager_handle_display_text_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_GET_INKEY:
- result = _sat_manager_handle_get_inkey_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_GET_INPUT:
- result = _sat_manager_handle_get_input_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_SETUP_CALL:
- result = _sat_manager_handle_setup_call_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_SEND_DTMF:
- result = _sat_manager_handle_send_dtmf_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_LAUNCH_BROWSER:
- result = _sat_manager_handle_launch_browser_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- case SAT_PROATV_CMD_OPEN_CHANNEL:
- result = _sat_manager_handle_open_channel_confirm(ctx, plg, command_id, confirm_type, additional_data);
- break;
- default:
- dbg("[SAT] cannot handle user confirm command(0x%x)", command_type);
- break;
- }
-
- return result;
-}
-
-static gboolean _sat_manager_handle_play_tone_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
-{
- char *path;
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
- GVariant *play_tone = NULL;
-
-
- gint command_id, tone_type, duration;
- gint text_len;
- gchar* text;
- GVariant *icon_id;
-
- if(!display_status){
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] fail to show ui display for play tone");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-
- tr->cmd_number = q_data->cmd_data.play_tone.command_detail.cmd_num;
- tr->cmd_type = q_data->cmd_data.play_tone.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.play_tone.command_detail, &q_data->cmd_data.play_tone.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.play_tone.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.play_tone.device_id.dest = q_data->cmd_data.play_tone.device_id.src;
- tr->terminal_rsp_data.play_tone.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return TRUE;
- }
-
- //emit play tone signal
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- }
- else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
-
- play_tone = sat_manager_play_tone_noti(ctx, plg_name, &q_data->cmd_data.play_tone);
-
- dbg("play tone type_format(%s)", g_variant_get_type_string(play_tone));
- g_variant_get(play_tone, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
-
- telephony_sat_emit_play_tone(sat, command_id, text, text_len, tone_type, duration);
- g_free(path);
-
- return TRUE;
-}
-
-static gboolean _sat_manager_handle_send_sms_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
-{
- char *path;
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
- GVariant *send_sms = NULL;
-
-
- gint command_id, ton, npi, tpdu_type;
- gboolean b_packing_required;
- gint text_len, number_len, tpdu_data_len;
- gchar* text, *dialling_number;
- GVariant *tpdu_data, *icon_id;
-
- if(!display_status){
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] fail to show ui display for send sms");
-
- tr = g_new0(struct treq_sat_terminal_rsp_data, 1);
-
- tr->cmd_number = q_data->cmd_data.sendSMSInd.command_detail.cmd_num;
- tr->cmd_type = q_data->cmd_data.sendSMSInd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_sms.command_detail, &q_data->cmd_data.sendSMSInd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.send_sms.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_sms.device_id.dest = q_data->cmd_data.sendSMSInd.device_id.src;
- tr->terminal_rsp_data.send_sms.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
- return TRUE;
- }
-
- //emit send sms signal
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- }
- else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
-
- send_sms = sat_manager_send_sms_noti(ctx, plg_name, &q_data->cmd_data.sendSMSInd);
-
- dbg("send sms type_format(%s)", g_variant_get_type_string(send_sms));
- g_variant_get(send_sms, "(isi@vbiisii@vi)", &command_id, &text, &text_len, &icon_id, &b_packing_required, &ton, &npi,
- &dialling_number, &number_len, &tpdu_type, &tpdu_data, &tpdu_data_len);
-
- telephony_sat_emit_send_sms(sat, command_id, text, text_len, b_packing_required,
- ton, npi, dialling_number, number_len, tpdu_type, tpdu_data, tpdu_data_len);
-
- return TRUE;
-}
-
-static gboolean _sat_manager_handle_send_ss_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
-{
- char *path;
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
- GVariant *send_ss = NULL;
-
-
- gint command_id, ton, npi;
- gint text_len, ss_str_len;
- gchar* text, *ss_string;
- GVariant *icon_id;
-
- if(!display_status){
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] fail to show ui display for send ss");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-
- tr->cmd_number = q_data->cmd_data.send_ss.command_detail.cmd_num;
- tr->cmd_type = q_data->cmd_data.send_ss.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_ss.command_detail, &q_data->cmd_data.send_ss.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.send_ss.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_ss.device_id.dest = q_data->cmd_data.send_ss.device_id.src;
- tr->terminal_rsp_data.send_ss.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return TRUE;
- }
-
- //emit send ss signal
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- }
- else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
-
- send_ss = sat_manager_send_ss_noti(ctx, plg_name, &q_data->cmd_data.send_ss);
-
- dbg("send ss type_format(%s)", g_variant_get_type_string(send_ss));
- g_variant_get(send_ss, "(isi@viiis)", &command_id, &text, &text_len, &icon_id,
- &ton, &npi, &ss_str_len, &ss_string);
-
- telephony_sat_emit_send_ss(sat, command_id, text, text_len, ton, npi, ss_string);
- sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_SS, send_ss);
-
- return TRUE;
-}
-
-static gboolean _sat_manager_handle_send_ussd_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
-{
- char *path;
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
- GVariant *send_ussd = NULL;
-
- gint command_id;
- gint text_len, ussd_str_len;
- gchar* text, *ussd_string;
- GVariant *icon_id;
-
- if(!display_status){
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] fail to show ui display for send ussd");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-
- tr->cmd_number = q_data->cmd_data.send_ussd.command_detail.cmd_num;
- tr->cmd_type = q_data->cmd_data.send_ussd.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_ussd.command_detail, &q_data->cmd_data.send_ussd.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.send_ussd.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_ussd.device_id.dest = q_data->cmd_data.send_ussd.device_id.src;
- tr->terminal_rsp_data.send_ussd.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return TRUE;
- }
-
- /* emit send ussd signal */
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- }
- else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
-
- send_ussd = sat_manager_send_ussd_noti(ctx, plg_name, &q_data->cmd_data.send_ussd);
-
- dbg("send ussd type_format(%s)", g_variant_get_type_string(send_ussd));
- g_variant_get(send_ussd, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &ussd_str_len, &ussd_string);
-
- telephony_sat_emit_setup_ussd(sat, command_id, text, text_len, ussd_string);
- sat_ui_support_launch_ciss_application(SAT_PROATV_CMD_SEND_USSD, send_ussd);
-
- return TRUE;
-}
-
-static gboolean _sat_manager_handle_setup_idle_mode_text_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
-{
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
-
- struct treq_sat_terminal_rsp_data *tr;
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- tr = g_new0(struct treq_sat_terminal_rsp_data, 1);
- tr->cmd_number = q_data->cmd_data.idle_mode.command_detail.cmd_num;
- tr->cmd_type = q_data->cmd_data.idle_mode.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.setup_idle_mode_text.command_detail, &q_data->cmd_data.idle_mode.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.setup_idle_mode_text.device_id.src = q_data->cmd_data.idle_mode.device_id.dest;
- tr->terminal_rsp_data.setup_idle_mode_text.device_id.dest = q_data->cmd_data.idle_mode.device_id.src;
-
- tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS;
- if (q_data->cmd_data.idle_mode.icon_id.icon_info.ics == IMAGE_CODING_SCHEME_COLOUR)
- tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED;
-
- //fail to display text
- if(!display_status){
- dbg("[SAT] fail to show ui display for setup_idle_mode_text");
- tr->terminal_rsp_data.setup_idle_mode_text.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
- g_free(tr);
-
- sat_ui_support_terminate_sat_ui();
-
- return result;
-}
-
-static gboolean _sat_manager_handle_refresh_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
-{
- struct treq_sat_terminal_rsp_data tr;
-
- memset(&tr, 0, sizeof(struct treq_sat_terminal_rsp_data));
-
- tr.cmd_number = q_data->cmd_data.refresh.command_detail.cmd_num;
- tr.cmd_type = q_data->cmd_data.refresh.command_detail.cmd_type;
- memcpy((void*)&tr.terminal_rsp_data.refresh.command_detail, &q_data->cmd_data.refresh.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr.terminal_rsp_data.refresh.device_id.src = q_data->cmd_data.refresh.device_id.dest;
- tr.terminal_rsp_data.refresh.device_id.dest = q_data->cmd_data.refresh.device_id.src;
-
- if(!display_status){
- dbg("fail to show ui for refresh");
- tr.terminal_rsp_data.refresh.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- }
- else{
- dbg("success to show ui for refresh");
- tr.terminal_rsp_data.more_time.result_type = RESULT_SUCCESS;
- tr.terminal_rsp_data.more_time.me_problem_type = ME_PROBLEM_NO_SPECIFIC_CAUSE;
- }
-
- dbg("send refresh tr");
- sat_manager_send_terminal_response(ctx->comm, plg, &tr);
- return TRUE;
-}
-
-static gboolean _sat_manager_handle_send_dtmf_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
-{
- char *path;
- TelephonySAT *sat;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
-
- GVariant *send_dtmf = NULL;
- gint command_id = 0;
- gint text_len = 0, dtmf_str_len = 0;
- gchar *text = NULL;
- gchar *dtmf_str = NULL;
- GVariant *icon_id = NULL;
-
- if(!display_status){
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] fail to show ui display for send_dtmf");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-
- tr->cmd_number = q_data->cmd_data.send_dtmf.command_detail.cmd_num;
- tr->cmd_type = q_data->cmd_data.send_dtmf.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.send_dtmf.command_detail, &q_data->cmd_data.send_dtmf.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.send_dtmf.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.send_dtmf.device_id.dest = q_data->cmd_data.send_dtmf.device_id.src;
- tr->terminal_rsp_data.send_dtmf.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return TRUE;
- }
-
- //emit send_dtmf signal
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- } else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
- sat = telephony_object_peek_sat(TELEPHONY_OBJECT(object));
-
- send_dtmf = sat_manager_send_dtmf_noti(ctx, plg_name, &q_data->cmd_data.send_dtmf);
-
- dbg("send_dtmf type_format(%s)", g_variant_get_type_string(send_dtmf));
- g_variant_get(send_dtmf, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &dtmf_str_len, &dtmf_str);
-
- telephony_sat_emit_send_dtmf(sat, command_id, text, text_len, dtmf_str, dtmf_str_len);
-
- return TRUE;
-}
-
-static gboolean _sat_manager_handle_open_channel_ui_display_status(struct custom_data *ctx, TcorePlugin *plg,struct sat_manager_queue_data *q_data, gboolean display_status)
-{
- char *path;
- TelephonyObjectSkeleton *object;
-
- gchar *plg_name = NULL;
-
- GVariant *open_channel = NULL;
-
- gint command_id, bearer_type, protocol_type, dest_addr_type;
- gboolean immediate_link, auto_reconnection, bg_mode;
- gint text_len, buffer_size, port_number;
- gchar *text, *dest_address;
- GVariant *icon_id;
- GVariant *bearer_param;
- GVariant *bearer_detail;
-
- if(!display_status){
- struct treq_sat_terminal_rsp_data *tr = NULL;
- dbg("[SAT] fail to show ui display for open channel");
-
- tr = (struct treq_sat_terminal_rsp_data *)calloc(1, sizeof(struct treq_sat_terminal_rsp_data));
-
- tr->cmd_number = q_data->cmd_data.open_channel.command_detail.cmd_num;
- tr->cmd_type = q_data->cmd_data.open_channel.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.open_channel.command_detail, &q_data->cmd_data.open_channel.command_detail, sizeof(struct tel_sat_cmd_detail_info));
-
- tr->terminal_rsp_data.open_channel.device_id.src = q_data->cmd_data.send_dtmf.device_id.dest;
- tr->terminal_rsp_data.open_channel.device_id.dest = q_data->cmd_data.send_dtmf.device_id.src;
- tr->terminal_rsp_data.open_channel.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
-
- sat_manager_send_terminal_response(ctx->comm, plg, tr);
- g_free(tr);
-
- return TRUE;
- }
-
- //emit send_dtmf signal
- plg_name = (gchar *)tcore_server_get_cp_name_by_plugin(plg);
- if (plg_name) {
- path = g_strdup_printf("%s/%s", TELEPHONY_OBJECT_PATH, plg_name);
- } else {
- path = g_strdup_printf("%s", TELEPHONY_OBJECT_PATH);
- }
- dbg("path = [%s]", path);
-
- object = g_hash_table_lookup(ctx->objects, path);
-
- open_channel = sat_manager_open_channel_noti(ctx, plg_name, &q_data->cmd_data.open_channel);
-
- dbg("open channel type_format(%s)", g_variant_get_type_string(open_channel));
- g_variant_get(open_channel,"(isi@vbbbi@viiiis@v)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
-
- /*telephony_sat_emit_open_channel(sat, command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);*/
-
- //BIP Manager
- {
- gboolean b_sig = FALSE;
- GDBusConnection *conn = NULL;
- const gchar *g_path = NULL;
-
- conn = g_dbus_object_manager_server_get_connection(ctx->manager);
- g_path = g_dbus_object_get_object_path(G_DBUS_OBJECT(object));
-
- b_sig = sat_ui_support_exec_bip(conn, g_path, SAT_PROATV_CMD_OPEN_CHANNEL, open_channel);
- }
-
- return TRUE;
-}
-
-gboolean sat_manager_handle_ui_display_status(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gboolean display_status)
-{
- gboolean result = FALSE;
- struct sat_manager_queue_data q_data;
-
- dbg("[SAT] ui display status : command id(%d) display status(%d)", command_id, display_status);
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command peek data from queue is failed. didn't find in command Q!!");
- return result;
- }
-
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- switch(q_data.cmd_type){
- case SAT_PROATV_CMD_PLAY_TONE:
- result = _sat_manager_handle_play_tone_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_SMS:
- result = _sat_manager_handle_send_sms_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_SS:
- result = _sat_manager_handle_send_ss_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_USSD:
- result = _sat_manager_handle_send_ussd_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
- result = _sat_manager_handle_setup_idle_mode_text_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_REFRESH:
- result = _sat_manager_handle_refresh_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_SEND_DTMF:
- result = _sat_manager_handle_send_dtmf_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- case SAT_PROATV_CMD_OPEN_CHANNEL:
- result = _sat_manager_handle_open_channel_ui_display_status(ctx, plg, &q_data, display_status);
- break;
- default:
- dbg("[SAT] cannot handle ui display status command(0x%x)", q_data.cmd_type);
- break;
- }
-
- return result;
-}
-
-gboolean sat_manager_handle_event_download_envelop(int event_type, int src_dev, int dest_dev, struct tel_sat_envelop_event_download_tlv *evt_download, GVariant *download_data)
-{
- GVariant *data = NULL;
-
- dbg("download data type_format(%s)", g_variant_get_type_string(download_data));
- g_variant_get(download_data, "v", &data);
-
- switch(event_type)
- {
- case EVENT_USER_ACTIVITY:
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- break;
- case EVENT_IDLE_SCREEN_AVAILABLE:
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(b)", &evt_download->idle_screen);
- evt_download->device_identitie.src = DEVICE_ID_DISPLAY;
- evt_download->device_identitie.dest = dest_dev;
- dbg("idle screen available (%d)", evt_download->idle_screen);
- break;
- case EVENT_LANGUAGE_SELECTION:
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(i)", &evt_download->language);
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- dbg("selected language (%d)", evt_download->language);
- break;
- case EVENT_BROWSER_TERMINATION:{
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(i)", &evt_download->browser_termination);
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- dbg("browser termination cause(%d)", evt_download->browser_termination);
- } break;
- case EVENT_DATA_AVAILABLE:{
- gint channel_id, channel_status, channel_info, channel_data_len;
-
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iiii)", &channel_id, &channel_status, &channel_info, &channel_data_len);
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- evt_download->channel_status.channel_id = channel_id;
- evt_download->channel_status.status = channel_status;
- evt_download->channel_status.status_info = channel_info;
- evt_download->channel_data_len.data_len = channel_data_len;
- dbg("data available channel id (%d)", evt_download->channel_status.channel_id);
- } break;
- case EVENT_CHANNEL_STATUS:{
- gint channel_id, channel_status, channel_info;
-
- dbg("data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iii)", &channel_id, &channel_status, &channel_info);
- evt_download->device_identitie.src = src_dev;
- evt_download->device_identitie.dest = dest_dev;
- evt_download->channel_status.channel_id = channel_id;
- evt_download->channel_status.status = channel_status;
- evt_download->channel_status.status_info = channel_info;
-
- } break;
- default :
- dbg("not support download event (%d)", event_type);
- break;
- }
-
- return TRUE;
-}
-
-gboolean sat_manager_update_language(struct custom_data *ctx, const char *plugin_name, GVariant *language_noti)
-{
- Server *s = NULL;
- TcorePlugin *plg = NULL;
- static Storage *strg;
-
- TReturn rv = TCORE_RETURN_FAILURE;
- gboolean result = FALSE;
- const gchar *lang_str = NULL;
- gint command_id, language;
- gboolean b_specified;
-
- struct treq_sat_terminal_rsp_data *tr;
- struct sat_manager_queue_data q_data;
-
- s = ctx->server;
- strg = tcore_server_find_storage(s, "vconf");
-
- plg = tcore_server_find_plugin(ctx->server, plugin_name);
- if (!plg){
- dbg("there is no valid plugin at this point");
- return result;
- }
-
- memset(&q_data, 0, sizeof(struct sat_manager_queue_data));
-
- dbg("language_noti type_format(%s)", g_variant_get_type_string(language_noti));
- g_variant_get(language_noti, "(iib)", &command_id, &language, &b_specified);
-
- if (sat_manager_dequeue_cmd_by_id(ctx, &q_data, command_id) == FALSE) {
- dbg("[SAT] command dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- if(q_data.cmd_type != SAT_PROATV_CMD_LANGUAGE_NOTIFICATION){
- dbg("[SAT] Language Noti dequeue failed. didn't find in command Q!!");
- return result;
- }
-
- tr = g_new0(struct treq_sat_terminal_rsp_data, 1);
- tr->cmd_number = q_data.cmd_data.language_notification.command_detail.cmd_num;
- tr->cmd_type = q_data.cmd_data.language_notification.command_detail.cmd_type;
- memcpy((void*)&tr->terminal_rsp_data.language_notification.command_detail, &q_data.cmd_data.language_notification.command_detail, sizeof(struct tel_sat_cmd_detail_info));
- tr->terminal_rsp_data.language_notification.device_id.src = DEVICE_ID_ME;
- tr->terminal_rsp_data.language_notification.device_id.dest = DEVICE_ID_SIM;
- tr->terminal_rsp_data.language_notification.result_type = RESULT_SUCCESS;
-
- lang_str = _convert_sim_lang_to_string((enum tel_sim_language_type)language);
- if(!lang_str){
- dbg("language is not exist");
- tr->terminal_rsp_data.language_notification.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- }
- dbg("converted lang (%s)", lang_str);
-
- result = tcore_storage_set_string(strg,STORAGE_KEY_LANGUAGE_SET, (const char*)lang_str);
- if(!result){
- dbg("fail to update language");
- tr->terminal_rsp_data.language_notification.result_type = RESULT_ME_UNABLE_TO_PROCESS_COMMAND;
- }
-
- result = TRUE;
- rv = sat_manager_send_terminal_response(ctx->comm, plg, tr);
- if(rv != TCORE_RETURN_SUCCESS){
- dbg("fail to send terminal response");
- result = FALSE;
- }
-
- g_free(tr);
- return result;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#ifndef SAT_MANAGER_H_
-#define SAT_MANAGER_H_
-
-#include <tcore.h>
-#include <type/sat.h>
-#include "common.h"
-
-
-typedef union {
- struct tel_sat_display_text_tlv displayTextInd; /**< Parsed proactive command info from TLV to Telephony data type - display text */
- struct tel_sat_get_inkey_tlv getInkeyInd; /**< Parsed proactive command info from TLV to Telephony data type - getInkey */
- struct tel_sat_get_input_tlv getInputInd; /**< Parsed proactive command info from TLV to Telephony data type - getInput */
- struct tel_sat_play_tone_tlv play_tone;
- struct tel_sat_setup_menu_tlv setupMenuInd; /**< Parsed proactive command info from TLV to Telephony data type - setup menu */
- struct tel_sat_select_item_tlv selectItemInd; /**< Parsed proactive command info from TLV to Telephony data type - select item */
- struct tel_sat_send_sms_tlv sendSMSInd;
- struct tel_sat_send_ss_tlv send_ss;
- struct tel_sat_send_ussd_tlv send_ussd;
- struct tel_sat_setup_call_tlv setup_call;
- struct tel_sat_refresh_tlv refresh;
- struct tel_sat_provide_local_info_tlv provide_local_info;
- struct tel_sat_setup_idle_mode_text_tlv idle_mode;
- struct tel_sat_send_dtmf_tlv send_dtmf;
- struct tel_sat_language_notification_tlv language_notification;
- struct tel_sat_launch_browser_tlv launch_browser;
- struct tel_sat_open_channel_tlv open_channel;
- struct tel_sat_close_channel_tlv close_channel;
- struct tel_sat_receive_channel_tlv receive_data;
- struct tel_sat_send_channel_tlv send_data;
- struct tel_sat_get_channel_status_tlv get_channel_status;
-} sat_manager_proactive_data;
-
-/**
- * This structure defines the Command Queue Info.
- */
-struct sat_manager_queue_data {
- enum tel_sat_proactive_cmd_type cmd_type; /**<Type of Command*/
- int cmd_id; /**<Command Id*/
- sat_manager_proactive_data cmd_data; /**<Proactive Cmd Ind Info*/
-};
-
-
-/*================================================================================================*/
-
-// queue handling
-void sat_manager_init_queue(struct custom_data *ctx);
-gboolean sat_manager_remove_cmd_by_id(struct custom_data *ctx, int cmd_id);
-
-//application request handling
-gboolean sat_manager_handle_user_confirm(struct custom_data *ctx, TcorePlugin *plg, GVariant *user_confirm_data);
-gboolean sat_manager_handle_app_exec_result(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gint command_type, GVariant *exec_result);
-gboolean sat_manager_handle_ui_display_status(struct custom_data *ctx, TcorePlugin *plg, gint command_id, gboolean display_status);
-gboolean sat_manager_handle_event_download_envelop(int event_type, int src_dev, int dest_dev, struct tel_sat_envelop_event_download_tlv *evt_download, GVariant *download_data);
-gboolean sat_manager_update_language(struct custom_data *ctx, const char *plugin_name, GVariant *language_noti);
-
-//proactive command processing
-GVariant* sat_manager_caching_setup_menu_info(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_menu_tlv* setup_menu_tlv);
-GVariant* sat_manager_display_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_display_text_tlv* display_text_tlv);
-GVariant* sat_manager_select_item_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_select_item_tlv* select_item_tlv);
-GVariant* sat_manager_get_inkey_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_inkey_tlv* get_inkey_tlv);
-GVariant* sat_manager_get_input_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_input_tlv* get_input_tlv);
-GVariant* sat_manager_play_tone_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_play_tone_tlv* play_tone_tlv);
-GVariant* sat_manager_send_sms_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_sms_tlv* send_sms_tlv);
-GVariant* sat_manager_send_ss_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ss_tlv* send_ss_tlv);
-GVariant* sat_manager_send_ussd_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_ussd_tlv* send_ussd_tlv);
-GVariant* sat_manager_setup_call_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_call_tlv* setup_call_tlv);
-GVariant* sat_manager_setup_event_list_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_event_list_tlv *event_list_tlv);
-GVariant* sat_manager_setup_idle_mode_text_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_setup_idle_mode_text_tlv *idle_mode_tlv);
-GVariant* sat_manager_open_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_open_channel_tlv *open_channel_tlv);
-GVariant* sat_manager_close_channel_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_close_channel_tlv *close_channel_tlv);
-GVariant* sat_manager_receive_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_receive_channel_tlv *receive_data_tlv);
-GVariant* sat_manager_send_data_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_channel_tlv *send_data_tlv);
-GVariant* sat_manager_get_channel_status_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_get_channel_status_tlv *get_channel_status_tlv);
-GVariant* sat_manager_refresh_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_refresh_tlv *refresh_tlv);
-void sat_manager_more_time_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_more_time_tlv *more_time_tlv);
-GVariant* sat_manager_send_dtmf_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_send_dtmf_tlv *send_dtmf_tlv);
-GVariant* sat_manager_launch_browser_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_launch_browser_tlv *launch_browser_tlv);
-GVariant* sat_manager_provide_local_info_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_provide_local_info_tlv *provide_local_info_tlv);
-GVariant* sat_manager_language_notification_noti(struct custom_data *ctx, const char *plugin_name, struct tel_sat_language_notification_tlv *language_notification_tlv);
-
-#endif /* SAT_MANAGER_H_ */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup TAPI_CALL CALL
- * @{
- *
- * @file TelCall.h
-
- @brief This file serves as a "C" header file defines structures for Tapi Call Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_CALL_H_
-#define _TEL_CALL_H_
-
-#include <TelSs.h>
-#include <TelDefines.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define TAPI_CALLING_NAME_SIZE_MAX 80 /**< The maximum length of the string for calling party name. */
-#define TAPI_CALL_UUS_DATA_LEN_MAX 131 /**< The Maximum length of the user to user singnalling data string. */
-#define TAPI_CALL_DISPLAY_RECORD_MAX 32 /**< The maximum length of the string for display record in CDMA */
-#define MAX_TAPI_CALL_COUNT 6 /**< Maximum number of call can be possible at a time */
-#define MAX_TAPI_CONF_CALL_COUNT 5 /**< Maximum number of Call can be possible in a conference call at a time */
-#define INVALID_CALL_HANDLE 0 /**< TS_UINT is used for call handle */
-
-/* Call */
-#define TAPI_CALL_DIALDIGIT_LEN_MAX 82 /**< Maximum Dialling Digit Length */
-#define TAPI_CALL_SUBADDRESS_LEN_MAX 40 /**< Maximum Call Subaddress Length */
-#define TAPI_CALL_NUMBER_LEN_MAX 7 /**< Dialling Num length */
-#define TAPI_CONTEXT_CALL_SIZE_MAX 6 /**< Maximum Call context */
-#define TAPI_CALL_DIAL_NUMBER_LEN_MAX 82
-
-#define TAPI_INVALID_CONTEXTHANDLE (HTapiContext)-1
-#define TAPI_CLIENT_SIZE_MAX 30
-#define TAPI_CALL_CUSTOM_SERVICE_DATA_MAX 128
-
-/**
- * @enum TelCallCause_t
- * This structure defines the values for Call Cause.
- */
-typedef enum {
- TAPI_CAUSE_SUCCESS, /**< Success */
- TAPI_CAUSE_ACCESSDISCARD, /**< Access discarded */
- TAPI_CAUSE_BARR_BYOPERATOR, /**< Barred by operator */
- TAPI_CAUSE_BEARERMODE_NOTIMPL, /**< Bearer mode not implemented */
- TAPI_CAUSE_BEARERMODE_RESTRICTED, /**< Bearer mode restricted */
- TAPI_CAUSE_BEARERMODE_UNAUTH, /**< Bearer mode un authorized */
- TAPI_CAUSE_BEARERMODE_UNAVAIL, /**< Bearer mode not available */
- TAPI_CAUSE_BUSY, /**< (Network/Server) busy */
- TAPI_CAUSE_CALLMETER_EXPIRED, /**< Call meter expired */
- TAPI_CAUSE_CALLNO_ERROR, /**< Call number error */
- TAPI_CAUSE_CKTUNAVAIL, /**< Circuit channel unavailable */ //10
- TAPI_CAUSE_CONGESTION, /**< Congestion happened */
- TAPI_CAUSE_NO_CIRCUIT_AVAIL, /**< Circuit not available */
- TAPI_CAUSE_DESTIN_INCOMPAT, /**< Destination incompatibility */
- TAPI_CAUSE_DTMF_NOSPEECH, /**< No speech in DTMF */
- TAPI_CAUSE_DTMF_REJECTED, /**< DTMF rejected */
- TAPI_CAUSE_FACILITY_NOTIMPL, /**< Facility not implemented */
- TAPI_CAUSE_FACILITY_NOTSUBSCRIBED, /**< Facility not subscribed */
- TAPI_CAUSE_INCOMINGCUGCALLS_BARRED, /**< Incoming CUG Calls barred */
- TAPI_CAUSE_INVALNUM, /**< Invalid number */
- TAPI_CAUSE_MPTY_ERROR, /**< Multiparty error */ //20
- TAPI_CAUSE_NOANSWER, /**< No answer */
- TAPI_CAUSE_NONCUGMEMBER, /**< Non CUG member */
- TAPI_CAUSE_NUMBERCHANGED, /**< Number changed */
- TAPI_CAUSE_NUMBER_ERROR, /**< Number error */
- TAPI_CAUSE_NWFAILURE, /**< Network failure */
- TAPI_CAUSE_OPERATIONUNAVAIL, /**< Operation not available */
- TAPI_CAUSE_OUTOFORDER, /**< Out of order */
- TAPI_CAUSE_PROTOCOL_ERROR, /**< Protocol error */
- TAPI_CAUSE_QOSUNAVAIL, /**< QOS unavailable */
- TAPI_CAUSE_REJECT, /**< Rejected */ //30
- TAPI_CAUSE_REJ_FAIL, /**< Rejection failed */
- TAPI_CAUSE_REJ_SRVC_NOT_AVL, /**< Rejection service not available */
- TAPI_CAUSE_REMOTE_CKTUNAVAIL, /**< Remote Circuit channel unavailable */
- TAPI_CAUSE_RESOURCEUNAVAIL, /**< Resource not available */
- TAPI_CAUSE_SERVICEID_ERROR, /**< Service id error */
- TAPI_CAUSE_SERVICE_NOTIMPL, /**< Service not implemented */
- TAPI_CAUSE_SERVICE_UNAVAIL, /**< Service not available */
- TAPI_CAUSE_MODIFY_SAME_BEARER, /**< Modify same bearer */
- TAPI_CAUSE_MODIFY_NOT_PERMITTED, /**< Modification not permitted */
- TAPI_CAUSE_HOLD_FAIL, /**< Call hold fail */ //40
- TAPI_CAUSE_TEMPFAILURE, /**< Temporary failure */
- TAPI_CAUSE_WRONGNUM, /**< Wrong number */
- TAPI_CAUSE_NORMAL_UNSPECIFIED, /**< Normal but unspecified */
- TAPI_CAUSE_SSERRINVALIDTIVALUE, /**< SS invalid Transaction ID Value */
- TAPI_CAUSE_SSERRINVALIDTI, /**< SS Invalid transaction ID */
- TAPI_CAUSE_SSINCOMPATIBLESTATE, /**< SS incompatible state */
- TAPI_CAUSE_SSERRSYNTAXERROR, /**< SS syntax error */
- TAPI_CAUSE_SSPROTOCOLERROR, /**< Protocol error */
- TAPI_CAUSE_SSNEGATIVEPASSWORDCHECK, /**< Negative password check */
- TAPI_CAUSE_SSSENTASPHASE1, /**< SS sent as phase1 message */ //50
- TAPI_CAUSE_SSERROR, /**< Supplementary service error */
- TAPI_CAUSE_SS_USSD_BUSY, /**< Second USSD request will be rejected when already USSD transaction is ongoing. */
- TAPI_CAUSE_IDLE, /**< Idle */
- TAPI_CAUSE_NETWORK_SPECIFIC, /**< Network specific error */
- TAPI_CAUSE_FADE, /**< voice call was dropped e.g. because of a loss of signal */
- TAPI_CAUSE_UNKNOWN, /**< unknown no details available */
- TAPI_CAUSE_INCOM_CALL, /**< terminated by incoming call */
- TAPI_CAUSE_ALERT_STOP, /**< terminated by alert stop */
- TAPI_CAUSE_INTERCEPT, /**< voice call was dropped by interception */
- TAPI_CAUSE_REORDER, /**< voice call was dropped by reordering */ //60
- TAPI_CAUSE_CLIENT_END, /**< client ended the call */
- TAPI_CAUSE_ACCESS_CLASS_BLOCKED, /**< access class blocked */
- TAPI_CAUSE_MEMCAPEXCEEDED, /**< Memory capacity exceeded */
- TAPI_CAUSE_TYPENOTSUPPORTED, /**< Type not supported */
- TAPI_CAUSE_REPLACENOTSUPPORTED, /**< Replace not supported */
- TAPI_CAUSE_PROTOCOLID_ERROR, /**< Protocol id error */
- TAPI_CAUSE_CLASSNOTSUPPORTED, /**< Class not supported */
- TAPI_CAUSE_DATACODING_ERROR, /**< Data coding error */
- TAPI_CAUSE_INVAL_MSG, /**< Invalid message */
- TAPI_CAUSE_CALL_BARRED, /**< Call barred */ //70
- TAPI_CAUSE_SIM_CALL_CONTROL_CHANGED_TO_SS, /**< Sim call control changed to SS */
- TAPI_CAUSE_SIM_CALL_CONTROL_CHANGED_TO_CALL, /**< SIM Call control changed to call */
- TAPI_CAUSE_SIM_ERROR, /**< SIM error */
- TAPI_CAUSE_SIM_CALL_CONTROL_MODIFIED, /**< SIM call control modified */
- TAPI_CAUSE_RANDOM_ACCESS_FAILURE, /**< Random access error */
- TAPI_CAUSE_LOWER_LAYER_FAILURE, /**< Lower layer error */
- TAPI_CAUSE_ACCESS_REJECTED, /**< Access rejected */
- TAPI_CAUSE_RESET_NOT_ALLOWED, /**< Reset not allowed */
- TAPI_CAUSE_EMERGENCY_CALL_NOT_ALLOWED, /**< Emergency call not allowed */
- TAPI_CAUSE_ACCESS_NOT_ALLOWED, /**< Access not allowed */ //80
- TAPI_CAUSE_RADIO_LINK_FAILURE, /**< Radio link failure */
- TAPI_CAUSE_INVALID_IDENTITY, /**< Invalid identity */
- TAPI_CAUSE_UNKNOWN_IDENTITY, /**< Unknown identity */
- TAPI_CAUSE_UNACCEPTABLE_IDENTITY, /**< Un acceptable identity */
- TAPI_CAUSE_NO_SERVICE_HERE, /**< No service here */
- TAPI_CAUSE_SERVICE_NOT_ALLOWED, /**< Service not allowed */
- TAPI_CAUSE_SERVICE_NOT_AVAIL, /**< Service not available */
- TAPI_CAUSE_SERVICE_NOT_WORKING, /**< Service not working */
- TAPI_CAUSE_CANNOT_IDENTIFY_CALL, /**< Cannot identify the call */
- TAPI_CAUSE_DEACTIVATION, /**< Deactivation */ //90
- TAPI_CAUSE_FATAL_ERROR, /**< Fatal error */
- TAPI_CAUSE_SEND_DTMF_SUCCESS, /**< Sending DTMF Success */
- TAPI_CAUSE_SEND_DTMF_FAIL, /**< Sending DTMF Failed */
- TAPI_CAUSE_TIMER_EXPIRED, /**< Call Timer Expired */
-} TelCallCause_t;
-
-/**
- * @enum TelTapiEndCause_t
- * When a call is ended, this end cause is given with the CALL END notification to the application. This end cause can be originated
- * from different elements in the communication path or different modules in the same element.
- */
-typedef enum {
- TAPI_CALL_END_NO_CAUSE = 0x00, /**< No Cause */
-
- TAPI_CC_CAUSE_UNASSIGNED_NUMBER, /**< Unassigned Number */
- TAPI_CC_CAUSE_NO_ROUTE_TO_DEST, /**< No Route to Destination */
- TAPI_CC_CAUSE_CHANNEL_UNACCEPTABLE, /**< Channel Unacceptable */
- TAPI_CC_CAUSE_OPERATOR_DETERMINED_BARRING, /**< Operator Determined Barring */
- TAPI_CC_CAUSE_NORMAL_CALL_CLEARING, /**< Normal Call Clearing */
-
- TAPI_CC_CAUSE_USER_BUSY, /**< User Busy */
- TAPI_CC_CAUSE_NO_USER_RESPONDING, /**< No user Responding */
- TAPI_CC_CAUSE_USER_ALERTING_NO_ANSWER, /**< User Alerting no Answer */
- TAPI_CC_CAUSE_CALL_REJECTED, /**< Call Rejected */
- TAPI_CC_CAUSE_NUMBER_CHANGED, /**< Number Changed */
-
- TAPI_CC_CAUSE_NON_SELECTED_USER_CLEARING, /**< Non Selected User Clearing */
- TAPI_CC_CAUSE_DESTINATION_OUT_OF_ORDER, /**< Destination out of Order */
- TAPI_CC_CAUSE_INVALID_NUMBER_FORMAT, /**< Invalid Number Format */
- TAPI_CC_CAUSE_FACILITY_REJECTED, /**< Facility Rejected */
- TAPI_CC_CAUSE_RESPONSE_TO_STATUS_ENQUIRY, /**< Response to Status Enquiry */
-
- TAPI_CC_CAUSE_NORMAL_UNSPECIFIED, /**< Normal Unspecified */
- TAPI_CC_CAUSE_NO_CIRCUIT_CHANNEL_AVAILABLE, /**< No Circuit Channel Available */
- TAPI_CC_CAUSE_NETWORK_OUT_OF_ORDER, /**< Network out of Order */
- TAPI_CC_CAUSE_TEMPORARY_FAILURE, /**< Temporary Failure */
- TAPI_CC_CAUSE_SWITCHING_EQUIPMENT_CONGESTION, /**< Switching Equipment Congestion */
-
- TAPI_CC_CAUSE_ACCESS_INFORMATION_DISCARDED, /**< Access Information Discarded */
- TAPI_CC_CAUSE_REQUESTED_CIRCUIT_CHANNEL_NOT_AVAILABLE, /**< Requested Circuit channel not available */
- TAPI_CC_CAUSE_RESOURCES_UNAVAILABLE_UNSPECIFIED, /**< Resources unavailable unspecified */
- TAPI_CC_CAUSE_QUALITY_OF_SERVICE_UNAVAILABLE, /**< Quality of service unavailable */
- TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_SUBSCRIBED, /**< Requested facility not subscribed */
-
- TAPI_CC_CAUSE_INCOMING_CALL_BARRED_WITHIN_CUG, /**< incomming call barred within CUG */
- TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_AUTHORISED, /**< Bearer Capability not Authorised */
- TAPI_CC_CAUSE_BEARER_CAPABILITY_NOT_PRESENTLY_AVAILABLE,/**< Bearer capability not presently Available */
- TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_AVAILABLE, /**< Service or Option not available */
- TAPI_CC_CAUSE_BEARER_SERVICE_NOT_IMPLEMENTED, /**< Service not implemented */
-
- TAPI_CC_CAUSE_ACM_GEQ_ACMMAX, /**< ACM GEQ ACMAX */
- TAPI_CC_CAUSE_REQUESTED_FACILITY_NOT_IMPLEMENTED, /**< Requested facility not implemented */
- TAPI_CC_CAUSE_ONLY_RESTRICTED_DIGITAL_INFO_BC_AVAILABLE,/**< Resticted digital info BC not available */
- TAPI_CC_CAUSE_SERVICE_OR_OPTION_NOT_IMPLEMENTED, /**< Service or Option not Implemented */
- TAPI_CC_CAUSE_INVALID_TRANSACTION_ID_VALUE, /**< Transaction ID value */
-
- TAPI_CC_CAUSE_USER_NOT_MEMBER_OF_CUG, /**< Not member of CUG */
- TAPI_CC_CAUSE_INCOMPATIBLE_DESTINATION, /**< Incompatible Destination */
- TAPI_CC_CAUSE_INVALID_TRANSIT_NETWORK_SELECTION, /**< Transit Network selection */
- TAPI_CC_CAUSE_SEMANTICALLY_INCORRECT_MESSAGE, /**< Semantically Incorrect message */
- TAPI_CC_CAUSE_INVALID_MANDATORY_INFORMATION, /**< Invalid Mandatory Message */
-
- TAPI_CC_CAUSE_MESSAGE_TYPE_NON_EXISTENT, /**< Message Type Non Existent */
- TAPI_CC_CAUSE_MESSAGE_TYPE_NOT_COMPATIBLE_WITH_PROT_STATE, /**< Message type not compatible with Prot state */
- TAPI_CC_CAUSE_IE_NON_EXISTENT_OR_NOT_IMPLEMENTED, /**< IE non exitent or not implemented */
- TAPI_CC_CAUSE_CONDITIONAL_IE_ERROR, /**< Conditional IE error */
- TAPI_CC_CAUSE_MESSAGE_NOT_COMPATIBLE_WITH_PROTOCOL_STATE, /**< Not Compatible with protocol state */
-
- TAPI_CC_CAUSE_RECOVERY_ON_TIMER_EXPIRY, /**< Recovery on timer expiry */
- TAPI_CC_CAUSE_PROTOCOL_ERROR_UNSPECIFIED, /**< Protocol error unspecified */
- TAPI_CC_CAUSE_INTERWORKING_UNSPECIFIED, /**< Interworking unspecified */
-
- TAPI_CC_CAUSE_END = 128,
-
- /* Reject causes*/
- TAPI_REJECT_CAUSE_IMSI_UNKNOWN_IN_HLR, /**< IMSI unknown in HLR */
- TAPI_REJECT_CAUSE_ILLEGAL_MS, /**< Illegal MS */
- TAPI_REJECT_CAUSE_IMSI_UNKNOWN_IN_VLR, /**< IMSI unknown in VLR */
- TAPI_REJECT_CAUSE_IMEI_NOT_ACCEPTED, /**< IMEI not accepted */
- TAPI_REJECT_CAUSE_ILLEGAL_ME, /**< Illegal ME */
-
- TAPI_REJECT_CAUSE_GPRS_SERVICES_NOT_ALLOWED, /**< GPRS service not allowed */
- TAPI_REJECT_CAUSE_GPRS_SERVICES_AND_NON_GPRS_SERVICES_NOT_ALLOWED, /**< GPRS services and Non-GPRS services not allowed */
- TAPI_REJECT_CAUSE_MS_IDENTITY_CANNOT_BE_DERIVED_BY_THE_NETWORK, /**< MS device cannot be derived by the network */
- TAPI_REJECT_CAUSE_IMPLICITLY_DETACHED, /**< Implicitly detached */
- TAPI_REJECT_CAUSE_PLMN_NOT_ALLOWED, /**< PLMN not allowed */
-
- TAPI_REJECT_CAUSE_LA_NOT_ALLOWED, /**< LA not allowed */
- TAPI_REJECT_CAUSE_NATIONAL_ROAMING_NOT_ALLOWED, /**< National roaming not allowed */
- TAPI_REJECT_CAUSE_GPRS_SERVICES_NOT_ALLOWED_IN_THIS_PLMN, /**< GPRS services not allowed in this PLMN */
- TAPI_REJECT_CAUSE_NO_SUITABLE_CELLS_IN_LA, /**< No suitable cells in the LA */
- TAPI_REJECT_CAUSE_MSC_TEMPORARILY_NOT_REACHABLE, /**< MSC temporarily not reachable */
-
- TAPI_REJECT_CAUSE_NETWORK_FAILURE, /**< Network unavailable */
- TAPI_REJECT_CAUSE_MAC_FAILURE, /**< MAC failure */
- TAPI_REJECT_CAUSE_SYNCH_FAILURE, /**< SYNCh failure */
- TAPI_REJECT_CAUSE_CONGESTTION, /**< Congestion */
- TAPI_REJECT_CAUSE_GSM_AUTH_UNACCEPTED, /**< GSM Auth unaccepted */
-
- TAPI_REJECT_CAUSE_SERVICE_OPTION_NOT_SUPPORTED, /**< Service option not supported */
- TAPI_REJECT_CAUSE_REQ_SERV_OPT_NOT_SUBSCRIBED, /**< REQ_SERV option not suscribed */
- TAPI_REJECT_CAUSE_SERVICE_OPT__OUT_OF_ORDER, /**< Service OPT out of order */
- TAPI_REJECT_CAUSE_CALL_CANNOT_BE_IDENTIFIED, /**< Call cannot be identified */
- TAPI_REJECT_CAUSE_NO_PDP_CONTEXT_ACTIVATED, /**< No PDP context Activated */
-
- TAPI_REJECT_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_MIN_VALUE, /**< Retry upon entry into a new call min value */
- TAPI_REJECT_CAUSE_RETRY_UPON_ENTRY_INTO_A_NEW_CELL_MAX_VALUE, /**< Retry upon entry into a new call max value */
- TAPI_REJECT_CAUSE_SEMANTICALLY_INCORRECT_MSG, /**< Semantically incorret message */
- TAPI_REJECT_CAUSE_INVALID_MANDATORY_INFO, /**< Invalid mandatory information */
- TAPI_REJECT_CAUSE_MESSAGE_TYPE_NON_EXISTANT, /**< Message type non-existant */
-
- TAPI_REJECT_CAUSE_MESSAGE_TYPE_NOT_COMP_PRT_ST, /**< Message type not COMP PRT ST */
- TAPI_REJECT_CAUSE_IE_NON_EXISTANT, /**< IE not existant */
- TAPI_REJECT_CAUSE_MSG_NOT_COMPATIBLE_PROTOCOL_STATE, /**< MSG not compatible protocol state */
-
- /* Connection Management establishment rejection cause */
- TAPI_REJECT_CAUSE_REJ_UNSPECIFIED, /**< rej unspecified */
-
- /* AS reject causes */
- TAPI_REJECT_CAUSE_AS_REJ_RR_REL_IND, /**< RR release indication */
- TAPI_REJECT_CAUSE_AS_REJ_RR_RANDOM_ACCESS_FAILURE, /**< Random Access Failure */
- TAPI_REJECT_CAUSE_AS_REJ_RRC_REL_IND, /**< RRC release indication */
- TAPI_REJECT_CAUSE_AS_REJ_RRC_CLOSE_SESSION_IND, /**< RRC close session indication */
- TAPI_REJECT_CAUSE_AS_REJ_RRC_OPEN_SESSION_FAILURE, /**< RRC open session failure */
- TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_FAIL, /**< Low level failure */
- TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_FAIL_REDIAL_NOT_ALLOWED, /**< Low level failure redial not alowed */
- TAPI_REJECT_CAUSE_AS_REJ_LOW_LEVEL_IMMED_RETRY, /**< low level immediate retry */
-
- /* MM reject causes */
- TAPI_REJECT_CAUSE_MM_REJ_INVALID_SIM, /**< invalid Sim */
- TAPI_REJECT_CAUSE_MM_REJ_NO_SERVICE, /**< No service */
- TAPI_REJECT_CAUSE_MM_REJ_TIMER_T3230_EXP, /**< Timer T3230 expire */
- TAPI_REJECT_CAUSE_MM_REJ_NO_CELL_AVAILABLE, /**< No call available */
- TAPI_REJECT_CAUSE_MM_REJ_WRONG_STATE, /**< wrong state */
- TAPI_REJECT_CAUSE_MM_REJ_ACCESS_CLASS_BLOCKED, /**< Access class blocked */
-
- /* Definitions for release ind causes between MM and CNM*/
- TAPI_REJECT_CAUSE_ABORT_MSG_RECEIVED, /**< Abort Message received */
- TAPI_REJECT_CAUSE_OTHER_CAUSE, /**< Other cause */
-
- /* CNM reject causes */
- TAPI_REJECT_CAUSE_CNM_REJ_TIMER_T303_EXP, /**< Timer T303 expiry */
- TAPI_REJECT_CAUSE_CNM_REJ_NO_RESOURCES, /**< Rejected due to unavailibilty of resources */
- TAPI_REJECT_CAUSE_CNM_MM_REL_PENDING, /**< MM release pending */
- TAPI_REJECT_CAUSE_CNM_INVALID_USER_DATA, /**< Invalid user data */
- TAPI_CALL_END_CAUSE_MAX = 255, /**< Maximum End Cause limit for gsm/wcdma */
-
- /* CDMA CALL END CAUSE */
- TAPI_CDMA_END_CAUSE_REL_BY_USER = 0x1001, /**< Call Released by User */
- TAPI_CDMA_END_CAUSE_REL_BY_NET, /**< Call Released by Network */
- TAPI_CDMA_END_CAUSE_REL_NET_BUSY, /**< Call Released because of Network busy */
- TAPI_CDMA_END_CAUSE_NO_SVC, /**< Call Released because of No Service area */
- TAPI_CDMA_END_CAUSE_FADING, /**< Call Released because of Fading */
- TAPI_CDMA_END_CAUSE_RELEASE_BY_REORDER, /**< Call Released because of reorder */
- TAPI_CDMA_END_CAUSE_RELEASE_BY_INTERCEPT, /**< Call Released because of intercept */
- TAPI_CDMA_END_CAUSE_SILENT_ZONE_RETRY, /**< Call Released because of silent zone retry */
- TAPI_CDMA_END_CAUSE_OTA_CALL_FAIL, /**< Call Released because of OTA cal failure */
- TAPI_CDMA_END_CAUSE_PHONE_OFFLINE, /**< Call Released because of phone offline */
- TAPI_CDMA_END_CAUSE_PHONE_IS_CDMA_LOCKED, /**< Call Released because of CDMA locked */
- TAPI_CDMA_END_CAUSE_FLASH_IS_IN_PROGRESS_ERR, /**< Call Released because of flash-is-in-progress error */
- TAPI_CDMA_END_CAUSE_E911_MODE_ERR, /**< Call Released because of e911 mode */
- TAPI_CDMA_END_CAUSE_OTHERS, /**< Call Released by Others */
- TAPI_CDMA_END_CAUSE_MAX /**< Maximum End Cause limit for cdma */
-} TelTapiEndCause_t;
-
-/**
- * @enum TelConferenceCallState_t
- * This enum defines the call conference states
- */
-typedef enum {
- TAPI_CALL_CONFERENCE_IDLE, /**< idle */
- TAPI_CALL_CONFERENCE_ACTIVE /**< active */
-} TelConferenceCallState_t;
-
-/**
- * @enum TelCallStates_t
- * Applications can use these sates or can have their own states.
- */
-typedef enum {
- TAPI_CALL_STATE_IDLE, /**< Call is in idle state - i.e. no call */
- TAPI_CALL_STATE_ACTIVE, /**< Call is in connected and conversation state */
- TAPI_CALL_STATE_HELD, /**< Call is in held state */
- TAPI_CALL_STATE_DIALING, /**< Call is in dialing state */
- TAPI_CALL_STATE_ALERT, /**< Call is in alerting state */
- TAPI_CALL_STATE_INCOMING, /**< Call is in incoming state */
- TAPI_CALL_STATE_WAITING, /**< Call is in answered state, and waiting for connected indication event */
- TAPI_CALL_STATE_MAX
-} TelCallStates_t;
-
-/**
- * IN GSM ONLY: call identification number.
- */
-typedef enum {
- TAPI_CALL_ACTIVE_LINE1, /**< Line 1 */
- TAPI_CALL_ACTIVE_LINE2 /**< Line 2 */
-} TelCallActiveLine_t;
-
-typedef enum {
- TAPI_CALL_UUS_NONE, /**< No User to User information */
- TAPI_CALL_UUS_1, /**< User to User information 1 */
-} TelCallUusType_t;
-
-/**
- * The Incoming call indication could have be one of the following SS info messages in it.
- */
-typedef enum {
- /* Number details are present in the "char number" of call info struct. if number is not present
- then "no cli cause" member in mt_ss_info is set accordingly. */
- TAPI_CALL_MT_CLI_PRESENT = 0x31,
-
- /* Calling Name Info presnet, TelCallingNameInfo_t of call info struct contains this info. */
- TAPI_CALL_MT_CNA_PRESENT = 0x32,
-
- /* Undefined ss indication. Ignore mt_ss_info */
- TAPI_CALL_MT_SS_UNDEFINED = 0x00,
-
-} TelCallMtSSInfo_t;
-
-/**
- * @enum TelCallAnswerType_t
- * Answer type used as in parameter in the answer call API.
- */
-typedef enum {
- TAPI_CALL_ANSWER_ACCEPT = 0, /**< Used to answer an incoming call when there are no current active calls. */
- TAPI_CALL_ANSWER_REJECT, /**< Used to reject the incoming call */
- TAPI_CALL_ANSWER_REPLACE, /**< Release current active call and accept the */
- TAPI_CALL_ANSWER_HOLD_AND_ACCEPT, /**< Hold the current active call, and accept the wating call */
-} TelCallAnswerType_t;
-
-/**
- * @enum TelCallEndType_t
- * End type used as in parameter in the end call API.
- */
-typedef enum {
- TAPI_CALL_END = 0,
- TAPI_CALL_END_ALL,
- TAPI_CALL_END_ACTIVE_ALL,
- TAPI_CALL_END_HOLD_ALL,
-} TelCallEndType_t;
-
-
-
-
-/**
- * @enum TelCallType_t
- * Applications needs to use this call type while using the setup call API. Like the requested call is a voice call or video call.
- */
-typedef enum {
- TAPI_CALL_TYPE_VOICE, /**< Voice call type. */// in ipcv4, 0x0100
- TAPI_CALL_TYPE_DATA, /**< Data call type - (for modem, fax, packet, etc. calls). */// in ipcv4, 0x0200
- TAPI_CALL_TYPE_E911 /**< Emergency call type. */// in ipcv4, 0x0700
-} TelCallType_t;
-
-/**
- * @enum TelCallAlertingPattern_t
- * This enumeration defines the different alerting patterns available.
- */
-typedef enum {
- TAPI_CALL_ALERTING_PATTERN_1 = 0x00, /**< Pattern 1 */
- TAPI_CALL_ALERTING_PATTERN_2 = 0x01, /**< Pattern 2 */
- TAPI_CALL_ALERTING_PATTERN_3 = 0x02, /**< Pattern 3 */
- TAPI_CALL_ALERTING_PATTERN_4 = 0x03, /**< Pattern 4 */
- TAPI_CALL_ALERTING_PATTERN_5 = 0x04, /**< Pattern 5 */
- TAPI_CALL_ALERTING_PATTERN_6 = 0x05, /**< Pattern 6 */
- TAPI_CALL_ALERTING_PATTERN_7 = 0x06, /**< Pattern 7 */
- TAPI_CALL_ALERTING_PATTERN_8 = 0x07, /**< Pattern 8 */
- TAPI_CALL_NO_ALERTING_PATTERN = 0x08 /**< No Alerting Pattern */
-} TelCallAlertingPattern_t;
-
-/**
- * @enum TelCallActiveState_t
- * State of the current call.
- */
-typedef enum {
- TAPI_CALL_CONNECT_IDLE, /**< Call is in Idle state. */
- TAPI_CALL_CONNECT_ACTIVE, /**< Call is in Active state.*/
- TAPI_CALL_CONNECT_HELD /**< Call is in Held state. */
-} TelCallActiveState_t;
-
-/**
- * @enum TelCallCugOptions_t
- * This enumeration defines the closed user group options
- */
-typedef enum {
- TAPI_CALL_CUG_NO_INFO = 0x00, /**< No information */
- TAPI_CALL_CUG_SUPRESS_OA, /**< suppress OA */
- TAPI_CALL_CUG_SUPRESS_PRF_CUG, /**< suppress preferential CUG */
- TAPI_CALL_CUG_SUPRESS_OA_AND_CUG /**< suppress OA and preferential CUG */
-} TelCallCugOptions_t;
-
-/**
- * @enum TelCallUusProtocolType_t
- * This enumeration defines the tapi call uus protocol types
- */
-typedef enum {
- TAPI_CALL_UUS_PROTO_SPECIFIC = 0, /**< The user information is structured according to user needs. */
- TAPI_CALL_UUS_PROTO_OSI_HIGHER_LAYER = 1, /**< OSI high layer protocols */
- TAPI_CALL_UUS_PROTO_IA5_CHARS = 4, /**< user information consists of IA5 characters */
- TAPI_CALL_UUS_PROTO_V120 = 7, /**< rate adaptation */
- TAPI_CALL_UUS_PROTO_Q931 = 8 /**< user-network call control messages */
-} TelCallUusProtocolType_t;
-
-/**
- * @enum TelCallNameMode_t
- * This enumeration defines the call name mode
- */
-typedef enum {
- TAPI_CALL_NAME_AVAIL = 0, /**< This identifier refers to the presentation of the calling party's name identity to the called party. */
- TAPI_CALL_NAME_RESTRICTED = 1, /**< This identifier refers to the restriction of presentation of the name identity of the calling party to the called party. */
- TAPI_CALL_NAME_UNAVAIL = 2, /**< This identifier refers to the unavailability of the calling party's name identity to be offered to the called party. */
- TAPI_CALL_NAME_AVAIL_RESTRICTED = 3 /**< This identifier refers to the calling party's name identity to be offered to the called party with which presentation restriction is overridden. */
-} TelCallNameMode_t;
-
-/**
- * @enum TelCallSSNocliCause_t
- * This enumeration defines the value for "No Cli cause".
- */
-typedef enum {
- TAPI_SS_NO_CLI_CAUSE_UNAVAILABLE = 0x00, /**< Unavailable */
- TAPI_SS_NO_CLI_CAUSE_REJECTBY_USER = 0x01, /**< Rejected by User */
- TAPI_SS_NO_CLI_CAUSE_INTERACTION_OTHERSERVICES = 0x02, /**< Other services */
- TAPI_SS_NO_CLI_CAUSE_COINLINE_PAYPHONE = 0x03, /**< Coin line phone */
- TAPI_SS_NO_CLI_CAUSE_MAX /**< maximum usage */
-} TelCallSSNocliCause_t;
-
-/**
- * Fwded Ind Type used for MO and Mt from SS Noti Info
- */
-typedef enum {
- TAPI_CALL_OUTGOING_FWDED = 0x00, /* Outgoing call forwarded */
- TAPI_CALL_INCOMMING_FWDED = 0x01, /* Incoming call forwarded */
-} TelCallForwardType_t;
-
-/**
- * @enum TelCallPrivacyMode_t
- * This structure contains the voice privacy option mode(CDMA only).
- */
-typedef enum {
- TAPI_CALL_PRIVACY_MODE_STANDARD = 0x00, /**< Standard mode */
- TAPI_CALL_PRIVACY_MODE_ENHANCED /**< Enhanced mode */
-} TelCallPrivacyMode_t;
-
-/**
- * @enum TelCallPrivacyType_t
- * This structure contains the voice privacy request type(CDMA only).
- */
-typedef enum {
- TAPI_CALL_PRIVACY_TYPE_MS = 0x01, /**< Mobile Station Voice Privacy Mode */
- TAPI_CALL_PRIVACY_TYPE_BS, /**< Base Station Voice Privacy Mode */
- TAPI_CALL_PRIVACY_TYPE_CURRENT /**< Current Serving Privacy Mode */
-} TelCallPrivacyType_t;
-
-/**
- * @enum TelCallEmergecyMode_t
- * This structure contains the emergency callback mode(CDMA only).
- */
-typedef enum {
- TAPI_CALL_EMERGENCY_MODE_EXIT, /**< Emergency CB Exit mode */
- TAPI_CALL_EMERGENCY_MODE_ENTER /**< Emergency CB Enter mode */
-} TelCallEmergecyMode_t;
-
-/**
- * @enum TelCallOtaType_t
- * This structure contains the OTA type(CDMA only).
- */
-typedef enum {
- TAPI_CALL_OTATYPE_OTASP = 0x01, /**< OTASP : mobile initiated OTA*/
- TAPI_CALL_OTATYPE_OTAPA, /**< OTAPA : network initiated OTA */
-} TelCallOtaType_t;
-
-/**
- * @enum TelCallOtaspStatus_t
- * This structure contains the OTASP Status(CDMA only).
- */
-typedef enum {
- TAPI_CALL_OTASP_OK_SPL_UNLOCKED = 0x01, /**< OTASP : SPL unlocked ok*/
- TAPI_CALL_OTASP_OK_AKEY_EXCESS, /**< OTASP : A-Key excess ok*/
- TAPI_CALL_OTASP_OK_SSD_UPDATE, /**< OTASP : SSD update ok */
- TAPI_CALL_OTASP_OK_NAM_DWNLD, /**< OTASP : NAM download ok */
- TAPI_CALL_OTASP_OK_MDN_DWNLD, /**< OTASP : MDN download ok */
- TAPI_CALL_OTASP_OK_IMSI_DWNLD, /**< OTASP : IMSI download ok*/
- TAPI_CALL_OTASP_OK_PRL_DWNLD, /**< OTASP : PRL download ok */
- TAPI_CALL_OTASP_OK_COMMIT, /**< OTASP : commit ok */
- TAPI_CALL_OTASP_OK_PROGRAMMING, /**< OTASP : programming ok */
- TAPI_CALL_OTASP_SUCCESS, /**< OTASP : success */
- TAPI_CALL_OTASP_UNSUCCESS, /**< OTASP : unsuccess */
- TAPI_CALL_OTASP_OK_OTAPA_VERIFY, /**< OTASP : verify ok */
- TAPI_CALL_OTASP_PROGRESS, /**< OTASP : progress */
- TAPI_CALL_OTASP_FAILURES_EXCESS_SPC, /**< OTASP : SPC excess failure */
- TAPI_CALL_OTASP_LOCK_CODE_PW_SET, /**< OTASP : lock code password set*/
-} TelCallOtaspStatus_t;
-
-/**
- * @enum TelCallOtapaStatus_t
- * This structure contains the OTAPA Status(CDMA only).
- */
-typedef enum {
- TAPI_CALL_OTAPA_STOP = 0x00, /**< OTAPA : stop */
- TAPI_CALL_OTAPA_START, /**< OTAPA : start */
-} TelCallOtapaStatus_t;
-
-/**
- * @enum TelCallTimeMaskType_t
- * This structure contains call time request mask type.
- */
-typedef enum {
- TAPI_CALL_TIME_TYPE_TOTAL_CALL_CNT = 0x01, /**< Total Call Count Mask */
- TAPI_CALL_TIME_TYPE_TOTAL_CALL_TIME = 0x02, /**< Total Call Time Mask */
- TAPI_CALL_TIME_TYPE_LAST_CALL_TIME = 0x04, /**< Last Call Time Mask */
-} TelCallTimeMaskType_t;
-
-/**
- * @enum TelCallToneDuration_t
- * This structure contains dtmf tone length.
- */
-typedef enum {
- TAPI_CALL_TONE_DURATION_SHORT = 0x01,
- TAPI_CALL_TONE_DURATION_LONG
-} TelCallToneDuration_t;
-
-/**
- * @enum TelCallEmergencyCategory_t
- * This structure contains emergency category type
- */
-typedef enum {
- TAPI_CALL_ECC_DEFAULT = 0x00,
- TAPI_CALL_ECC_POLICE = 0x01,
- TAPI_CALL_ECC_AMBULANCE = 0x02,
- TAPI_CALL_ECC_FIREBRIGADE = 0x04,
- TAPI_CALL_ECC_MARINEGUARD = 0x08,
- TAPI_CALL_ECC_MOUNTAINRESCUE = 0x10,
- TAPI_CALL_ECC_MANUAL_ECALL = 0x20,
- TAPI_CALL_ECCY_AUTO_ECALL = 0x40
-} TelCallEmergencyCategory_t;
-
-typedef enum {
- TAPI_CALL_IDENTITY_DEFAULT, /**< Calling line identity will be sent. Based on network setting, Line identity will presented to the called party. */
- TAPI_CALL_IDENTITY_SHOW, /**< Display calling line identity */
- TAPI_CALL_IDENTITY_HIDE /**< Hide the display of Calling line identity */
-} TelCallIdentityMode_t;
-
-
-/**
- * context type
- */
-typedef enum {
- TAPI_CONTEXT_TYPE_NONE = 0x00,
- TAPI_CONTEXT_TYPE_VOICE_CALL = 0x01,
- TAPI_CONTEXT_TYPE_DATA_CALL = 0x2,
- TAPI_CONTEXT_TYPE_VIDEO_CALL = 0x3,
- TAPI_CONTEXT_TYPE_NETTEXT,
- TAPI_CONTEXT_TYPE_E911,
-} TapiContextType;
-
-
-/**
- * Timer State and or Call Timer ID
- */
-typedef enum {
- TAPI_CALL_TSTATE_IDLE = 0x00, /**< No timer running */
- TAPI_CALL_TSTATE_SETUP_PENDING, /**< Setup Timer */
- TAPI_CALL_TSTATE_CONNECT_PENDING, /**< Connected Timer */
- TAPI_CALL_TSTATE_END_PENDING, /**< Release Timer */
- TAPI_CALL_TSTATE_HOLD_PENDING, /**< Hold Timer */
- TAPI_CALL_TSTATE_RETRIEVE_PENDING, /**< Retrieve Timer */
- TAPI_CALL_TSTATE_JOIN_PENDING, /**< Join Timer */
- TAPI_CALL_TSTATE_SPLIT_PENDING, /**< Split Timer */
- TAPI_CALL_TSTATE_ECT_PENDING, /**< ECT Timer */
- TAPI_CALL_TSTATE_DTMF_PENDING, /**< DTMF Timer */
-} TelTapiCallTimerState;
-
-typedef struct {
- TS_BOOL bRequestedBySAT; /** This flag is to indicate whether the request has been initiated by SAT or not.Possible values are 0 and 1. This flag should be updated only when originating a setup request */
- TelCallIdentityMode_t IdentityMode; /**< Sets Calling Line Identity mode. If default value TAPI_IDENTITY_DEFAULT is set, OEM will set the default value. */
- TelCallEmergencyCategory_t ecc;
-} tel_set_call_satflag_identiymode;
-
-/**
- * This structure contains information about the redirect destination information.
- */
-typedef struct {
- unsigned char number[TAPI_CALL_DIAL_NUMBER_LEN_MAX + 1]; /**< Redirect destination number */
-} TelCallDeflectDstInfo_t;
-
-/**
- * This structure defines the calling name information
- */
-typedef struct {
- TelCallNameMode_t NameMode; /**< Display mode of the szNameData. */
- char szNameData[TAPI_CALLING_NAME_SIZE_MAX]; /**< Calling party name string. */
-} TelCallingNameInfo_t;
-
-/**
- * This structure contains information about an outgoing call.
- */
-typedef struct {
- TelCallType_t CallType; /**< sets type of call (voice, data, video, emergency) */
- char szNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< A string containing the destination phone number. This follows the dial number format.*/
-} TelCallDial_t;
-
-/**
- * This structure contains information about call status.
- */
-typedef struct {
- int CallHandle;
- int bMoCall; /**< Status will be yes for MO Call. If MT call, then FALSE*/
- char pNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Mobile Number */
- TelCallType_t CallType; /**< Specifies type of call (voice, data, emergency) */
- TelCallStates_t CallState; /**< Current Call state */
- int bConferenceState; /**< Whether Call is in Conference or not*/
-} TelCallStatus_t;
-
-typedef void (*TelCallStatusCallback)( TelCallStatus_t *out, void *user_data );
-
-
-/**
- * This structure contains information about call redirection details.
- */
-typedef struct {
- char szRedirectedNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Redirected party number */
- char szRedirectSubAddress[TAPI_CALL_SUBADDRESS_LEN_MAX + 1]; /**< Redirect party sub-address */
-} TelCallRedirectionInfo_t;
-
-/**
- * This structure contains the incoming call information.
- */
-typedef struct {
- unsigned int CallHandle; /**< At Foundation API Level, Call handle indicates the Handle of the Call for the Application . At Framework API Level, call handle indicates the Call identifier used for call by the OEM Adaptation Layer Plug-in */
- TelCallType_t CallType; /**< Call type */
- TelSsLineIdentificationType_t CliPresentationIndicator; /**< Calling Party presentation indicator */
- char szCallingPartyNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< caller number,null terminated ASCII */
- TelCallingNameInfo_t CallingNameInfo; /**< Call name info. If there is no information from network, this information will be NULL.*/
- TelCallRedirectionInfo_t RedirectInfo; /**< The data for the Call Redirect information. If there is no information from network, this information will be NULL. */
- TelCallSSNocliCause_t CliCause; /**< No of CLI cause */
- int fwded; /**< True or false. If Incoming call is a forwarded call, then true else false. */
- TelCallActiveLine_t ActiveLine; /**< Current Active Line */
-} TelCallIncomingCallInfo_t;
-
-/**
- *SS Info message.
- */
-typedef struct {
- TelCallMtSSInfo_t type; /* Type of the SS Info presnet. */
- TelCallSSNocliCause_t no_cli_cause;
-} TelCallMtSsInfo_t; // not used
-
-typedef struct {
- int isMobileOriginated; /* Is this call Mobile Originated? */
- TelCallNameMode_t nameMode; /* Calling Party Name availability mode */
- char callNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /* A character array of the destination address. This follows the dial callNumber format. */
- unsigned int startTime; /* Time when a call is started */
- unsigned int endTime; /* Time when a call is ended */
- TelCallType_t callType; /* Type of a call */
- TelCallStates_t callState; /* State of a call */
- TelCallActiveState_t activeState; /* Status of a call */
- TelConferenceCallState_t conferenceState; /* State of a conference call */
- TelCallingNameInfo_t callingNameInfo; /* Calling name information of a call */
- TelCallActiveLine_t current_line; /* Line information of a call */
- TelCallCause_t cause; /* End type of a call when a call is ended */
- TelTapiEndCause_t endCause; /* EndCause */
-} TelTapiCallInfo_t;
-
-/**
- * This structure contains the connected number information.
- */
-typedef struct {
- TelCallSSNocliCause_t no_cli_cause; /**< Cause when no CLI number. */
- unsigned char dcs; /**< DCS */
- unsigned char number_type; /**< Number type */
- TelCallNameMode_t name_mode; /**< Display mode of the name. */
- char number[TAPI_CALL_DIALDIGIT_LEN_MAX + 1]; /**< Caller number, null terminated ASCII */
- char sub_address[TAPI_CALL_SUBADDRESS_LEN_MAX + 1]; /**< Called sub-address, null terminated ASCII */
-} TelCallConnectedNumberInfo_t;
-
-/**
- * This structure contains the voice privacy info(CDMA only).
- */
-typedef struct {
- TelCallPrivacyType_t PrivacyType; /**< Voice Privacy Request Type */
- TelCallPrivacyMode_t PrivacyMode; /**< Voice Privacy Mode */
-} TelCallVoicePrivacyInfo_t;
-
-/**
- * This structure contains the OTA progress indication information(CDMA only).
- */
-typedef struct {
- TelCallOtaType_t OtaType; /**< OTA type */
- TelCallOtaspStatus_t OtaspStatus; /**< OTASP status : if OTA type is OTASP, it is valid */
- TelCallOtapaStatus_t OtapaStatus; /**< OTAPA status : if OTA type is OTAPA, it is valid */
-} TelCallOtaProgressInfo_t;
-
-/**
- * This structure contains information about a call time and call count.
- */
-typedef struct {
- unsigned short req_type_mask; /**< call time request type */
- unsigned long TotalCallCnt; /**< Total Call Count */
- unsigned long OutgoingCallCnt; /**< Outgoing Call Count */
- unsigned long IncomingCallCnt; /**< Incoming Call Count */
- unsigned long TotalCallTime; /**< Overall Call Time(Outgoing + Incoming, in second) */
- unsigned long OutgoingCallTime; /**< Overall Outgoing Call Time(in second) */
- unsigned long IncomingCallTime; /**< Overall Incoming Call Time(in second) */
- unsigned long LastCallTime; /**< Last Call Time(in second) */
-} TelCallTimeInfo_t;
-
-/**
- * This structure contains information about display record in CDMA.
- */
-typedef struct {
- unsigned char Record[TAPI_CALL_DISPLAY_RECORD_MAX + 1]; /**< display record */
-} TelCallDisplayRecordInfo_t;
-
-// New Struct for New API
-typedef enum {
- TAPI_SOUND_MUTE =0x00, /**<Sound is mute*/
- TAPI_SOUND_VOLUME_LEVEL_1=0x01, /**<Volume level is 1*/
- TAPI_SOUND_VOLUME_LEVEL_2=0x02, /**<Volume level is 2*/
- TAPI_SOUND_VOLUME_LEVEL_3=0x03, /**<Volume level is 3*/
- TAPI_SOUND_VOLUME_LEVEL_4=0x04, /**<Volume level is 4*/
- TAPI_SOUND_VOLUME_LEVEL_5=0x05, /**<Volume level is 5*/
- TAPI_SOUND_VOLUME_LEVEL_6=0x06, /**<Volume level is 6*/
- TAPI_SOUND_VOLUME_LEVEL_7=0x07, /**<Volume level is 7*/
- TAPI_SOUND_VOLUME_LEVEL_8=0x08, /**<Volume level is 8*/
- TAPI_SOUND_VOLUME_LEVEL_9=0x09 /**<Volume level is 9*/
-} TelSoundVolume_t;
-
-typedef enum {
- TAPI_SOUND_RECORDING_OFF,
- TAPI_SOUND_RECORDING_ON,
-
-} TelSoundRecording_t;
-
-typedef enum {
- TAPI_SOUND_DEVICE_RECEIVER = 0x00,
- TAPI_SOUND_DEVICE_SPEAKER_PHONE = 0x10,
- TAPI_SOUND_DEVICE_HFK = 0x20,
- TAPI_SOUND_DEVICE_HEADSET = 0x30,
- TAPI_SOUND_DEVICE_BLUETOOTH = 0x40,
- TAPI_SOUND_DEVICE_EC = 0xA0,
-} TelSoundDevice_t;
-
-typedef enum {
- TAPI_SOUND_TYPE_VOICE = 0x01,
- TAPI_SOUND_TYPE_KEYTONE = 0x02,
- TAPI_SOUND_TYPE_BELL = 0x03,
- TAPI_SOUND_TYPE_MESSAGE = 0x04,
- TAPI_SOUND_TYPE_ALARM = 0x05,
- TAPI_SOUND_TYPE_PDA_MISC = 0x06,
-} TelSoundType_t;
-
-
-typedef struct {
- TelSoundDevice_t device;
- TelSoundType_t type;
- TelSoundVolume_t volume;
-} TelCallVolumeInfo_t;
-
-typedef enum {
- TAPI_SOUND_PATH_HANDSET =0x01, /**<Audio path is handset*/
- TAPI_SOUND_PATH_HEADSET =0x02, /**<Audio path is handset*/
- TAPI_SOUND_PATH_HANDSFREE =0x03, /**<Audio path is Handsfree*/
- TAPI_SOUND_PATH_BLUETOOTH =0x04, /**<Audio path is bluetooth*/
- TAPI_SOUND_PATH_STEREO_BLUETOOTH =0x05, /**<Audio path is stereo bluetooth*/
- TAPI_SOUND_PATH_SPK_PHONE =0x06, /**<Audio path is speaker phone*/
- TAPI_SOUND_PATH_HEADSET_3_5PI =0x07, /**<Audio path is headset_3_5PI*/
- TAPI_SOUND_PATH_BT_NSEC_OFF =0x08,
- TAPI_SOUND_PATH_MIC1 =0x09,
- TAPI_SOUND_PATH_MIC2 =0x0A,
- TAPI_SOUND_PATH_HEADSET_HAC =0x0B,
-} TelSoundPath_t;
-
-typedef struct {
- TelSoundPath_t path;
- enum ExtraVolumeStatus {
- TAPI_SOUND_EX_VOLUME_OFF,
- TAPI_SOUND_EX_VOLUME_ON,
- } ex_volume;
-} TelCallSoundPathInfo_t;
-
-typedef enum {
- TAPI_SOUND_MUTE_STATUS_OFF,
- TAPI_SOUND_MUTE_STATUS_ON,
-} TelSoundMuteStatus_t;
-
-typedef enum {
- TAPI_SOUND_NOISE_REDUCTION_OFF,
- TAPI_SOUND_NOISE_REDUCTION_ON,
-} TelSoundNoiseReduction_t;
-
-typedef enum {
- TAPI_SOUND_EQUALIZATION_MODE_OFF,
- TAPI_SOUND_EQUALIZATION_MODE_ON,
- TAPI_SOUND_EQUALIZATION_MODE_FLAG_OFF,
- TAPI_SOUND_EQUALIZATION_MODE_FLAG_ON,
- TAPI_SOUND_EQUALIZATION_MODE_SOFT1,
- TAPI_SOUND_EQUALIZATION_MODE_SOFT2,
-} TelSoundEqualizationMode_t;
-
-typedef enum {
- TAPI_SOUND_DIRECTION_LEFT,
- TAPI_SOUND_DIRECTION_RIGHT,
-} TelSoundDirection_t;
-
-
-#define MAX_SOUND_EQ_PARAMETER_SIZE 6
-typedef struct {
- TelSoundEqualizationMode_t mode;
- TelSoundDirection_t direction;
- unsigned short parameter[MAX_SOUND_EQ_PARAMETER_SIZE];
-} TelCallSoundEqualization_t;
-
-
-
-
-typedef struct {
- unsigned int id;
-} TelCallAnswerCnf_t;
-
-typedef struct {
- TelCallEndType_t type;
- unsigned int id;
-} TelCallEndCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallHoldCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallActiveCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallSwapCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallJoinCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallSplitCnf_t;
-
-typedef struct {
- unsigned int id;
-} TelCallTransferCnf_t;
-
-typedef struct {
- unsigned int record_num;
- TelCallVolumeInfo_t record[ 20 ];
-} TelCallGetVolumeInfoResp_t;
-
-typedef struct {
- TelSoundMuteStatus_t status;
-} TelCallGetMuteStatusResp_t;
-
-
-
-
-
-
-typedef struct {
- unsigned int id;
- TelTapiEndCause_t cause; /**< End cause for the call indicates whether the call is released normally or due to other cause*/
-} TelCallStatusIdleNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusActiveNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusHeldNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusDialingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusAlertNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusIncomingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallStatusWaitingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoWaitingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoForwardedNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoBarredIncomingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoBarredOutgoingNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoForwardConditionalNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoForwardUnconditionalNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoActiveNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoHeldNoti_t;
-
-typedef struct {
- unsigned int id;
-} TelCallInfoJoinedNoti_t;
-
-typedef struct {
- TelSoundPath_t path;
-} TelCallSoundPathNoti_t;
-
-typedef enum {
- TAPI_CALL_SOUND_RINGBACK_TONE_START,
- TAPI_CALL_SOUND_RINGBACK_TONE_END,
-} TelCallSoundRingbackToneNoti_t;
-
-typedef enum {
- TAPI_CALL_SOUND_WBAMR_STATUS_OFF,
- TAPI_CALL_SOUND_WBAMR_STATUS_ON,
-} TelCallSoundWbamrNoti_t;
-
-typedef struct {
- TelSoundNoiseReduction_t status;
-} TelCallSoundNoiseReductionNoti_t;
-
-typedef struct {
- TelSoundEqualizationMode_t mode;
- TelSoundDirection_t direction;
-} TelCallSoundEqualizationNoti_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _TEL_CALL_H_
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @ingroup TelephonyAPI
- * @addtogroup COMMON_TAPI COMMON
- * @{
- *
- * @file TelDefines.h
- * @brief This file provides #defines required for Telephony server and TAPI Client Library
- */
-
-#ifndef _TEL_DEFINES_H_
-#define _TEL_DEFINES_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/* Machine independence */
-typedef long TS_INT32;
-typedef unsigned long TS_UINT32;
-
-typedef int TS_INT;
-typedef unsigned int TS_UINT;
-typedef double TS_DOUBLE;
-
-typedef int TS_BOOL;
-
-/* Programming concept */
-typedef unsigned char TS_BYTE;
-typedef unsigned short TS_WORD;
-typedef unsigned long TS_DWORD;
-typedef unsigned char TS_UINT8;
-typedef char TS_INT8;
-typedef unsigned short TS_UINT16;
-typedef unsigned long TS_ULONG;
-typedef unsigned long long TS_UINT64;
-typedef unsigned short TS_USHORT;
-
-#ifndef TRUE
-#define TRUE 1
-#endif
-
-#ifndef FALSE
-#define FALSE 0
-#endif
-
-#ifndef DEPRECATED
-#define DEPRECATED __attribute__((deprecated))
-#endif
-
-typedef int HObj;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_DEFINES_H_ */
-
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup COMMON_TAPI COMMON
- * @{
- * These error codes are used by Applications.
- */
-
-
-#ifndef _TEL_ERR_H_
-#define _TEL_ERR_H_
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/************************************************************
-** Errors defined in "+CME ERROR" ,
-** - see 3GPP TS 27.007
-** - ranges are 0x00 ~ 0x7FFF
-************************************************************/
-/**
- Error codes sent by the modem in response to the above operations.
-*/
-typedef enum
-{
- /* GENERAL ERRORS */
- TAPI_OP_GEN_ERR_PHONE_FAILURE = 0, /* 0 */
- TAPI_OP_GEN_ERR_NO_CONNECTION_TO_PHONE, /* 1 */
- TAPI_OP_GEN_ERR_PHONE_ADAPTOR_LINK_RESERVED, /* 2 */
- TAPI_OP_GEN_ERR_OPER_NOT_ALLOWED, /* 3 */
- TAPI_OP_GEN_ERR_OPER_NOT_SUPPORTED, /* 4 */
- TAPI_OP_GEN_ERR_PH_SIM_PIN_REQU, /* 5 */
- TAPI_OP_GEN_ERR_PH_FSIM_PIN_REQU, /* 6 */
- TAPI_OP_GEN_ERR_PH_FSIM_PUK_REQU, /* 7 */
- TAPI_OP_GEN_ERR_SIM_NOT_INSERTED =10, /* 10 */
- TAPI_OP_GEN_ERR_SIM_PIN_REQU, /* 11 */
- TAPI_OP_GEN_ERR_SIM_PUK_REQU, /* 12 */
- TAPI_OP_GEN_ERR_SIM_FAILURE, /* 13 */
- TAPI_OP_GEN_ERR_SIM_BUSY, /* 14 */
- TAPI_OP_GEN_ERR_SIM_WRONG, /* 15 */
- TAPI_OP_GEN_ERR_INCORRECT_PW, /* 16 */
- TAPI_OP_GEN_ERR_SIM_PIN2_REQU, /* 17 */
- TAPI_OP_GEN_ERR_SIM_PUK2_REQU, /* 18 */
- TAPI_OP_GEN_ERR_MEM_FULL = 20, /* 20 */
- TAPI_OP_GEN_ERR_INVALID_INDEX, /* 21 */
- TAPI_OP_GEN_ERR_NOT_FOUND, /* 22 */
- TAPI_OP_GEN_ERR_MEM_FAILURE, /* 23 */
- TAPI_OP_GEN_ERR_TEXT_STR_TOO_LONG, /* 24 */
- TAPI_OP_GEN_ERR_INVALID_CHARACTERS_IN_TEXT_STR, /* 25 */
- TAPI_OP_GEN_ERR_DIAL_STR_TOO_LONG, /* 26 */
- TAPI_OP_GEN_ERR_INVALID_CHARACTERS_IN_DIAL_STR, /* 27 */
- TAPI_OP_GEN_ERR_NO_NET_SVC = 30, /* 30 */
- TAPI_OP_GEN_ERR_NET_TIMEOUT, /* 31 */
- TAPI_OP_GEN_ERR_NET_NOT_ALLOWED_EMERGENCY_CALLS_ONLY, /* 32 */
- TAPI_OP_GEN_ERR_NET_PERS_PIN_REQU = 40, /* 40 */
- TAPI_OP_GEN_ERR_NET_PERS_PUK_REQU, /* 41 */
- TAPI_OP_GEN_ERR_NET_SUBSET_PERS_PIN_REQU, /* 42 */
- TAPI_OP_GEN_ERR_NET_SUBSET_PERS_PUK_REQU, /* 43 */
- TAPI_OP_GEN_ERR_SVC_PROVIDER_PERS_PIN_REQU, /* 44 */
- TAPI_OP_GEN_ERR_SVC_PROVIDER_PERS_PUK_REQU, /* 45 */
- TAPI_OP_GEN_ERR_CORPORATE_PERS_PIN_REQU, /* 46 */
- TAPI_OP_GEN_ERR_CORPORATE_PERS_PUK_REQU, /* 47 */
- TAPI_OP_GEN_ERR_HIDDEN_KEY_REQU, /* 48 */
- TAPI_OP_GEN_ERR_UNKNOWN = 100, /* 100 */
-
- /* Errors related to a failure to perform an Attach */
- TAPI_OP_GEN_ERR_ILLEGAL_MS = 103, /* 103 */
- TAPI_OP_GEN_ERR_ILLEGAL_ME = 106, /* 106 */
- TAPI_OP_GEN_ERR_GPRS_SVC_NOT_ALLOWED, /* 107 */
- TAPI_OP_GEN_ERR_PLMN_NOT_ALLOWED = 111, /* 111 */
- TAPI_OP_GEN_ERR_LOCATION_AREA_NOT_ALLOWED, /* 112 */
- TAPI_OP_GEN_ERR_ROAMING_NOT_ALLOWED_IN_THIS_LOCATION_AREA,/* 113 */
-
- /* Errors related to a failure to Activate a Context */
- TAPI_OP_GEN_ERR_SVC_OPT_NOT_SUPPORTED = 132, /* 132 */
- TAPI_OP_GEN_ERR_REQ_SVC_OPT_NOT_SUBSCRIBED, /* 133 */
- TAPI_OP_GEN_ERR_SVC_OPT_TEMPORARILY_OUT_OF_ORDER, /* 134 */
- TAPI_OP_GEN_ERR_UNSPECIFIED_GPRS_ERR = 148, /* 148 */
- TAPI_OP_GEN_ERR_PDP_AUTHENTICATION_FAILURE, /* 149 */
- TAPI_OP_GEN_ERR_INVALID_MOBILE_CLASS, /* 150 */
-
- /* VBS / VGCS and eMLPP -related errors */
- TAPI_OP_GEN_ERR_VBS_VGCS_NOT_SUPPORTED_BY_THE_NET = 151, /* 151 */
- TAPI_OP_GEN_ERR_NO_SVC_SUBSCRIPTION_ON_SIM, /* 152 */
- TAPI_OP_GEN_ERR_NO_SUBSCRIPTION_FOR_GROUP_ID, /* 153 */
- TAPI_OP_GEN_ERR_GROUP_ID_NOT_ACTIVATED_ON_SIM, /* 154 */
- TAPI_OP_GEN_ERR_NO_MATCHING_NOTI = 155, /* 155 */
- TAPI_OP_GEN_ERR_VBS_VGCS_CALL_ALREADY_PRESENT, /* 156 */
- TAPI_OP_GEN_ERR_CONGESTION, /* 157 */
- TAPI_OP_GEN_ERR_NET_FAILURE, /* 158 */
- TAPI_OP_GEN_ERR_UPLINK_BUSY, /* 159 */
- TAPI_OP_GEN_ERR_NO_ACCESS_RIGHTS_FOR_SIM_FILE = 160, /* 160 */
- TAPI_OP_GEN_ERR_NO_SUBSCRIPTION_FOR_PRIORITY, /* 161 */
- TAPI_OP_GEN_ERR_OPER_NOT_APPLICABLE_OR_NOT_POSSIBLE, /* 162 */
-
-
- TAPI_OP_GEN_ERR_NONE = 0x8000, /* 0x8000 : No Errors */
-
- /* General Common Errors : 0x8000 - 0x80FF */
- TAPI_OP_GEN_ERR_INVALID_IPC, /* 0x8001 : Invalid IPC_GSM Parameter or Format */
- TAPI_OP_GEN_ERR_PHONE_OFFLINE, /* 0x8002 : */
- TAPI_OP_GEN_ERR_CMD_NOT_ALLOWED, /* 0x8003 : */
- TAPI_OP_GEN_ERR_PHONE_IS_INUSE, /* 0x8004 : */
- TAPI_OP_GEN_ERR_INVALID_STATE = 0x8005, /* 0x8005 : */
-
- TAPI_OP_GEN_ERR_NO_BUFFER, /* 0x8006 : No internal free buffers */
- TAPI_OP_GEN_ERR_OPER_REJ, /* 0x8007 : Operation Rejected */
- TAPI_OP_GEN_ERR_INSUFFICIENT_RESOURCE, /* 0x8008 : insufficient resource */
- TAPI_OP_GEN_ERR_NET_NOT_RESPOND, /* 0x8009 : Network not responding */
- TAPI_OP_GEN_ERR_SIM_PIN_ENABLE_REQ = 0x800A, /* 0x800A : SIM Pin Enable Required */
- TAPI_OP_GEN_ERR_SIM_PERM_BLOCKED, /* 0x800B : SIM Permanent Blocked */
- TAPI_OP_GEN_ERR_SIM_PHONEBOOK_RESTRICTED, /*0x800C: SIM Phonebook Restricted*/
- TAPI_OP_GEM_ERR_FIXED_DIALING_NUMBER_ONLY, /*0x800D: Restricted By FDN Mode */
-
- /* Reserved : 0x800E ~ 0x80FF */
- TAPI_OP_GEN_ERR_800E_RESERVED_START = 0x800E, /* 0x800E */
-
- TAPI_OP_GEN_ERR_80FF_RESERVED_END = 0x80ff, /* 0x80FF */
-
- /* the other errors */
- TAPI_OP_GEN_ERR_OTHERS = 0xFFFE, /* 0xFFFE */
-
- TAPI_OP_GEN_ERR_MAX = 0xFFFF
-
-}tapi_phone_err_t;
-
-typedef enum {
- TAPI_PDP_FAILURE_CAUSE_NORMAL = 0x00, // 0x00 : Normal Process ( no problem )
- TAPI_PDP_FAILURE_CAUSE_REL_BY_USER = 0x01, // Call Released by User
- TAPI_PDP_FAILURE_CAUSE_REGULAR_DEACTIVATION = 0x02, // Regular de-activation
- TAPI_PDP_FAILURE_CAUSE_LLC_SNDCP = 0x03, // LLC SNDCP failure
- TAPI_PDP_FAILURE_CAUSE_INSUFFICIENT_RESOURCE = 0x04, // Insufficient resources
- TAPI_PDP_FAILURE_CAUSE_UNKNOWN_APN = 0x05, // Missing or unknown APN
- TAPI_PDP_FAILURE_CAUSE_UNKNOWN_PDP_ADDRESS = 0x06, // Unknown PDP address or type
- TAPI_PDP_FAILURE_CAUSE_USER_AUTH_FAILED = 0x07, // Unknown PDP address or type
- TAPI_PDP_FAILURE_CAUSE_ACT_REJ_GGSN = 0x08, // Unknown PDP address or type
- TAPI_PDP_FAILURE_CAUSE_ACT_REJ_UNSPECIFIED = 0x09, // Unknown PDP address or type
- TAPI_PDP_FAILURE_CAUSE_SVC_OPTION_NOT_SUPPORTED = 0x0A, // Service option not supported
- TAPI_PDP_FAILURE_CAUSE_SVC_NOT_SUBSCRIBED = 0x0B, // Requested service option not subscribed
- TAPI_PDP_FAILURE_CAUSE_SVC_OPT_OUT_ORDER = 0x0C, // Service out of order
- TAPI_PDP_FAILURE_CAUSE_NSAPI_USED = 0x0D, // NSAPI already used
- TAPI_PDP_FAILURE_CAUSE_QOS_NOT_ACCEPTED = 0x0E, // QoS not accepted
- TAPI_PDP_FAILURE_CAUSE_NETWORK_FAILURE = 0x0F, // Network Failure
- TAPI_PDP_FAILURE_CAUSE_REACT_REQUIRED = 0x10, // Reactivation Required
- TAPI_PDP_FAILURE_CAUSE_FEATURE_NOT_SUPPORTED = 0x11, // Feature not supported
- TAPI_PDP_FAILURE_CAUSE_TFT_FILTER_ERROR = 0x12, // TFT or filter error
- TAPI_PDP_FAILURE_CAUSE_UNKOWN_PDP_CONTEXT = 0x13, // Unknown PDP context
- TAPI_PDP_FAILURE_CAUSE_INVALID_MSG = 0x14, // Invalid MSG
- TAPI_PDP_FAILURE_CAUSE_PROTOCOL_ERROR = 0x15, // Protocol error
- TAPI_PDP_FAILURE_CAUSE_MOBILE_FAILURE_ERROR = 0x16, // Mobile failure error
- TAPI_PDP_FAILURE_CAUSE_TIMEOUT_ERROR = 0x17, // Timeout error
- TAPI_PDP_FAILURE_CAUSE_UNKNOWN_ERROR = 0x18, // Unknown error
- TAPI_PDP_FAILURE_CAUSE_MAX ,
-} tapi_pdp_err_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _TEL_ERR_H_
-
-/**
-* @}
-*/
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @open
-* @ingroup TelephonyAPI
-* @addtogroup SAT_TAPI SAT
-* @{
-*
-* @file TelSat.h
-
- @brief This file serves as a "C" header file defines structures for Telephony SAT Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
-
-
- */
-
-#ifndef _TEL_SAT_H_
-#define _TEL_SAT_H_
-
-#include <TelDefines.h>
-#include <TelCall.h>
-#include <TelSs.h>
-#include <TelSatObj.h>
-#include <TelSatProactvCmd.h>
-#include <TelSatEnvelope.h>
-#include <TelSim.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define TAPI_SAT_DEF_TITLE_LEN_MAX 50 /**< max length for Menu Title */
-#define TAPI_SAT_DEF_ITEM_STR_LEN_MAX 50 /**< max length for Menu Item */
-#define TAPI_SAT_DEF_TEXT_STRING_LEN_MAX 500 /**< max length for Text String */
-#define TAPI_SAT_DEF_BIT_MASK_CONTACT 0x01 /**< Bit Mask for Contact */
-#define TAPI_SAT_DEF_BIT_MASK_MSG 0x02 /**< Bit Mask for Msg */
-#define TAPI_SAT_DEF_BIT_MASK_OTHER 0x04 /**< Bit Mask for Psh */
-#define TAPI_SAT_REFRESH_FILE_LIST 20 /**< Refresh File List*/
-#define TAPI_SAT_DEF_SS_LEN_MAX 250
-#define TAPI_SAT_DEF_USSD_LEN_MAX 250
-
-// Telephony UI USER CONFIRM TYPE
-/**
- * @enum TelSatUiUserConfirmType_t
- * This enumeration defines the UI User Confirm Type.
- */
-typedef enum
-{
- TAPI_SAT_USER_CONFIRM_YES, /**<This Enum Informs That user confirms yes */
- TAPI_SAT_USER_CONFIRM_NO_OR_CANCEL, /**<This enum informs that user confirms no/cancel */
- TAPI_SAT_USER_CONFIRM_HELP_INFO, /**<This enum informs that user wants help information */
- TAPI_SAT_USER_CONFIRM_END, /**<This enum informs that user confirms end */
- TAPI_SAT_USER_CONFIRM_TIMEOUT, /**<This enum informs that user did not respond */
-}TelSatUiUserConfirmType_t;
-
-// Telephony UI INKEY TYPE
-/**
- * @enum TelSatUiInkeyYesNoCaseType_t
- * This enumeration defines the UI Inkey Type Yes or No.
- */
-typedef enum
-{
- TAPI_SAT_INKEY_CONFIRM_NO = 0x00, /**<No*/
- TAPI_SAT_INKEY_CONFIRM_YES = 0x01, /**<Yes*/
-}TelSatUiInkeyYesNoCaseType_t;
-
-// Telephony UI DISPLAY STATUS
-/**
- * @enum TelSatUiDisplayStatusType_t
- * This enumeration defines the UI Display Status.
- */
-typedef enum
-{
- TAPI_SAT_DISPLAY_SUCCESS = 0x00, /**<This enum informs UI display success*/
- TAPI_SAT_DISPLAY_FAIL = 0x01, /**<This enum informs UI display failure*/
-}TelSatUiDisplayStatusType_t;
-
-// TELEPHONY REFRESH APPLICATION TYPE
-/**
- * @enum TelSatRefreshAppType_t
- * This enumeration defines the Refresh Application Type.
- */
- typedef enum
-{
- TAPI_SAT_REFRESH_CONTACT = 0x00, /**<refresh application type - Phonebook*/
- TAPI_SAT_REFRESH_MSG, /**<refresh application type - SMS*/
- TAPI_SAT_REFRESH_OTHER, /**<refresh application type - other*/
- TAPI_SAT_REFRESH_MAX, /**<Maximum Enumeration Value*/
-}TelSatRefreshAppType_t;
-
-// Telephony COMMAND PERFORMED RESULT
-/**
- * @enum TelSatCommandPerformResultType_t
- * This enumeration defines the Result of Proactive Command execution.
- */
-typedef enum
-{
- TAPI_SAT_CMD_PERFORM_SUCCESS = 0x00, /**<command performed successfully*/
- TAPI_SAT_CMD_PERFORM_FAIL, /**<command execution failed*/
- TAPI_SAT_CMD_PERFORM_MAX, /**<Maximum Enumeration Value*/
-}TelSatCommandPerformResultType_t;
-
-// Telephony CALL CONTROL TYPE
-/**
- * @enum TelSatCallCtrlType_t
- * This enumeration defines Call Control Type.
- */
-typedef enum
-{
- TAPI_SAT_CALL_CNF_NONE = 0x00, /**<call control confirm type - None*/
- TAPI_SAT_CALL_CNF_CALL, /**<call control confirm type - call*/
- TAPI_SAT_CALL_CNF_SS, /**<call control confirm type - ss*/
- TAPI_SAT_CALL_CNF_USSD, /**<call control confirm type - ussd*/
- TAPI_SAT_CALL_CNF_MAX, /**<Maximum Enumeration Value*/
-}TelSatCallCtrlType_t;
-
-// SAT UI USER CONFIRMATION INFO
-/**
- * This structure defines the user confirmation data.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatCommandType_t commandType; /**<Proactive Command Type*/
- TelSatUiUserConfirmType_t keyType; /**<User Response Type*/
- unsigned char* pAdditionalData; /**<Additional Data*/
- int dataLen; /**<Additional Data Length*/
-}TelSatUiUserConfirmInfo_t;
-
-// Telephony TEXT INFO
-/**
- * This structure defines the character data for sat engine data structure.
- */
-typedef struct
-{
- unsigned short stringLen; /**<character data length*/
- unsigned char string[TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1]; /**<character data*/
-}TelSatTextInfo_t;
-
-// Telephony MAIN MENU TITLE INFO
-/**
- * This structure defines the main menu title to check sat menu.
- */
-typedef struct
-{
- int bIsMainMenuPresent; /**<flag to check sat main menu existence*/
- TelSatTextInfo_t mainMenuTitle; /**<main menu title data*/
-}TelSatMainMenuTitleInfo_t;
-
-// Telephony DISPLAY TEXT DATA
-/**
- * This structure defines the display text proactive command for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- unsigned int duration; /**<the duration of display */
- int bIsPriorityHigh; /**<indicates whether the text is to be displayed if some other app is using the screen.*/
- int bIsUserRespRequired; /**<indicates whether user response required or Not*/
- int b_immediately_resp;
- TelSatIconIdentifierInfo_t iconId; /**< Icon Identifier */
-}TelSatDisplayTextInd_t;
-
-// Telephony INKEY DATA
-/**
- * This structure defines the get inkey proactive command data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatInkeyType_t keyType; /**<input Type:Character Set or Yes/No*/
- TelSatUseInputAlphabetType_t inputCharMode; /**<input character mode(SMS default, UCS2)*/
- int bIsNumeric; /**<is input character numeric(0-9, *, # and +)*/
- int bIsHelpInfoAvailable; /**<help info request flag*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- unsigned int duration; /**<the duration of display*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
-}TelSatGetInkeyInd_t;
-
-// Telephony GET INPUT DATA
-/**
- * This structure defines the get input proactive command data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatUseInputAlphabetType_t inputCharMode; /**<input character mode(SMS default, UCS2)*/
- int bIsNumeric; /**<is input character numeric(0-9, *, # and +)*/
- int bIsHelpInfoAvailable; /**<flag for help info request */
- int bIsEchoInput; /**<indicates whether to show input data on screen or not*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- TelSatRespLenInfo_t respLen; /**<input data min, max length*/
- TelSatTextInfo_t defaultText; /**<default input character data*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
-}TelSatGetInputInd_t;
-
-// Telephony PLAY TONE DATA
-/**
- * This structure defines the play tone proactive command data for application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- TelSatToneInfo_t tone; /**<tone info */
- unsigned int duration; /**<the duration for playing tone*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
-}TelSatPlayToneInd_t;
-
-// Telephony UI info
-/**
- * This structure defines the data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int user_confirm;
- TelSatTextInfo_t text; /**<character data to display on screen*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
-}TelSatSendUiInfo_t;
-
-// Telephony MENU ITEM DATA FOR SETUP MENU
-/**
- * This structure defines the menu item info for setup menu.
- */
-typedef struct
-{
- char itemString[TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6]; /**<menu item character data*/
- char itemId; /**<identifies the item on the menu that user selected*/
-}TelSatMenuInfo_t;
-
-// Telephony SETUP MENU INFO
-/**
- * This structure defines the sat main menu info.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bIsMainMenuPresent;
- char satMainTitle[TAPI_SAT_DEF_TITLE_LEN_MAX + 1]; /**<menu title text*/
- TelSatMenuInfo_t satMainMenuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu items*/
- unsigned short satMainMenuNum; /**<number of menu items*/
- int bIsSatMainMenuHelpInfo; /**<flag for help information request */
- int bIsUpdatedSatMainMenu;
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
- TelSatIconIdentifierListInfo_t iconIdList; /**<List of Icon Identifiers*/
-}TelSatSetupMenuInfo_t;
-
-// Telephony SELECT ITEM DATA
-/**
- * This structure defines the select item proactive command data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bIsHelpInfoAvailable; /**<flag for help information request*/
- TelSatTextInfo_t text; /**<menu title text*/
- char defaultItemIndex; /**<selected default item - default value is 0*/
- char menuItemCount; /**<number of menu items*/
- TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**<menu items*/
- TelSatIconIdentifierInfo_t iconId; /**<Icon Identifier*/
- TelSatIconIdentifierListInfo_t iconIdList; /**<List of Icon Identifiers*/
-
-}TelSatSelectItemInd_t;
-
-// Telephony IDLE MODE TEXT DATA
-/**
- * This structure defines the setup idle mode text proactive command for idle application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatTextInfo_t text; /**<character data to display on screen*/
- TelSatIconIdentifierInfo_t iconId;
-} TelSatSetupIdleModeTextInd_t;
-
-// Telephony REFRESH DATA
-/**
- * This structure defines the refresh proactive command data for sat ui.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- unsigned int duration; /**<the duration of display*/
- TelSatCmdQualiRefresh_t refreshType; /**<refresh mode*/
-}TelSatRefreshIndUiInfo_t;
-
-// Telephony REFRESH DATA
-/**
- * This structure defines the refresh proactive command data for applications which are concerned with files resident on USIM .
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatRefreshAppType_t appType; /**<concerned application type */
- TelSatCmdQualiRefresh_t refreshMode; /**<refresh mode*/
- unsigned char fileCount; /**<refresh file count*/
- TelSimFileID_t fileId[TAPI_SAT_REFRESH_FILE_LIST]; /**<refresh file identifier*/
-}TelSatRefreshInd_t;
-
-// Telephony END PROACTIVE COMMAND INFO
-/**
- * This structure defines the data objects to indicate to sat ui, the end of execution of a specific proactive command by other application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- char commandType; /**< Command Type*/
- TelSatCommandPerformResultType_t result; /**<result of command execution by application*/
-}TelSatProactiveCmdEndIndInfo_t;
-
-// Telephony SEND SMS DATA
-/**
- * This structure defines the send sms proactive command data for sms application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bIsPackingRequired; /**<flag to check if packing required for sms tpdu*/
- TelSatAddressInfo_t address; /**<destination address*/
- TelSatSmsTpduInfo_t smsTpdu; /**<SMS TPDU data*/
-} TelSatSendSmsIndSmsData_t;
-
-// Telephony SEND SS DATA
-/**
- * This structure defines the send ss proactive command data for ss application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- unsigned short ssStringLen;
- unsigned char ssString[TAPI_SAT_DEF_SS_LEN_MAX+1];
-}TelSatSendSsIndSsData_t;
-
-// Telephony USSD DATA
-/**
- * This structure defines the send ussd proactive command data for ussd application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- unsigned char rawDcs; /**<data coding scheme*/
- unsigned short ussdStringLen;
- unsigned char ussdString[TAPI_SAT_DEF_USSD_LEN_MAX+1];
-}TelSatSendUssdIndUssdData_t;
-
-// Telephony SEND DTMF DATA
-/**
- * This structure defines the send dtmf proactive command data for dtmf application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bIsHiddenMode; /**<hidden mode flag*/
- TelSatTextInfo_t dtmfString; /**<dtmf string data*/
-}TelSatSendDtmfIndDtmfData_t;
-
-// Telephony SETUP CALL DATA
-/**
- * This structure defines the setup call proactive command data for call application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatCmdQualiSetupCall_t calltype; /**<call type*/
- TelSatTextInfo_t dispText; /**<display data for calling*/
- TelSatTextInfo_t callNumber; /**<call number*/
- unsigned int duration; /**<maximum repeat duration*/
- TelSatIconIdentifierInfo_t iconId; /**<icon identifier for call application*/
-}TelSatSetupCallIndCallData_t;
-
-// Telephony LAUNCH BROWSER DATA
-/**
- * This structure defines the launch browser proactive command data for browser application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatUrlInfo_t url; /**<url to connect*/
- TelSatCmdQualiLaunchBrowser_t launchType; /**<launch type*/
- TelSatBrowserIdentityType_t IdentityType; /**<Browser Identity -default, html, etc*/
-}TelSatLaunchBrowserIndBrowserData_t;
-
-// Telephony PROVIDE LOCAL INFO DATA
-/**
- * This structure defines the provide local info proactive command data for application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- TelSatCmdQualiProvideLocalInfo_t localInfoType; /**<Provide Local Information Type*/
-}TelSatProvideLocalInfoInd_t;
-
-// Telephony LANGUAGE NOTIFICATION DATA
-/**
- * This structure defines the language notification proactive command data for application.
- */
-typedef struct
-{
- int commandId; /**<Proactive Command Number sent by USIM*/
- int bSpecificLanguageNotification; /**<flag for checking specific language notification. if FALSE, non-specific language notification */
- TelSatLanguageInfo_t language; /**<language info from USIM application */
-}TelSatLanguageNotiInfoInd_t;
-
-// Telephony PLAY TONE RETURN INFO
-/**
- * This structure defines the return result data for Play Tone proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatSetupMenuRetInfo_t;
-
-// Telephony REFRESH RETURN INFO
-/**
- * This structure defines the return result data for refresh proactive command.
- */
-typedef struct
-{
- TelSatRefreshAppType_t appType; /**<application type*/
- TelSatResultType_t resp; /**<result response value*/
-}TelSatRefreshRetInfo_t;
-
-// Telephony CALL RETURN INFO
-/**
- * This structure defines the return result data for setup call proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- int bIsTapiCauseExist; /**<flag for checking tapi error cause */
- TelCallCause_t tapiCause; /**<tapi call error cause*/
- TelSsCause_t ssCause; /**<tapi ss error cause*/
- TelSatMeProblemType_t meProblem; /**<me problem error cause*/
- int bIsOtherInfoExist; /**<call control result existence flag*/
- TelSatCallCtrlProblemType_t permanentCallCtrlProblem; /**<call control problem type*/
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<call control request data*/
- TelSatResultInfo_t result2; /**<call control envelope result value*/
- TelSatTextTypeInfo_t text; /**<call control envelope display data*/
-}TelSatCallRetInfo_t;
-
-// Telephony SS RETURN INFO
-/**
- * This structure defines the return result data for send ss proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- TelSsCause_t ssCause; /**<error - ss cause*/
- TelSatTextInfo_t ssString; /**<ss result string*/
- TelSatMeProblemType_t meProblem; /**<error - me problem*/
- int bIsOtherInfoExist; /**<call control result exist flag*/
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**<call control problem*/
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<call control request data*/
- TelSatResultInfo_t result2; /**<call control envelope result value*/
-}TelSatSsRetInfo_t;
-
-// Telephony USSD RETURN INFO
-/**
- * This structure defines the return result data for send ussd proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- TelSsCause_t ssCause; /**<error - ss cause*/
- TelSatTextInfo_t ussdString; /**<ussd result string*/
- TelSatDataCodingSchemeInfo_t dcsUssdString; /**<dcs of ussd result string */
- TelSatMeProblemType_t meProblem; /**<error - me problem*/
- int bIsOtherInfoExist; /**<call control result exist flag*/
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**<call control problem*/
- int bCallCtrlHasModification; /**<call control request modification flag*/
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**<call control request data*/
- TelSatResultInfo_t result2; /**<call control envelope result value*/
- TelSatTextTypeInfo_t text2; /**<cc envelope display data */
-}TelSatUssdRetInfo_t;
-
-// Telephony SMS RETURN INFO
-/**
- * This structure defines the return result data for send sms proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatSmsRetInfo_t;
-
-// Telephony DTMF RETUEN INFO
-/**
- * This structure defines the return result data for send dtmf proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatDtmfRetInfo_t;
-
-// Telephony BROWSER RETURN INFO
-/**
- * This structure defines the return result data for launch browser proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- TelSatLaunchBrowserProblemType_t browserProblem; /**<specific browser problem*/
-}TelSatBrowserRetInfo_t;
-
-// Telephony SETUP IDLE MODE TEXT RETURN INFO
-/**
- * This structure defines the return result data for setup idle mode text proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatIdleTextRetInfo_t;
-
-// Telephony PLAY TONE RETURN INFO
-/**
- * This structure defines the return result data for Play Tone proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
-}TelSatPlayToneRetInfo_t;
-
-// Telephony PROVIDE LOCAL INFO RETURN INFO
-/**
- * This structure defines the return result data for setup idle mode text proactive command.
- */
-typedef struct
-{
- TelSatResultType_t resp; /**<result response value*/
- int bOtherInfo; /**<flag to check whether other information are required or not */
- TelSatCmdQualiProvideLocalInfo_t infoType; /**<local info type - e.g. time zone or language info, etc */
- union
- {
- TelSatDataTimeZoneInfo_t timeZoneInfo; /**< current time zone info */
- TelSatLanguageInfo_t languageInfo; /**< current ME language setting info */
- }u; /**< Union*/
-}TelSatProvideLocalRetInfo_t;
-
-// Telephony LANGUAGE NOTI RETURN INFO
-/**
- * This structure defines the return result data for setup idle mode text proactive command.
- */
-typedef struct
- {
- TelSatResultType_t resp; /**<result response value*/
- }TelSatLanguageNotiRetInfo_t;
-
-// Telephony DISPLAY TEXT RETURN INFO
-/**
- * This structure defines the return result data for setup idle mode text proactive command.
- */
-typedef struct
- {
- TelSatResultType_t resp; /**<result response value*/
- TelSatMeProblemType_t meProblem; /**<Me Problem Type */
- }TelSatDiplayTextRetInfo_t;
-
-// Telephony APPLICATIONS RETURN DATA
-/**
- * This structure defines the common return result data for applications proactive command.
- */
-typedef struct
-{
- TelSatCommandType_t commandType; /**<Proactive Command type*/
- int commandId; /**<Proactive Command Number sent by USIM*/
- union
- {
- TelSatSetupMenuRetInfo_t setupMenu; /**<result response value for setup menu*/
- TelSatRefreshRetInfo_t refresh; /**<result response value for refresh*/
- TelSatCallRetInfo_t setupCall; /**<result response value for setup call*/
- TelSatSsRetInfo_t sendSs; /**<result response value for send ss*/
- TelSatUssdRetInfo_t sendUssd; /**<result response value for send ussd*/
- TelSatSmsRetInfo_t sendSms; /**<result response value for send sms*/
- TelSatDtmfRetInfo_t sendDtmf; /**<result response value for send dtmf*/
- TelSatBrowserRetInfo_t launchBrowser; /**<result response value for launch browser*/
- TelSatIdleTextRetInfo_t setupIdleModeText; /**<result response value for setup idle mode text*/
- TelSatLanguageNotiRetInfo_t languageNoti; /**<result response value for language notification*/
- TelSatProvideLocalRetInfo_t provideLocalInfo; /**<result response value for provide local info*/
- TelSatDiplayTextRetInfo_t displayText; /**<result response value for dsiplay text*/
- TelSatPlayToneRetInfo_t playTone; /**<result response value for play tone*/
- }appsRet; /**< common union result value */
-}TelSatAppsRetInfo_t;
-
-// Telephony CALL CONTROL CONFIRM DATA FOR CALL
-/**
- * This structure defines the call control confirm data for call.
- */
-typedef struct
-{
- TelSatTextInfo_t address; /**< call destination address*/
- TelSatTextInfo_t subAddress; /**< call SUB address*/
- TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator*/
- TelSatTextInfo_t ccp1; /**< Configuration Capability Parameter 1*/
- TelSatTextInfo_t ccp2; /**< Configuration Capability Parameter 2*/
-} TelSatCallCtrlIndCallData_t;
-
-// Telephony CALL CONTROL CONFIRM DATA FOR SS
-/**
- * This structure defines the call control confirm data for ss.
- */
-typedef struct
-{
- TelSatTextInfo_t ssString; /**< ss destination address*/
- TelSatTextInfo_t subAddress; /**< call SUB address*/
- TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator*/
- TelSatTextInfo_t ccp1; /**< Configuration Capability Parameter 1*/
- TelSatTextInfo_t ccp2; /**< Configuration Capability Parameter 2*/
-} TelSatCallCtrlIndSsData_t;
-
-// Telephony CALL CONTROL CONFIRM DATA FOR USSD
-/**
- * This structure defines the call control confirm data for ussd.
- */
-typedef struct
-{
- TelSatTextInfo_t ussdString; /**< ussd destination address*/
-} TelSatCallCtrlIndUssdData_t;
-
-// Telephony READ FILE REQUEST DATA
-/**
- * This structure defines the common call control confirm data.
- */
-typedef struct
-{
- TelSatCallType_t callCtrlCnfType; /**<call control confirm type - call, ss or ussd*/
- TelSatCallCtrlResultType_t callCtrlResult; /**<call control result*/
- TelSatTextInfo_t dispData; /**<call control display data*/
- int bIsUserInfoDisplayEnabled; /**<flag for checking existence of call control display */
-
- union
- {
- TelSatCallCtrlIndCallData_t callCtrlCnfCallData; /**<call control call address*/
- TelSatCallCtrlIndSsData_t callCtrlCnfSsData; /**<call control ss string*/
- TelSatCallCtrlIndUssdData_t callCtrlCnfUssdData; /**<call control ussd string*/
- }u; /**< Union*/
-} TelSatCallCtrlIndData_t;
-
-// Telephony MO SMS CONTROL CONFIRMATION DATA
-/**
- * This structure defines the mo sms control confirm data.
- */
-typedef struct
-{
- TelSatCallCtrlResultType_t moSmsCtrlResult; /**<envelope result*/
- int bIsUserInfoDisplayEnabled; /**<display present flag*/
- TelSatTextTypeInfo_t dispData; /**<display data for sending SMS*/
- TelSatTextTypeInfo_t rpDestAddr; /**<the RP_Destination_Address of the Service Center */
- TelSatTextTypeInfo_t tpDestAddr; /**<the TP_Destination_Address */
-} TelSatMoSmCtrlIndData_t;
-
-// Telephony EVENT LIST INFO
-/**
- * This structure defines the Event List Info.
- */
-typedef struct
-{
- int bIsEventDownloadActive; /**<Is Event Download Active*/
- int bIsMtCallEvent; /**<Is Mt Call Event*/
- int bIsCallConnected; /**<Is Call Connected*/
- int bIsCallDisconnected; /**<Is Call Disconnected*/
- int bIsLocationStatus; /**<Is Location Status*/
- int bIsUserActivity; /**<Is User Activity*/
- int bIsIdleScreenAvailable; /**<Is Idle Screen Available*/
- int bIsCardReaderStatus; /**<Is Card Reader Status*/
- int bIsLanguageSelection; /**<Is Language Selection*/
- int bIsBrowserTermination; /**<Is Browser Termination*/
- int bIsDataAvailable; /**<Is Data Available*/
- int bIsChannelStatus; /**<Is Channel Status*/
-} TelSatEventListData_t;
-
-/**
- * This is the structure to be used by the Application to send envelope/event download data.
- * This contains the data structures to be used to send any envelope/event download data.
- */
-typedef struct
-{
- TelSatEventDownloadType_t eventDownloadType; /**< eventDownload Type */
-
- union
- {
- int bIdleScreenAvailable; /**<flag to specify whether Idle Screen is Available or not*/
- TelSatLanguageSelectionEventReqInfo_t languageSelectionEventReqInfo; /**<Selected Language Information*/
- TelSatBrowserTerminationEventReqInfo_t browserTerminationEventReqInfo; /**<BrowserTermination Event Information */
- TelSatDataAvailableEventReqInfo_t dataAvailableEventReqInfo; /**<dataAvailableEventReqInfo */
- TelSatChannelStatusEventReqInfo_t channelStatusEventReqInfo; /**<channelStatusEventReqInfo */
- } u; /**<Union*/
-} TelSatEventDownloadReqInfo_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_SAT_H_ */
-
-/**
-* @}
-*/
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
-* @open
-* @ingroup TelephonyAPI
-* @addtogroup SAT_TAPI SAT
-* @{
-*
-* @file TelSatEnvelope.h
-
- @brief This file serves as a "C" header file defines structures for Tapi Sat envelope command Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_SAT_ENVELOPE_H_
-#define _TEL_SAT_ENVELOPE_H_
-
-#include <TelSatObj.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/**
- * @enum TelSatCallType_t
- * This enum indicates the SAT call type
- */
-typedef enum
-{
- TAPI_SAT_CALL_TYPE_MO_VOICE = 0X00, /**< call type - mo voice */
- TAPI_SAT_CALL_TYPE_MO_SMS, /**< call type - mo sms */
- TAPI_SAT_CALL_TYPE_SS, /**< call type - ss */
- TAPI_SAT_CALL_TYPE_USSD, /**< call type - ussd */
- TAPI_SAT_PDP_CNTXT_ACT, /**< call type - pdp context action */
- TAPI_SAT_CALL_TYPE_MAX /**< call type - max */
-}TelSatCallType_t;
-
-/**
- * @enum TelSatCallCtrlResultType_t
- * This enum indicates the result of call control by SIM.
- */
-typedef enum
-{
- TAPI_SAT_CALL_CTRL_R_ALLOWED_NO_MOD = 0, /**< call control result type - ALLOWED WITH NO MOD */
- TAPI_SAT_CALL_CTRL_R_NOT_ALLOWED = 1, /**< call control result type - NOT ALLOWED */
- TAPI_SAT_CALL_CTRL_R_ALLOWED_WITH_MOD = 2, /**< call control result type - ALLOWED WITH MOD */
- TAPI_SAT_CALL_CTRL_R_RESERVED = 0xFF /**< call control result type - RESERVED */
-
-} TelSatCallCtrlResultType_t;
-
-/**
- * @enum TelSatEnvelopeResp_t
- * This enum indicates the general result of sending an envelope command to USIM.
- */
-typedef enum
-{
- TAPI_SAT_ENVELOPE_SUCCESS, /**< envelope result - success */
- TAPI_SAT_ENVELOPE_SIM_BUSY, /**< envelope result - USIM busy */
- TAPI_SAT_ENVELOPE_FAILED /**< envelope result - failed */
-
-}TelSatEnvelopeResp_t;
-
-// 8. MENU SELECTION
-/**
- * This structure contains the data objects for MENU SELECTION envelope.
- */
-typedef struct
-{
- unsigned char itemIdentifier; /**< menu selection item identifier */
- int bIsHelpRequested; /**< flag to check whether help information required or not */
-} TelSatMenuSelectionReqInfo_t;
-
-// 9.1 CALL CONTROL BY SIM
-/**
- * This struct contains the data objects for Call Control result data sent by USIM.
- */
-typedef struct
-{
- TelSatAddressInfo_t address; /**< call number */
- TelSatSubAddressInfo_t subAddress; /**< call number sub address */
- TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator */
- TelSatCapaConfigParamInfo_t ccp1; /**< capability configuration parameter1 */
- TelSatCapaConfigParamInfo_t ccp2; /**< capability configuration parameter2 */
-}TelSatVoiceCallCtrlIndInfo_t;
-
-/**
- * This struct contains SAT ss control result data sent by USIM.
- */
-typedef struct
-{
- TelSatSsStringInfo_t ssString; /**< ss number */
- TelSatSubAddressInfo_t subAddress; /**< ss sub address */
- TelSatBcRepeatIndicatorType_t bcRepeatIndicator; /**< bc repeat indicator */
- TelSatCapaConfigParamInfo_t ccp1; /**< capability configuration parameter1 */
- TelSatCapaConfigParamInfo_t ccp2; /**< capability configuration parameter2 */
-}TelSatSsCtrlIndInfo_t;
-
-/**
- * This struct contains SAT mo SMS control configuration data
- */
-typedef struct
-{
- TelSatAddressInfo_t rpDestAddress; /**< sms control rp destination address */
- TelSatAddressInfo_t tpDestAddress; /**< sms control tp destination address */
-} TelSatMoSmsCtrlIndInfo_t;
-
-/**
- * This struct contains SAT call control configuration data
- */
-typedef struct
-{
- TelSatCallType_t callType; /**< call type */
- TelSatCallCtrlResultType_t callCtrlResult; /**< call control result */
- TelSatAlphaIdentifierInfo_t alphaIdentifier;/**< alpha identifier */
- unsigned char callId; /**< call id */
- TelSatCallType_t oldCallType; /**< old call type */
- union
- {
- TelSatVoiceCallCtrlIndInfo_t voiceCallData; /**< voice call control data */
- TelSatSsCtrlIndInfo_t ssData; /**< ss control data */
- TelSatMoSmsCtrlIndInfo_t smsData;
- }u; /**< Union */
-} TelSatCallCtrlIndInfo_t;
-
-// 9.2 MO SHORT MESSAGE CONTROL BY SIM RESULT
-/**
- * This struct contains SAT mo ss control request data
- */
- typedef struct
-{
- TelSatCallCtrlResultType_t callCtrlResult; /**< call control result */
- TelSatAlphaIdentifierInfo_t alphaIdentifier; /**< alpha identifier */
- TelSatMoSmsCtrlIndInfo_t smsData; /**< sms control data */
-}TelSatMoSMCtrlResult_t;
-
-// 11.5 EVENT DOWNLOAD - USER ACTIVITY EVENT
-/**
- * This struct contains SAT user activity event request data
- */
-typedef struct
-{
- TelSatEventListInfo_t eventList; /**< event List */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */
-
-} TelSatUserActivityEventReqInfo_t;
-
-// 11.6 EVENT DOWNLOAD - IDLE SCREEN AVAILABLE EVENT
-/**
- * This structure contains the data objects for IDLE SCREEN AVAILABLE event download.
- */
-typedef struct
-{
- TelSatEventDownloadType_t eventData; /**< event type */
-} TelSatIdleScreenAvailableEventReqInfo_t;
-
-// 11.8 EVENT DOWNLOAD - LANGUAGE SELECTION EVENT
-/**
- * This structure contains the data objects for LANGUAGE SELECTION event download.
- */
-typedef struct
-{
- TelSatLanguageType_t language; /**< selected language info */
-} TelSatLanguageSelectionEventReqInfo_t;
-
-// 11.9 EVENT DOWNLOAD - BROWSER TERMINATION EVENT
-/**
- * This structure contains the data objects for BROWSER TERMINATION event download.
- */
-typedef struct
-{
- TelSatBrowserTerminationCauseType_t browserTerminationCause; /**< browser Termination Cause */
-} TelSatBrowserTerminationEventReqInfo_t;
-
-// 11.10 EVENT DOWNLOAD - DATA AVAILABLE EVENT
-/**
- * This struct contains SAT data available event request data
- */
-typedef struct
-{
- TelSatEventListInfo_t eventList; /**< event List */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */
- TelSatChannelStatusInfo_t channelStatus; /**< channel status */
- TelSatChannelDataLengthInfo_t channelDataLen; /**< channel data length */
-
-} TelSatDataAvailableEventReqInfo_t;
-
-// 11.11 EVENT DOWNLOAD - CHANNEL STATUS EVENT
-/**
- * This struct contains SAT channel status even request data
- */
-typedef struct
-{
- TelSatEventListInfo_t eventList; /**< event list */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info */
- TelSatChannelStatusInfo_t channelStatus; /**< channel Status */
-} TelSatChannelStatusEventReqInfo_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_SAT_ENVELOPE_H_ */
-
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup SAT_TAPI SAT
- * @{
- *
- * @file TelSatObj.h
-
- @brief This file serves as a "C" header file defines structures for Telephony SAT Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_SAT_OBJ_H_
-#define _TEL_SAT_OBJ_H_
-
-#include <TelDefines.h>
-#include <TelSim.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define EXTENDED_ASCII 1
-
-#define TAPI_SAT_DIALLING_NUMBER_LEN_MAX 200 /**< max length of dialing number */
-#define TAPI_SAT_ALPHA_ID_LEN_MAX 255 /**< max length of alpha identifier */
-#define TAPI_SAT_TEXT_STRING_LEN_MAX 500 /**< max length of text string -when the string data is in 7Bit packed format, this length is not enough to support the maximum size so should increase the value to a value > 275 */
-#define TAPI_SAT_SUB_ADDR_LEN_MAX 30 /**< max length of sub address */
-#define TAPI_SAT_CCP_DATA_LEN_MAX 30 /**< max length of ccp data */
-#define TAPI_SAT_ITEM_TEXT_LEN_MAX 45 /**< max length of item text */
-#define TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX 175 /**< max length of sms tpdu data */
-#define TAPI_SAT_SS_STRING_LEN_MAX 160 /**< max length of ss string */
-#define TAPI_SAT_USSD_STRING_LEN_MAX 255 /**< max length of ussd string */
-#define TAPI_SAT_FILE_ID_LIST_MAX_COUNT 255 /**< max count of file id list */
-#define TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT 50 /**< max count of items next action indication list */
-#define TAPI_SAT_EVENT_LIST_MAX_COUNT 17 /**< max count of sat event list */
-#define TAPI_SAT_IMG_INSTANT_RAW_DATA_LEN_MAX 256 /**< max length of image instant raw */
-#define TAPI_SAT_CLUT_DATA_LEN_MAX 256 /**< max length of clut data */
-#define TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX 50 /**< max length of image data file name (Icon, CLUT) */
-#define TAPI_SAT_ICON_LIST_MAX_COUNT 50 /**< max count of icon list */
-#define TAPI_SAT_DTMF_STRING_LEN_MAX 30 /**< max length of dtmf string */
-#define TAPI_SAT_DATE_TIME_AND_TIME_ZONE_LEN 7 /**< max length of date time and time zone */
-#define TAPI_SAT_URL_LEN_MAX 129 /**< max length of url */
-#define TAPI_SAT_BEARER_LIST_MAX_COUNT 50 /**< max count of bearer list */
-#define TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX 50 /**< max length of provisioning file path */
-#define TAPI_SAT_BEARER_PARAMS_LEN_MAX 10 /**< max length of bearer parameters */
-#define TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX 255 /**< max length of channel data string */
-#define TAPI_SAT_CHANNEL_STATUS_LEN 2 /**< max length of channel status */
-#define TAPI_SAT_CHANNEL_ID_LEN 3 /**< max length of channel id */
-#define TAPI_SAT_OTHER_ADDR_LEN_MAX 30 /**< max length of other address */
-#define TAPI_SAT_PORT_NUMBER_LEN 2 /**< max length of port number */
-#define TAPI_SAT_NET_ACC_NAM_LEN_MAX 30 /**< max length of net acc name */
-#define TAPI_SAT_AID_LEN_MAX 128 /**< max length of aid */
-#define TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX 50 /**< max length of remote entity address */
-#define TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT 50 /**< max count of item text attributes list */
-#define TAPI_SAT_MCC_CODE_LEN 3 /**< max length of mcc */
-#define TAPI_SAT_MNC_CODE_LEN 3 /**< max length of mnc */
-#define TAPI_SAT_LAC_CODE_LEN 2 /**< max length of lac */
-#define TAPI_SAT_CELL_ID_LEN 2 /**< max length of cell id */
-
-/**
- * @enum TelSatAlphabetFormatType_t
- * This enum lists the Alphabet Format.
- */
-typedef enum {
- TAPI_SAT_ALPHABET_FORMAT_SMS_DEFAULT = 0x00, /**< ALPHABET FROMAT SMS DEFAULT */
- TAPI_SAT_ALPHABET_FORMAT_8BIT_DATA = 0x01, /**< ALPHABET FROMAT 8BIT DATA */
- TAPI_SAT_ALPHABET_FORMAT_UCS2 = 0x02, /**< ALPHABET FROMAT UCS2 */
- TAPI_SAT_ALPHABET_FORMAT_RESERVED = 0x03 /**< ALPHABET FROMAT RESERVED */
-} TelSatAlphabetFormatType_t;
-
-/**
- * @enum TelSatMsgClassType_t
- * This enum lists the message class.
- */
-typedef enum {
- TAPI_SAT_MSG_CLASS_NONE = 0x00, /**< none */
- TAPI_SAT_MSG_CLASS_0 = 0x01, /**< class 0 */
- TAPI_SAT_MSG_CLASS_1, /**< class 1 Default meaning:ME-specific */
- TAPI_SAT_MSG_CLASS_2, /**< class 2 SIM specific message */
- TAPI_SAT_MSG_CLASS_3, /**< class 3 Default meaning: TE specific */
- TAPI_SAT_MSG_CLASS_RESERVED = 0xFF /**< class reserved */
-} TelSatMsgClassType_t;
-
-/**
- * @enum TelSatCommandType_t
- * This enum lists the type of command and the next action indicator.
- */
-typedef enum {
- TAPI_SAT_CMD_TYPE_NONE = 0x00, /**< command type - None */
-
- TAPI_SAT_CMD_TYPE_REFRESH = 0x01, /**< command type - refresh */
- TAPI_SAT_CMD_TYPE_MORE_TIME = 0x02, /**< command type - more time */
- TAPI_SAT_CMD_TYPE_SETUP_EVENT_LIST = 0x05, /**< command type - setup event list */
- TAPI_SAT_CMD_TYPE_SETUP_CALL = 0x10, /**< command type - setup call */
- TAPI_SAT_CMD_TYPE_SEND_SS = 0x11, /**< command type - send ss */
- TAPI_SAT_CMD_TYPE_SEND_USSD = 0x12, /**< command type - send ussd */
- TAPI_SAT_CMD_TYPE_SEND_SMS = 0x13, /**< command type - send sms */
- TAPI_SAT_CMD_TYPE_SEND_DTMF = 0x14, /**< command type - send dtmf */
- TAPI_SAT_CMD_TYPE_LAUNCH_BROWSER = 0x15, /**< command type - launch browser */
- TAPI_SAT_CMD_TYPE_PLAY_TONE = 0x20, /**< command type - play tone */
- TAPI_SAT_CMD_TYPE_DISPLAY_TEXT = 0x21, /**< command type - display text */
- TAPI_SAT_CMD_TYPE_GET_INKEY = 0x22, /**< command type - get inkey */
- TAPI_SAT_CMD_TYPE_GET_INPUT = 0x23, /**< command type - get input */
- TAPI_SAT_CMD_TYPE_SELECT_ITEM = 0x24, /**< command type - select item */
- TAPI_SAT_CMD_TYPE_SETUP_MENU = 0x25, /**< command type - setup menu */
- TAPI_SAT_CMD_TYPE_PROVIDE_LOCAL_INFO = 0x26, /**< command type - provide local info */
- TAPI_SAT_CMD_TYPE_SETUP_IDLE_MODE_TEXT = 0x28, /**< command type - setup idle mode text */
- TAPI_SAT_CMD_TYPE_LANGUAGE_NOTIFICATION = 0x35, /**< command type - language notification */
- TAPI_SAT_CMD_TYPE_OPEN_CHANNEL = 0x40, /**< command type - open channel -class e */
- TAPI_SAT_CMD_TYPE_CLOSE_CHANNEL = 0x41, /**< command type - close channel - class e */
- TAPI_SAT_CMD_TYPE_RECEIVE_DATA = 0x42, /**< command type - receive data -class e */
- TAPI_SAT_CMD_TYPE_SEND_DATA = 0x43, /**< command type - send data */
- TAPI_SAT_CMD_TYPE_GET_CHANNEL_STATUS = 0x44, /**< command type - get channel status -class e */
- TAPI_SAT_CMD_TYPE_END_OF_APP_EXEC = 0xFD, /**< inform to End the execution of a Proactive Command*/
- TAPI_SAT_CMD_TYPE_END_PROACTIVE_SESSION = 0xFE, /**< inform end proactive session */
- TAPI_SAT_CMD_TYPE_RESERVED = 0xFF /**< command type - reserved */
-} TelSatCommandType_t;
-
-/**
- * @enum TelSatCmdQualiRefresh_t
- * This enum lists the Command qualifier values for Refresh command.
- */
-typedef enum {
- TAPI_SAT_REFRESH_SIM_INIT_AND_FULL_FCN = 0x00, /**< command qualifier for REFRESH SIM INIT AND FULL FILE CHANGE_NOTIFICATION */
- TAPI_SAT_REFRESH_FCN = 0x01, /**< command qualifier for REFRESH FILE CHANGE NOTIFICATION */
- TAPI_SAT_REFRESH_SIM_INIT_AND_FCN = 0x02, /**< command qualifier for REFRESH SIM INIT AND FILE CHANGE NOTIFICATION */
- TAPI_SAT_REFRESH_SIM_INIT = 0x03, /**< command qualifier for REFRESH SIM INIT */
- TAPI_SAT_REFRESH_SIM_RESET = 0x04, /**< command qualifier for REFRESH SIM RESET */
- TAPI_SAT_REFRESH_3G_APPLICATION_RESET = 0x05, /**< command qualifier for REFRESH 3G APPLICATION RESET */
- TAPI_SAT_REFRESH_3G_SESSION_RESET = 0x06, /**< command qualifier for REFRESH 3G SESSION RESET */
- TAPI_SAT_REFRESH_RESERVED = 0xFF /**< command qualifier for REFRESH RESERVED */
-} TelSatCmdQualiRefresh_t;
-
-/**
- * @enum TelSatCmdQualiSetupCall_t
- * This enum lists the Command qualifier values for setup call command.
- */
-typedef enum {
- TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY = 0x00, /**< command qualifier for SETUP CALL IF ANOTHER CALL NOT BUSY */
- TAPI_SAT_SETUP_CALL_IF_ANOTHER_CALL_NOT_BUSY_WITH_REDIAL = 0x01, /**< command qualifier for SETUP CALL IF ANOTHER CALL NOT BUSY WITH REDIAL */
- TAPI_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD = 0x02, /**< command qualifier for SETUP CALL PUTTING ALL OTHER CALLS ON HOLD */
- TAPI_SAT_SETUP_CALL_PUT_ALL_OTHER_CALLS_ON_HOLD_WITH_REDIAL = 0x03, /**< command qualifier for SETUP CALL PUTTING ALL OTHER CALLS ON HOLD WITH REDIAL */
- TAPI_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS = 0x04, /**< command qualifier for SETUP CALL DISCONNECTING ALL OTHER CALLS */
- TAPI_SAT_SETUP_CALL_DISCONN_ALL_OTHER_CALLS_WITH_REDIAL = 0x05, /**< command qualifier for SETUP CALL DISCONNECTING ALL OTHER CALLS WITH REDIAL */
- TAPI_SAT_SETUP_CALL_RESERVED = 0xFF /**< command qualifier for SETUP CALL RESERVED */
-} TelSatCmdQualiSetupCall_t;
-
-/**
- * @enum TelSatDisplayTextPriorityType_t
- * This is associated with the command qualifier for display text.
- */
-typedef enum {
- TAPI_SAT_MSG_PRIORITY_NORMAL = 0, /**< MSG PRIORITY NORMAL */
- TAPI_SAT_MSG_PRIORITY_HIGH = 1 /**< MSG PRIORITY HIGH */
-} TelSatDisplayTextPriorityType_t;
-
-/**
- * @enum TelSatDisplayTextMsgClearType_t
- * This is associated with the command qualifier for display text.
- */
-typedef enum {
- TAPI_SAT_AUTO_CLEAR_MSG_AFTER_A_DELAY = 0, /**< message clear type - AUTO CLEAR MSG AFTER A DELAY */
- TAPI_SAT_WAIT_FOR_USER_TO_CLEAR_MSG = 1 /**< message clear type - WAIT FOR USER TO CLEAR MSG */
-} TelSatDisplayTextMsgClearType_t;
-
-/**
- * @enum TelSatInkeyType_t
- * This is associated with the command qualifier for get inkey.
- */
-typedef enum {
- TAPI_SAT_INKEY_TYPE_CHARACTER_SET_ENABLED = 0, /**< command qualifier for INKEY TYPE CHARACTER SET ENABLED */
- TAPI_SAT_INKEY_TYPE_YES_NO_REQUESTED = 1 /**< command qualifier for INKEY TYPE YES NO REQUESTED */
-} TelSatInkeyType_t;
-
-/**
- * @enum TelSatUseInputAlphabetType_t
- * This is associated with the command qualifier for get input.
- */
-typedef enum {
- TAPI_SAT_USER_INPUT_ALPHABET_TYPE_SMS_DEFAULT = 1, /**< command qualifier for ALPHABET TYPE SMS DEFAULT */
- TAPI_SAT_USER_INPUT_ALPHABET_TYPE_UCS2 = 2 /**< command qualifier for ALPHABET TYPE UCS2 */
-} TelSatUseInputAlphabetType_t;
-
-/**
- * @enum TelSatDisplayVibrateAlertType_t
- * This is associated with the command qualifier for play tone command.
- */
-typedef enum {
- TAPI_SAT_VIBRATE_ALERT_OPTIONAL = 0, /**< VIBRATE ALERT UPTO THE TERMINAL */
- TAPI_SAT_VIBRATE_ALERT_REQUIRED = 1 /**< VIBRATE, IF AVAILABLE, WITH TONE. */
-} TelSatDisplayVibrateAlertType_t;
-
-/**
- * @enum TelSatPresentationType_t
- * This is associated with the command qualifier for select item command.
- */
-typedef enum {
- TAPI_SAT_PRESENTATION_TYPE_NOT_SPECIFIED = 0x00, /**< command qualifier for PRESENTATION TYPE NOT SPECIFIED */
- TAPI_SAT_PRESENTATION_TYPE_DATA_VALUE = 0x01, /**< command qualifier for PRESENTATION TYPE DATA VALUE */
- TAPI_SAT_PRESENTATION_TYPE_NAVIGATION_OPTION = 0x02 /**< command qualifier for PRESENTATION TYPE NAVIGATION OPTION */
-} TelSatPresentationType_t;
-
-/**
- * @enum TelSatSelectionPreferenceType_t
- * This is associated with the command qualifier for select item command.
- */
-typedef enum {
- TAPI_SAT_SELECTION_PREFERENCE_NONE_REQUESTED = 0, /**< command qualifier for SELECTION PREFERENCE NONE REQUESTED */
- TAPI_SAT_SELECTION_PREFERENCE_USING_SOFT_KEY = 1 /**< command qualifier for SELECTION PREFERENCE USING SOFT KEY */
-} TelSatSelectionPreferenceType_t;
-
-/**
- * @enum TelSatCmdQualiProvideLocalInfo_t
- * This enum defines the Command qualifier values for provide local info command.
- */
-typedef enum {
- TAPI_SAT_PROVIDE_DATE_TIME_AND_TIME_ZONE = 0x03, /**< command qualifier for PROVIDE DATE TIME AND TIME ZONE */
- TAPI_SAT_PROVIDE_LANGUAGE_SETTING = 0x04, /**< command qualifier for PROVIDE LANGUAGE SETTING */
- TAPI_SAT_PROVIDE_IMEISV = 0x08, TAPI_SAT_PROVIDE_RESERVED = 0xFF /**< reserved */
-} TelSatCmdQualiProvideLocalInfo_t;
-
-/**
- * @enum TelSatCmdQualiLaunchBrowser_t
- * This enum defines the Command qualifier values for launch browser command.
- */
-typedef enum {
- TAPI_SAT_LAUNCH_BROWSER = 0, /**< command qualifier for LAUNCH BROWSER */
- TAPI_SAT_NOT_USED = 1, /**< command qualifier for NOT USED */
- TAPI_SAT_USE_EXISTING_BROWSER = 2, /**< command qualifier for USE EXISTING BROWSER if secure session, do not use it. */
- TAPI_SAT_CLOSE_AND_LAUNCH_NEW_BROWSER = 3, /**< command qualifier for CLOSE AND LAUNCH NEW BROWSER */
- TAPI_SAT_NOT_USED2 = 4, /**< command qualifier for NOT USED2 */
- TAPI_SAT_LB_RESERVED = 0xFF /**< reserved */
-} TelSatCmdQualiLaunchBrowser_t;
-
-/**
- * @enum TelSatDeviceIdentitiesTagType_t
- * This enum lists the device identity tag value IDs.
- */
-typedef enum {
- TAPI_SAT_DEVICE_ID_KEYPAD = 0x01, /**< DEVICE ID KEYPAD */
- TAPI_SAT_DEVICE_ID_DISPLAY = 0x02, /**< DEVICE ID DISPLAY */
- TAPI_SAT_DEVICE_ID_EARPIECE = 0x03, /**< DEVICE ID EARPIECE */
-
- TAPI_SAT_DEVICE_ID_SIM = 0x81, /**< DEVICE ID SIM */
- TAPI_SAT_DEVICE_ID_ME = 0x82, /**< DEVICE ID ME */
- TAPI_SAT_DEVICE_ID_NETWORK = 0x83, /**< DEVICE ID NETWORK */
-
- TAPI_SAT_DEVICE_ID_RESERVED = 0XFF /**< reserved */
-} TelSatDeviceIdentitiesTagType_t;
-
-/**
- * @enum TelSatTimeUnitType_t
- * This enum lists the time units for the duration data object.
- */
-typedef enum {
- TAPI_SAT_TIME_UNIT_MINUTES = 0x0, /**< time unit - minutes */
- TAPI_SAT_TIME_UNIT_SECONDS = 0x01, /**< time unit - second */
- TAPI_SAT_TIME_UNIT_TENTHS_OF_SECONDS = 0x02, /**< time unit - tenths of seconds */
- TAPI_SAT_TIME_UNIT_RESERVED = 0xFF /**< reserved */
-} TelSatTimeUnitType_t;
-
-/**
- * @enum TelSatResultType_t
- * This enum lists the values for the RESULT data object - General Response.
- */
-typedef enum {
- TAPI_SAT_R_SUCCESS = 0x0, /**< command performed successfully */
- TAPI_SAT_R_SUCCESS_WITH_PARTIAL_COMPREHENSION = 0x01, /**< command performed with partial comprehension */
- TAPI_SAT_R_SUCCESS_WITH_MISSING_INFO = 0x02, /**< command performed, with missing information */
-
- TAPI_SAT_R_REFRESH_PERFORMED_WITH_ADDITIONAL_EFS_READ = 0x03, /**< REFRESH PERFORMED WITH ADDITIONAL EFS READ */
- TAPI_SAT_R_SUCCESS_BUT_REQUESTED_ICON_NOT_DISPLAYED = 0x04, /**< command performed but REQUESTED ICON NOT DISPLAYED */
- TAPI_SAT_R_SUCCESS_BUT_MODIFIED_BY_CALL_CONTROL_BY_SIM = 0x05, /**< command performed but MODIFIED BY CALL CONTROL BY SIM */
- TAPI_SAT_R_SUCCESS_LIMITED_SERVICE = 0x06, /**< command performed with LIMITED SERVICE */
- TAPI_SAT_R_SUCCESS_WITH_MODIFICATION = 0x07, /**< command performed with MODIFICATION */
- TAPI_SAT_R_REFRESH_PRFRMD_BUT_INDICATED_USIM_NOT_ACTIVE = 0x08, /**< REFRESH PERFORMED BUT INDICATED USIM NOT ACTIVE */
-
- TAPI_SAT_R_PROACTIVE_SESSION_TERMINATED_BY_USER = 0x10, /**< proactive sim application session terminated by user */
- TAPI_SAT_R_BACKWARD_MOVE_BY_USER = 0x11, /**< backward move in the proactive sim application session request by the user */
- TAPI_SAT_R_NO_RESPONSE_FROM_USER = 0x12, /**< no response from user */
-
- TAPI_SAT_R_HELP_INFO_REQUIRED_BY_USER = 0x13, /**< HELP INFO REQUIRED BY USER */
- TAPI_SAT_R_USSD_OR_SS_TRANSACTION_TERMINATED_BY_USER = 0x14, /**< USSD OR SS TRANSACTION TERMINATED BY USER */
-
- TAPI_SAT_R_ME_UNABLE_TO_PROCESS_COMMAND = 0x20, /**< ME currently unable to process command */
- TAPI_SAT_R_NETWORK_UNABLE_TO_PROCESS_COMMAND = 0x21, /**< Network currently unable to process command */
- TAPI_SAT_R_USER_DID_NOT_ACCEPT_CALL_SETUP_REQ = 0x22, /**< User did not accept call setup request */
- TAPI_SAT_R_USER_CLEAR_DOWN_CALL_BEFORE_CONN = 0x23, /**< User cleared down call before connection or network released */
-
- TAPI_SAT_R_INTERACTION_WITH_CC_BY_SIM_IN_TMP_PRBLM = 0x25, /**< INTERACTION WITH CALL CONTROL BY SIM IN TEMPORARY PROBLEM */
- TAPI_SAT_R_LAUNCH_BROWSER_GENERIC_ERROR_CODE = 0x26, /**< LAUNCH BROWSER GENERIC ERROR CODE */
-
- TAPI_SAT_R_BEYOND_ME_CAPABILITIES = 0x30, /**< command beyond ME's capabilities */
- TAPI_SAT_R_COMMAND_TYPE_NOT_UNDERSTOOD_BY_ME = 0x31, /**< command type not understood by ME */
- TAPI_SAT_R_COMMAND_DATA_NOT_UNDERSTOOD_BY_ME = 0x32, /**< command data not understood by ME */
- TAPI_SAT_R_COMMAND_NUMBER_NOT_KNOWN_BY_ME = 0x33, /**< command number not known by ME */
- TAPI_SAT_R_SS_RETURN_ERROR = 0x34, /**< SS return error */
- TAPI_SAT_R_SMS_RP_ERROR = 0x35, /**< SMS rp-error */
- TAPI_SAT_R_ERROR_REQUIRED_VALUES_ARE_MISSING = 0x36, /**< Error, required values are missing */
-
- TAPI_SAT_R_USSD_RETURN_ERROR = 0x37, /**< USSD_RETURN_ERROR */
- TAPI_SAT_R_INTRCTN_WITH_CC_OR_SMS_CTRL_PRMNT_PRBLM = 0x39, /**< INTERACTION WITH CALL CONTROL OR SMS CONTROL PERMANENT PROBLEM */
- TAPI_SAT_R_BEARER_INDEPENDENT_PROTOCOL_ERROR = 0x3A, /**< BEARER INDEPENDENT PROTOCOL ERROR */
- TAPI_SAT_R_FRAMES_ERROR = 0x3C /**< FRAMES ERROR */
-} TelSatResultType_t;
-
-/**
- * @enum TelSatMeProblemType_t
- * This enum lists the values for the Additional response for the RESULT object and specifies a particular ME PROBLEM.
- */
-typedef enum {
- TAPI_SAT_ME_PROBLEM_NO_SPECIFIC_CAUSE = 0x0, /**< ME problem with NO SPECIFIC CAUSE */
- TAPI_SAT_ME_PROBLEM_SCREEN_BUSY = 0x01, /**< ME problem with SCREEN BUSY */
- TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_CALL = 0x02, /**< ME problem with ME BUSY ON CALL */
- TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SS = 0x03, /**< ME problem with ME_BUSY ON SS */
- TAPI_SAT_ME_PROBLEM_NO_SERVICE = 0x04, /**< ME problem with NO SERVICE */
- TAPI_SAT_ME_PROBLEM_ACCESS_CONTROL_CLASS_BAR = 0x05, /**< ME problem with ACCESS CONTROL CLASS BAR */
- TAPI_SAT_ME_PROBLEM_RADIO_RES_NOT_GRANTED = 0x06, /**< ME problem with RADIO RES NOT GRANTED */
- TAPI_SAT_ME_PROBLEM_NOT_IN_SPEECH_CALL = 0x07, /**< ME problem with NOT IN SPEECH CALL */
- TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_USSD = 0x08, /**< ME problem with ME BUSY ON USSD */
- TAPI_SAT_ME_PROBLEM_ME_BUSY_ON_SEND_DTMF_CMD = 0x09, /**< ME problem with ME BUSY ON SEND DTMF CMD */
- TAPI_SAT_ME_PROBLEM_NO_USIM_ACTIVE = 0x0A, /**< ME problem with NO USIM ACTIVE */
- TAPI_SAT_ME_PROBLEM_INVALID = 0xFF /**< ME problem with INVALID */
-} TelSatMeProblemType_t;
-
-/**
- * @enum TelSatNetworkProblemType_t
- * This enum lists the values for the Additional response for the RESULT object and specifies a particular network PROBLEM.
- */
-typedef enum {
- TAPI_SAT_NETWORK_PROBLEM_NO_SPECIFIC_CAUSE = 0x0, /**< Network problem with no specific cause */
- TAPI_SAT_NETWORK_PROBLEM_USER_BUSY = 0x91 /**< Network problem with USER BUSY */
-} TelSatNetworkProblemType_t;
-
-/**
- * @enum TelSatSsProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to SEND SS.
- */
-typedef enum {
- TAPI_SAT_SS_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< SS problem with no specific cause */
- TAPI_SAT_SS_PROBLEM_FACILITY_NOT_SUPPORTED = 0x15 /**< SS problem with FACILITY NOT SUPPORTED */
-} TelSatSsProblemType_t;
-
-/**
- * @enum TelSatSmsProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to SEND SMS.
- */
-typedef enum {
- TAPI_SAT_SMS_PROBLEM_NO_SPECIFIC_CAUSE = 0 /**< SMS problem with no specific cause */
-} TelSatSmsProblemType_t;
-
-/**
- * @enum TelSatUssdProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to SEND USSD STRING.
- */
-typedef enum {
- TAPI_SAT_USSD_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< USSD problem with no specific cause */
- TAPI_SAT_USSD_PROBLEM_UNKNOWN_ALPHABET = 0x47 /**< USSD problem with UNKNOWN ALPHABET */
-} TelSatUssdProblemType_t;
-
-/**
- * @enum TelSatCallCtrlProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to CALL CONTROL or MO SMS CONTROL.
- */
-typedef enum {
- TAPI_SAT_CC_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< Call Control problem with no specific cause */
- TAPI_SAT_CC_PROBLEM_ACTION_NOT_ALLOWED = 1, /**< Call Control problem with action not allowed */
- TAPI_SAT_CC_PROBLEM_REQUEST_TYPE_HAS_CHANGED = 2 /**< Call Control problem with request type has changed */
-} TelSatCallCtrlProblemType_t;
-
-/**
- * @enum TelSatLaunchBrowserProblemType_t
- * This enum lists the values for the Additional response for the RESULT object related to LAUNCH BROWSER PROBLEM
- */
-typedef enum {
- TAPI_SAT_BROWSER_PROBLEM_NO_SPECIFIC_CAUSE = 0, /**< Browser problem with no specific cause */
- TAPI_SAT_BROWSER_PROBLEM_BEARER_UNAVAILABLE = 1, /**< Browser problem with bearer unavailable */
- TAPI_SAT_BROWSER_PROBLEM_BROWSER_UNAVAILABLE = 2, /**< Browser problem with browser unavailable */
- TAPI_SAT_BROWSER_PRBLM_ME_UNABLE_TO_READ_PROV_DATA = 3 /**< Browser problem with ME unable to read provisioning data */
-} TelSatLaunchBrowserProblemType_t;
-
-/**
- * @enum TelSatBipProblemType_t
- * This enum lists the values for the Additional response for the RESULT object.
- * Permanent Problems ::: 12.12.11 ADDITIONAL INFORMATION : BEARER INDEPENDENT PROTOCOL
- */
-typedef enum {
- TAPI_SAT_BIP_PROBLEM_NO_SPECIFIC_CAUSE = 0x00, /**< BIP problem with no specific cause */
- TAPI_SAT_BIP_PROBLEM_NO_CHANNEL_AVAILABLE = 0x01, /**< BIP problem with no channel available */
- TAPI_SAT_BIP_PROBLEM_CHANNEL_CLOSED = 0x02, /**< BIP problem with channel closed */
- TAPI_SAT_BIP_PROBLEM_CHANNEL_ID_NOT_VALID = 0x03, /**< BIP problem with channel id not valid */
- TAPI_SAT_BIP_PROBLEM_BUF_SIZE_NOT_AVAILABLE = 0x04, /**< BIP problem with buffer size not available */
- TAPI_SAT_BIP_PROBLEM_SECURITY_ERROR = 0x05, /**< BIP problem with security error */
- TAPI_SAT_BIP_PRBLM_SIM_ME_IF_TRNSPRT_LEVEL_NOT_AVL = 0x06, /**< BIP problem with SIM ME interface transport level not available */
- TAPI_SAT_BIP_REMOTE_DEV_NOT_REACHABLE = 0x07, /**< BIP problem with remote device not reachable */
- TAPI_SAT_BIP_SERVICE_ERROR = 0x08, /**< BIP service error */
- TAPI_SAT_BIP_SERVICE_IDENTIFIER_UNKNOWN = 0x09 /**< BIP service identifier unknown */
-} TelSatBipProblemType_t;
-
-/**
- * @enum TelSatSmsTpduType_t
- * This enum lists the values for the SMS TPDU type.
- */
-typedef enum {
- TAPI_SAT_SMS_TPDU_TYPE_DELIVER_TPDU = 0, /**< sms tpdu type - DELIVER TPDU */
- TAPI_SAT_SMS_TPDU_TYPE_DELIVER_RPT = 1, /**< sms tpdu type - DELIVER RPT */
- TAPI_SAT_SMS_TPDU_TYPE_SUBMIT_TPDU = 2, /**< sms tpdu type - SUBMIT TPDU */
- TAPI_SAT_SMS_TPDU_TYPE_SUBMIT_RPT = 3, /**< sms tpdu type - SUBMIT RPT */
- TAPI_SAT_SMS_TPDU_TYPE_STATUS_RPT = 4, /**< sms tpdu type - STATUS RPT */
- TAPI_SAT_SMS_TPDU_TYPE_TPDU_CMD = 5 /**< sms tpdu type - TPDU CMD */
-} TelSatSmsTpduType_t;
-
-/**
- * @enum TelSatToneType_t
- * This enum lists the values tones type.
- */
-typedef enum {
- // standard supervisory tones
- TAPI_SAT_DIAL_TONE = 0x01, /**< TONE TYPE DIAL TONE */
- TAPI_SAT_CALLED_SUBSCRIBER_BUSY = 0x02, /**< TONE TYPE CALLED SUBSCRIBER BUSY */
- TAPI_SAT_CONGESTION = 0x03, /**< TONE TYPE CONGESTION */
- TAPI_SAT_RADIO_PATH_ACK = 0x04, /**< TONE TYPE RADIO PATH ACK */
- TAPI_SAT_RADIO_PATH_NOT_AVAILABLE_CALL_DROPPED = 0x05, /**< TONE TYPE RADIO PATH NOT AVAILABLE CALL DROPPED */
- TAPI_SAT_ERR_SPECIAL_INFO = 0x06, /**< TONE TYPE ERR SPECIAL INFO */
- TAPI_SAT_CALL_WAITING_TONE = 0x07, /**< TONE TYPE CALL WAITING TONE */
- TAPI_SAT_RINGING_TONE = 0x08, /**< TONE TYPE RINGING TONE */
-
- // ME proprietary tones
- TAPI_SAT_GENERAL_BEEP = 0x10, /**< TONE TYPE GENERAL BEEP */
- TAPI_SAT_POSITIVE_ACK_TONE = 0x11, /**< TONE TYPE POSITIVE ACK TONE */
- TAPI_SAT_NEGATIVE_ACK_OR_ERROR_TONE = 0x12, /**< TONE TYPE NEGATIVE ACK OR ERROR TONE */
- TAPI_SAT_RINGING_TONE_SLCTD_BY_USR_FOR_INCOM_SPEECH_CALL = 0x13, /**< TONE TYPE RINGING TONE SELECTED BY USER FOR INCOMING SPEECH CALL */
- TAPI_SAT_ALERT_TONE_SELECTED_BY_USER_FOR_INCOMING_SMS = 0x14, /**< TONE TYPE ALERT TONE SELECTED BY USER FOR INCOMING SMS */
- TAPI_SAT_CRITICAL_ALERT = 0x15, /**< TONE TYPE CRITICAL ALERT */
-
- //Themed tones
- TAPI_SAT_HAPPY_TONE = 0x30, /**< TONE TYPE HAPPY TONE */
- TAPI_SAT_SAD_TONE = 0x31, /**< TONE TYPE SAD TONE */
- TAPI_SAT_URGENT_ACTION_TONE = 0x32, /**< TONE TYPE URGENT ACTION TONE */
- TAPI_SAT_QUESTION_TONE = 0x33, /**< TONE TYPE QUESTION TONE */
- TAPI_SAT_MESSAGE_RECEIVED_TONE = 0x34, /**< TONE TYPE MESSAGE RECEIVED TONE */
-
- //Melody tones
- TAPI_SAT_MELODY_1 = 0x40, /**< TONE TYPE MELODY 1 */
- TAPI_SAT_MELODY_2 = 0x41, /**< TONE TYPE MELODY 2 */
- TAPI_SAT_MELODY_3 = 0x42, /**< TONE TYPE MELODY 3 */
- TAPI_SAT_MELODY_4 = 0x43, /**< TONE TYPE MELODY 4 */
- TAPI_SAT_MELODY_5 = 0x44, /**< TONE TYPE MELODY 5 */
- TAPI_SAT_MELODY_6 = 0x45, /**< TONE TYPE MELODY 6 */
- TAPI_SAT_MELODY_7 = 0x46, /**< TONE TYPE MELODY 7 */
- TAPI_SAT_MELODY_8 = 0x47, /**< TONE TYPE MELODY 8 */
-
- TAPI_SAT_TONE_TYPE_RESERVED = 0xFF /**< TONE TYPE RESERVED */
-} TelSatToneType_t;
-
-/**
- * @enum TelSatEventDownloadType_t
- * This enum lists event types required by ME to monitor and report to SIM.
- */
-typedef enum {
- TAPI_EVENT_SAT_DW_TYPE_MT_CALL = 0,
- TAPI_EVENT_SAT_DW_TYPE_CALL_CONNECTED = 1,
- TAPI_EVENT_SAT_DW_TYPE_CALL_DISCONNECTED = 2,
- TAPI_EVENT_SAT_DW_TYPE_LOCATION_STATUS = 3,
- TAPI_EVENT_SAT_DW_TYPE_USER_ACTIVITY = 4, /**< data download type - USER_ACTIVITY */
- TAPI_EVENT_SAT_DW_TYPE_IDLE_SCREEN_AVAILABLE = 5, /**< data download type - IDLE SCREEN AVAILABLE */
- TAPI_EVENT_SAT_DW_TYPE_CARD_READER_STATUS = 6,
- TAPI_EVENT_SAT_DW_TYPE_LANGUAGE_SELECTION = 7, /**< data download type - LANGUAGE SELECTION */
- TAPI_EVENT_SAT_DW_TYPE_BROWSER_TERMINATION = 8, /**< data download type - BROWSER TERMINATION */
- TAPI_EVENT_SAT_DW_TYPE_DATA_AVAILABLE = 9, /**< data download type -DATA AVAILABLE */
- TAPI_EVENT_SAT_DW_TYPE_CHANNEL_STATUS = 0x0A, /**< data download type - CHANNEL STATUS */
- TAPI_EVENT_SAT_DW_TYPE_ACCESS_TECHNOLOGY_CHANGED = 0x0B,
- TAPI_EVENT_SAT_DW_TYPE_DISPLAY_PARAMETERS_CHANGED = 0x0C,
- TAPI_EVENT_SAT_DW_TYPE_LOCAL_CONNECTION = 0x0D,
- TAPI_EVENT_SAT_DW_TYPE_NW_SEARCH_MODE_CHANGED = 0X0E,
- TAPI_EVENT_SAT_DW_TYPE_BROWSING_STATUS = 0X0F,
- TAPI_EVENT_SAT_DW_TYPE_FRAMES_INFORMATION_CHANGED = 0X10,
- TAPI_EVENT_SAT_DW_TYPE_RESERVED_FOR_3GPP = 0X11,
- TAPI_EVENT_SAT_DW_TYPE_UNKNOWN = 0xFF /**< data download type - unknown */
-} TelSatEventDownloadType_t;
-
-/**
- * @enum TelSatImageCodingSchemeType_t
- * This enum lists image coding scheme types required by ME to show.
- */
-typedef enum {
- TAPI_SAT_SIM_IMAGE_CODING_SCHEME_BASIC = 0x11, /**< IMAGE CODING SCHEME BASIC */
- TAPI_SAT_SIM_IMAGE_CODING_SCHEME_COLOUR = 0x21, /**< IMAGE CODING SCHEME COLOUR */
- TAPI_SAT_SIM_IMAGE_CODING_SCHEME_RESERVED = 0xFF /**< RESERVED */
-} TelSatImageCodingSchemeType_t;
-
-/**
- * @enum TelSatIconQualifierType_t
- * This enum defines the icon qualifier.
- */
-typedef enum {
- TAPI_SAT_ICON_QUALI_SELF_EXPLANATORY = 0, /**< ICON QUALI SELF EXPLANATORY */
- TAPI_SAT_ICON_QUALI_NOT_SELF_EXPLANATORY = 1, /**< ICON QUALI NOT SELF EXPLANATORY */
- TAPI_SAT_ICON_QUALI_RESERVED = 0xFF /**< RESERVED */
-} TelSatIconQualifierType_t;
-
-/**
- * @enum TelSatBcRepeatIndicatorType_t
- * This enum defines the SIM ATK BC repeat indicator type.
- */
-typedef enum {
- TAPI_SAT_BC_REPEAT_INDI_ALTERNATE_MODE = 0x01, /**< BC REPEAT ALTERNATE MODE */
- TAPI_SAT_BC_REPEAT_INDI_SEQUENTIAL_MODE = 0x03, /**< BC REPEAT SEQUENTIAL MODE */
- TAPI_SAT_BC_REPEAT_INDI_RESERVED = 0xFF /**< RESERVED */
-} TelSatBcRepeatIndicatorType_t;
-
-/**
- * @enum TelSatCallCtrlStringType_t
- * This enum defines call control string type.
- */
-typedef enum {
- TAPI_SAT_CC_VOICE = 0x00, /**< Call Control String Type - voice */
- TAPI_SAT_CC_SS = 0x01, /**< Call Control String Type - ss */
- TAPI_SAT_CC_USSD = 0x02, /**< Call Control String Type - ussd */
- TAPI_SAT_CC_NONE = 0xFF /**< Call Control String Type - none */
-} TelSatCallCtrlStringType_t;
-
-/**
- * @enum TelSatLanguageType_t
- * This enum lists the language values.
- */
-typedef enum {
- TAPI_SAT_LP_GERMAN = 0x00, /**< GERMAN */
- TAPI_SAT_LP_ENGLISH = 0x01, /**< ENGLISH */
- TAPI_SAT_LP_ITALIAN = 0x02, /**< ITALIAN */
- TAPI_SAT_LP_FRENCH = 0x03, /**< FRENCH */
- TAPI_SAT_LP_SPANISH = 0x04, /**< SPANISH */
- TAPI_SAT_LP_DUTCH = 0x05, /**< DUTCH */
- TAPI_SAT_LP_SWEDISH = 0x06, /**< SWEDISH */
- TAPI_SAT_LP_DANISH = 0x07, /**< DANISH */
- TAPI_SAT_LP_PORTUGUESE = 0x08, /**< PORTUGUESE */
- TAPI_SAT_LP_FINNISH = 0x09, /**< FINNISH */
- TAPI_SAT_LP_NORWEGIAN = 0x0A, /**< NORWEGIAN */
- TAPI_SAT_LP_GREEK = 0x0B, /**< GREEK */
- TAPI_SAT_LP_TURKISH = 0x0C, /**< TURKISH */
- TAPI_SAT_LP_HUNGARIAN = 0x0D, /**< HUNGARIAN */
- TAPI_SAT_LP_POLISH = 0x0E, /**< POLISH */
- TAPI_SAT_LP_LANG_UNSPECIFIED = 0x0F /**< LANGUAGE UNSPECIFIED */
-} TelSatLanguageType_t;
-
-/**
- * @enum TelSatBrowserIdentityType_t
- * This enum lists the SAT browser identity type.
- */
-typedef enum {
- TAPI_SAT_BROWSER_ID_DEFAULT = 0x0, /**< DEFAULT BROWSER */
- TAPI_SAT_BROWSER_ID_WML, /**< BROWSER WML */
- TAPI_SAT_BROWSER_ID_HTML, /**< BROWSER HTML */
- TAPI_SAT_BROWSER_ID_XHTML, /**< BROWSER XHTML */
- TAPI_SAT_BROWSER_ID_CHTML, /**< BROWSER CHTML */
- TAPI_SAT_BROWSER_ID_RESERVED = 0xFF /**< RESERVED */
-} TelSatBrowserIdentityType_t;
-
-/**
- * @enum TelSatBearerType_t
- * This enum lists the SAT bearer type.
- */
-typedef enum {
- TAPI_SAT_BEARER_TYPE_SMS = 0x0, /**< BEARER SMS */
- TAPI_SAT_BEARER_TYPE_CSD = 0x1, /**< BEARER CSD */
- TAPI_SAT_BEARER_TYPE_USSD = 0x2, /**< BEARER USSD */
- TAPI_SAT_BEARER_TYPE_GPRS = 0x3, /**< BEARER GPRS */
- TAPI_SAT_BEARER_TYPE_RESERVED = 0xFF /**< BEARER RESERVED */
-} TelSatBearerType_t;
-
-/**
- * @enum TelSatBrowserTerminationCauseType_t
- * This enum lists the SAT browser termination cause type.
- */
-typedef enum {
- TAPI_SAT_BROWSER_TERMINATED_BY_USER = 0, /**< BROWSER TERMINATED BY USER */
- TAPI_SAT_BROWSER_TERMINATED_BY_ERROR = 1, /**< BROWSER TERMINATED BY ERROR */
-} TelSatBrowserTerminationCauseType_t;
-
-/**
- * @enum TelSatBearerDescType_t
- * This enum lists the SAT bearer destination type.
- */
-typedef enum {
- TAPI_SAT_BEARER_CSD = 0x1, /**< BEARER DESC CSD */
- TAPI_SAT_BEARER_GPRS = 0x2, /**< BEARER DESC GPRS */
- TAPI_SAT_BEARER_DEFAULT_BEARER_FROM_TRANSPORT_LAYER = 0x3, /**< BEARER DESC DEFAULT BEARER FROM TRANSPORT LAYER */
- TAPI_SAT_BEARER_LOCAL_LINK_TECHNOLOGY_INDEPENDENT = 0x4, /**< BEARER DESC LOCAL LINK TECHNOLOGY INDEPENDENT */
- TAPI_SAT_BEARER_BLUETOOTH = 0x5, /**< BEARER DESC BLUETOOTH */
- TAPI_SAT_BEARER_IrDA = 0x6, /**< BEARER DESC IrDA */
- TAPI_SAT_BEARER_RS232 = 0x7, /**< BEARER DESC RS232 */
- TAPI_SAT_BEARER_USB = 0x10, /**< BEARER DESC USB */
- TAPI_SAT_BEARER_RESERVED = 0xFF /**< RESERVED */
-} TelSatBearerDescType_t;
-
-/**
- * @enum TelSatBearerParamCsdDataRateType_t
- * This enum lists the SAT bearer parameter csd data rate. refer TS 27.007
- */
-typedef enum {
- TAPI_SAT_BIP_DR_AUTOBAUDING = 0, /**< CSD data rate - AUTOBAUDING */
- TAPI_SAT_BIP_DR_300BPS_V21 = 1, /**< CSD data rate -300BPS V21 */
- TAPI_SAT_BIP_DR_1200BPS_V22 = 2, /**< CSD data rate - 1200BPS V22 */
- TAPI_SAT_BIP_DR_1200_75BPS_V23 = 3, /**< CSD data rate -1200 75BPS V23 */
- TAPI_SAT_BIP_DR_2400BPS_V22 = 4, /**< CSD data rate -2400BPS V22 */
- TAPI_SAT_BIP_DR_2400BPS_V26 = 5, /**< CSD data rate - 2400BPS V26 */
- TAPI_SAT_BIP_DR_4800BPS_V32 = 6, /**< CSD data rate - 4800BPS V32 */
- TAPI_SAT_BIP_DR_9600BPS_V32 = 7, /**< CSD data rate - 9600BPS V32 */
- TAPI_SAT_BIP_DR_9600BPS_V34 = 12, /**< CSD data rate - 9600BPS_V34 */
- TAPI_SAT_BIP_DR_14400BPS_V34 = 14, /**< CSD data rate -14400BPS V34 */
- TAPI_SAT_BIP_DR_19200BPS_V34 = 15, /**< CSD data rate -19200BPS V34 */
- TAPI_SAT_BIP_DR_28800BPS_V34 = 16, /**< CSD data rate -28800BPS V34 */
- TAPI_SAT_BIP_DR_33600BPS_V34 = 17, /**< CSD data rate -33600BPS V34 */
- TAPI_SAT_BIP_DR_1200BPS_V120 = 34, /**< CSD data rate -1200BPS V120 */
- TAPI_SAT_BIP_DR_2400BPS_V120 = 36, /**< CSD data rate -2400BPS V120 */
- TAPI_SAT_BIP_DR_4800BPS_V120 = 38, /**< CSD data rate -4800BPS V120 */
- TAPI_SAT_BIP_DR_9600BPS_V120 = 39, /**< CSD data rate -9600BPS V120 */
- TAPI_SAT_BIP_DR_14400BPS_V120 = 43, /**< CSD data rate -14400BPS V120 */
- TAPI_SAT_BIP_DR_19200BPS_V120 = 47, /**< CSD data rate -19200BPS V120 */
- TAPI_SAT_BIP_DR_28800BPS_V120 = 48, /**< CSD data rate -28800BPS V120 */
- TAPI_SAT_BIP_DR_38400BPS_V120 = 49, /**< CSD data rate -38400BPS V120 */
- TAPI_SAT_BIP_DR_48000BPS_V120 = 50, /**< CSD data rate -48000BPS V120 */
- TAPI_SAT_BIP_DR_56000BPS_V120 = 51, /**< CSD data rate -56000BPS V120 */
- TAPI_SAT_BIP_DR_300BPS_V110 = 65, /**< CSD data rate - 300BPS V110 */
- TAPI_SAT_BIP_DR_1200BPS_V110 = 66, /**< CSD data rate -1200BPS V110 */
- TAPI_SAT_BIP_DR_2400BPS_V110_OR_X31_FALG_STUFFING = 68, /**< CSD data rate - 2400BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_4800BPS_V110_OR_X31_FALG_STUFFING = 70, /**< CSD data rate - 4800BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_9600BPS_V110_OR_X31_FALG_STUFFING = 71, /**< CSD data rate - 9600BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_14400BPS_V110_OR_X31_FALG_STUFFING = 75, /**< CSD data rate - 14400BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_19200BPS_V110_OR_X31_FALG_STUFFING = 79, /**< CSD data rate -19200BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_28800BPS_V110_OR_X31_FALG_STUFFING = 80, /**< CSD data rate -28800BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_38400BPS_V110_OR_X31_FALG_STUFFING = 81, /**< CSD data rate -38400BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_48000BPS_V110_OR_X31_FALG_STUFFING = 82, /**< CSD data rate -48000BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_56000BPS_V110_OR_X31_FALG_STUFFING = 83, /**< CSD data rate -56000BPS V110 OR X31 FALG STUFFING */
- TAPI_SAT_BIP_DR_64000BPS = 84, /**< CSD data rate -64000BPS */
- TAPI_SAT_BIP_DR_56000BPS_BIT_TRANSPERENT = 115, /**< CSD data rate -56000BPS BIT TRANSPERENT */
- TAPI_SAT_BIP_DR_64000BPS_BIT_TRANSPERENT = 116, /**< CSD data rate -64000BPS BIT TRANSPERENT */
- TAPI_SAT_BIP_DR_32000BPS_PIAFS32K = 120, /**< CSD data rate -32000BPS PIAFS32K */
- TAPI_SAT_BIP_DR_64000BPS_PIAFS64K = 121, /**< CSD data rate - 64000BPS PIAFS64K */
- TAPI_SAT_BIP_DR_28800BPS_MULTIMEDIA = 130, /**< CSD data rate -28800BPS MULTIMEDIA */
- TAPI_SAT_BIP_DR_32000BPS_MULTIMEDIA = 131, /**< CSD data rate -32000BPS MULTIMEDIA */
- TAPI_SAT_BIP_DR_33600BPS_MULTIMEDIA = 132, /**< CSD data rate - 33600BPS MULTIMEDIA */
- TAPI_SAT_BIP_DR_56000BPS_MULTIMEDIA = 133, /**< CSD data rate -56000BPS MULTIMEDIA */
- TAPI_SAT_BIP_DR_64000BPS_MULTIMEDIA = 134 /**< CSD data rate -64000BPS MULTIMEDIA */
-} TelSatBearerParamCsdDataRateType_t;
-
-/**
- * @enum TelSatBearerParamCsdBearerServiceType_t
- * This enum lists the SAT bearer parameter csd bearer service
- */
-typedef enum {
- TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_ASYNC_UDI = 0, /**< CSD Bearer service - DATA CIRCUIT ASYNCHRONOUS UDI */
- TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_SYNC = 1, /**< CSD Bearer service - DATA CIRCUIT SYNCHRONOUS UDI */
- TAPI_SAT_BIP_CSD_BS_PAD_ACCESS_ASYNC_UDI = 2, /**< CSD Bearer service - PAD ACCESS ASYNCHRONOUS UDI */
- TAPI_SAT_BIP_CSD_BS_PACKET_ACCESS_SYNC = 3, /**< CSD Bearer service - PACKET ACCESS SYNCHRONOUS UDI */
- TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_ASYNC_RDI = 4, /**< CSD Bearer service - DATA CIRCUIT ASYNCHRONOUS RDI */
- TAPI_SAT_BIP_CSD_BS_DATA_CIRCUIT_SYNC_RDI = 5, /**< CSD Bearer service - DATA CIRCUIT SYNCHRONOUS RDI */
- TAPI_SAT_BIP_CSD_BS_PAD_ACCESS_ASYNC_RDI = 6, /**< CSD Bearer service - PAD ACCESS ASYNCHRONOUS RDI */
- TAPI_SAT_BIP_CSD_BS_PACKET_ACCESS_SYNC_RDI = 7 /**< CSD Bearer service - PACKET ACCESS SYNCHRONOUS RDI */
-} TelSatBearerParamCsdBearerServiceType_t;
-
-/**
- * @enum TelSatBearerParamCsdConnectionElementType_t
- * This enum lists the SAT bearer parameter csd connection element
- */
-typedef enum {
- TAPI_SAT_BIP_CSD_CONN_ELEM_TRANSPARENT = 0, /**< CSD connection element - TRANSPARENT */
- TAPI_SAT_BIP_CSD_CONN_ELEM_NON_TRANSPARENT = 1, /**< CSD connection element - NON TRANSPARENT */
- TAPI_SAT_BIP_CSD_CONN_ELEM_BOTH_TRANSPARENT_PREF = 2, /**< CSD connection element -BOTH TRANSPARENT PREFFERED */
- TAPI_SAT_BIP_CSD_CONN_ELEM_BOTH_NON_TRANSPARENT_PREF = 3 /**< CSD connection element - NON TRANSPARENT PREFFERED */
-} TelSatBearerParamCsdConnectionElementType_t;
-
-/**
- * @enum TelSatBearerParamGprsPrecedenceClassType_t
- * This enum lists the SAT bearer parameter GPRS precedence class. refer TS 23.107
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_PRECED_CLASS_HIGH_PRIORITY = 0x01, /**< GPRS precedence class -HIGH PRIORITY */
- TAPI_SAT_BIP_GPRS_PRECED_CLASS_NORM_PRIORITY = 0x02, /**< GPRS precedence class -NORM PRIORITY */
- TAPI_SAT_BIP_GPRS_PRECED_CLASS_LOW_PRIORITY = 0x03 /**< GPRS precedence class - LOW PRIORITY */
-} TelSatBearerParamGprsPrecedenceClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsDelayClassType_t
- * This enum lists the SAT bearer parameter GPRS delay class.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_DELAY_CLASS_1 = 0x01, /**< GPRS delay class - 1 */
- TAPI_SAT_BIP_GPRS_DELAY_CLASS_2 = 0x02, /**< GPRS delay class - 2 */
- TAPI_SAT_BIP_GPRS_DELAY_CLASS_3 = 0x03, /**< GPRS delay class - 3 */
- TAPI_SAT_BIP_GPRS_DELAY_CLASS_4 = 0x04 /**< GPRS delay class - 4 */
-} TelSatBearerParamGprsDelayClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsReliabilityClassType_t
- * This enum lists the SAT bearer parameter GPRS Reliability class.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_1 = 0x01, /**< GPRS Reliability class -1 */
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_2 = 0x02, /**< GPRS Reliability class -2 */
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_3 = 0x03, /**< GPRS Reliability class -3 */
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_4 = 0x04, /**< GPRS Reliability class -4 */
- TAPI_SAT_BIP_GPRS_RELIABILITY_CLASS_5 = 0x05 /**< GPRS Reliability class -5 */
-} TelSatBearerParamGprsReliabilityClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsPeakThroughputClassType_t
- * This enum lists the SAT bearer parameter GPRS peak throughput class.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_8KBPS = 0x01, /**< GPRS peak throughput class- UPTO 8KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_16KBPS = 0x02, /**< GPRS peak throughput class- UPTO 16KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_32KBPS = 0x03, /**< GPRS peak throughput class-UPTO 32KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_64KBPS = 0x04, /**< GPRS peak throughput class-UPTO 64KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_128KBPS = 0x05, /**< GPRS peak throughput class- UPTO 128KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_256KBPS = 0x06, /**< GPRS peak throughput class- UPTO 256KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_512KBPS = 0x07, /**< GPRS peak throughput class- UPTO 512KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_1024KBPS = 0x08, /**< GPRS peak throughput class-UPTO 1024KBPS */
- TAPI_SAT_BIP_GPRS_PEAK_THROUGHPUT_CLASS_UPTO_2048KBPS = 0x09 /**< GPRS peak throughput class- UPTO 2048KBPS */
-} TelSatBearerParamGprsPeakThroughputClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsMeanThroughputClassType_t
- * This enum lists the SAT bearer parameter GPRS mean throughput class.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_22_BPS = 0x01, /**< GPRS mean throughput class - DOT 22 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_44_BPS = 0x02, /**< GPRS mean throughput class - DOT 44 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_1_DOT_11_BPS = 0x03, /**< GPRS mean throughput class -1 DOT 11 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_2_BPS = 0x04, /**< GPRS mean throughput class -2 DOT 2 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_4_BPS = 0x05, /**< GPRS mean throughput class -2 DOT 4 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_11_DOT_1_BPS = 0x06, /**< GPRS mean throughput class - 11 DOT 1 BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_22BPS = 0x07, /**< GPRS mean throughput class -22BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_44BPS = 0x08, /**< GPRS mean throughput class - 44BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_111BPS = 0x09, /**< GPRS mean throughput class - 111BPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_22_KBPS = 0x0A, /**< GPRS mean throughput class - DOT 22 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_DOT_44_KBPS = 0x0B, /**< GPRS mean throughput class -DOT 44 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_1_DOT_11_KBPS = 0x0C, /**< GPRS mean throughput class -1 DOT 11 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_2_DOT_2_KBPS = 0x0D, /**< GPRS mean throughput class -2 DOT 2 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_4_DOT_4_KBPS = 0x0E, /**< GPRS mean throughput class - 4 DOT 4 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_11_DOT_1_KBPS = 0x0F, /**< GPRS mean throughput class -11 DOT 1 KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_22KBPS = 0x10, /**< GPRS mean throughput class - 22KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_44KBPS = 0x11, /**< GPRS mean throughput class - 44KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_111KBPS = 0x12, /**< GPRS mean throughput class -111KBPS */
- TAPI_SAT_BIP_GPRS_MEAN_THROUGHPUT_CLASS_BEST_EFFORT = 0x13 /**< GPRS mean throughput class - BEST EFFORT */
-} TelSatBearerParamGprsMeanThroughputClassType_t;
-
-/**
- * @enum TelSatBearerParamGprsPdpType_t
- * This enum lists the SAT bearer parameter GPRS pdp type.
- */
-typedef enum {
- TAPI_SAT_BIP_GPRS_PDP_TYPE_IP = 0x02, /**< bearer parameter GPRS pdp type - IP */
- TAPI_SAT_BIP_GPRS_PDP_TYPE_RESERVED = 0xff /**< reserved */
-} TelSatBearerParamGprsPdpType_t;
-
-/**
- * @enum TelSatBearerParamLocalLinksServiceIdentityType_t
- * This enum lists the SAT bearer parameters local links service identity.
- */
-typedef enum {
- TAPI_SAT_BIP_LL_SERVICE_IDENT_VALUE_ASSIGNED_BY_USIM = 0x00, /**< local links service identity - value assigned by USIM */
- TAPI_SAT_BIP_LL_SERVICE_IDENT_VALUE_ASSIGNED_BY_REMOTED_DEVICE = 0xFF /**< local links service identity - value assigned by remote service */
-} TelSatBearerParamLocalLinksServiceIdentityType_t;
-
-/**
- * @enum TelSatChannelStatusType_t
- * This enum lists the SAT channel status type.
- */
-typedef enum {
- TAPI_SAT_CS_LINK_ESTABLISHED_OR_PDP_CTX_NOT_ACTIVATED, /**< channel status type-CS LINK ESTABLISHED OR PDP CTX NOT ACTIVATED */
- TAPI_SAT_CS_LINK_ESTABLISHED_OR_PDP_CTX_ACTIVATED, /**< channel status type-CS LINK ESTABLISHED OR PDP CTX ACTIVATED */
- TAPI_SAT_UICC_SERVER_MODE_TCP_IN_CLOSED_STATE, /**< channel status type-UICC SERVER MODE TCP IN CLOSED STATE */
- TAPI_SAT_UICC_SERVER_MODE_TCP_IN_LISTEN_STATE, /**< channel status type-UICC SERVER MODE TCP IN LISTEN STATE */
- TAPI_SAT_UICC_SERVER_MODE_TCP_IN_ESTABLISHED_STATE, /**< channel status type-UICC SERVER MODE TCP IN ESTABLISHED STATE */
- TAPI_SAT_UICC_SERVER_MODE_RESERVED /**< reserved */
-} TelSatChannelStatusType_t;
-
-/**
- * @enum TelSatChannelStatusInfoType_t
- * This enum lists the SAT channel status info type.
- */
-typedef enum {
- TAPI_SAT_CHANNEL_STATUS_NO_FURTHER_INFO_AVAILABLE = 0, /**< CHANNEL STATUS NO FURTHER INFO AVAILABLE */
- TAPI_SAT_CHANNEL_STATUS_NOT_USED = 1, /**< CHANNEL STATUS NOT USED */
- TAPI_SAT_CHANNEL_STATUS_LINK_DROPPED = 5 /**< CHANNEL STATUS LINK DROPPED */
-} TelSatChannelStatusInfoType_t;
-
-/**
- * @enum TelSatAddressType_t
- * This enum lists the SAT address type.
- */
-typedef enum {
- TAPI_SAT_ADDR_TYPE_IPv4 = 0x21, /**< address type - IPv4 */
- TAPI_SAT_ADDR_TYPE_IPv6 = 0x57, /**< address type - IPv6 */
- TAPI_SAT_ADDR_RESERVED = 0xFF /**< reserved */
-} TelSatAddressType_t;
-
-/**
- * @enum TelSatTransportProtocolType_t
- * This enum lists the SAT transport protocol type.
- */
-typedef enum {
- TAPI_SAT_TP_TYPE_UDP_UICC_CLIENT = 0x01, /**< transport protocol type- UDP UICC CLIENT */
- TAPI_SAT_TP_TYPE_TCP_UICC_CLIENT = 0x02, /**< transport protocol type-TCP UICC CLIENT */
- TAPI_SAT_TP_TYPE_TCP_UICC_SERVER = 0x03 /**< transport protocol type- TCP UICC SERVER */
-} TelSatTransportProtocolType_t;
-
-/**
- * @enum TelSatRemoteEntityAddrCodingType_t
- * This enum lists the SAT remote entity address coding type.
- */
-typedef enum {
- TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_IEEE802_48BIT = 0, /**< remote entity address coding type- IEEE802 48BIT */
- TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_IRDA_32BIT = 1, /**< remote entity address coding type- IRDA 32BIT */
- TAPI_SAT_REMOTE_ENTITY_ADDR_CODING_TYPE_RESERVED = 0xFF /**< reserved */
-} TelSatRemoteEntityAddrCodingType_t;
-
-/**
- * This structure defines the Address data object.
- */
-typedef struct {
- TelSimTypeOfNum_t ton; /**< type of number */
- TelSimNumberingPlanIdentity_t npi; /**< number plan identity */
- unsigned char diallingNumberLen; /**< dialing number length */
- char diallingNumber[TAPI_SAT_DIALLING_NUMBER_LEN_MAX]; /**< dialing number */
-} TelSatAddressInfo_t;
-
-/**
- * This structure defines the data coding scheme object.
- */
-typedef struct {
- int bIsCompressedFormat; /**< flag to verify compressed format */
- TelSatAlphabetFormatType_t alphabetFormat; /**< alphabet format Type */
- TelSatMsgClassType_t msgClass; /**< Type of message class */
- unsigned char rawDcs; /**< raw dcs info */
-} TelSatDataCodingSchemeInfo_t;
-
-/**
- * This structure defines the Alpha ID data object.
- */
-typedef struct {
- int bIsPresent; /**< flag for checking existence of alpha identifier */
- TelSatDataCodingSchemeInfo_t dcs; /**< dcs info */
- unsigned char stringLen; /**< alpha identifier length */
- char string[TAPI_SAT_ALPHA_ID_LEN_MAX]; /**< alpha identifier info */
-} TelSatAlphaIdentifierInfo_t;
-
-/**
- * This structure defines the Sub Address data object.
- */
-typedef struct {
- unsigned char subAddressLen; /**< sub address length */
- char subAddress[TAPI_SAT_SUB_ADDR_LEN_MAX]; /**< sub address */
-} TelSatSubAddressInfo_t;
-
-/**
- * This structure defines the Capability Configuration Parameters data object.
- */
-typedef struct {
- unsigned char dataLen; /**< capability configuration parameter length */
- char data[TAPI_SAT_CCP_DATA_LEN_MAX]; /**< capability configuration parameter */
-} TelSatCapaConfigParamInfo_t;
-
-/**
- * This struct defines the Command qualifier values for send SMS command.
- */
-typedef struct {
- int bIsPackingByMeRequired; /**< flag to verify packing requirement, if FALSE, packing by ME not required */
-} TelSatCmdQualiSendSms_t;
-
-/**
- * This struct defines the Command qualifier values for display text command.
- */
-typedef struct {
- TelSatDisplayTextPriorityType_t msgPriority; /**< message priority */
- TelSatDisplayTextMsgClearType_t msgClear; /**< message clear type */
-} TelSatCmdQualiDisplayText_t;
-
-/**
- * This struct defines the Command qualifier values for get inkey command.
- */
-typedef struct {
- TelSatInkeyType_t inkeyType; /**< inkey type */
- int bIsUsingAlphabetSet; /**< flag for checking whether using alphabet set or not. if FALSE, digits(0-9,*,#and+) only */
- TelSatUseInputAlphabetType_t alphabetType; /**< alphabet type */
- int bIsImmediateResponseRequired;/**< flag for checking whether immediate response required or not */
- int bIsHelpInfoAvailable; /**< flag for checking whether help info available or not. if FALSE, no help information available */
-} TelSatCmdQualiGetInkey_t;
-
-/**
- * This struct defines the Command qualifier values for get input command.
- */
-typedef struct {
- int bIsUsingAlphabetSet; /**< flag for checking whether using alphabet set. if FALSE, digits(0-9,*,#and+) only */
- TelSatUseInputAlphabetType_t alphabetType; /**< alphabet type. only using alphabet set case. */
- int bIsMeEchoUserInput; /**< flag for checking whether ME should echo user input. if FALSE, user input shall not be displayed*/
- int bIsUserInputUnpackedFormat; /**< flag for checking whether user input is in unpacked format or not. if FALSE, user input in SMS packed format */
- int bIsHelpInfoAvailable; /**< flag to verify if help info available or not. if FALSE, no help information available */
-} TelSatCmdQualiGetInput_t;
-
-/**
- * This struct defines the Command qualifier values for play tone command.
- */
-typedef struct {
- TelSatDisplayVibrateAlertType_t vibrateAlert; /**< type of vibrate alert */
-} TelSatCmdQualiPlayTone_t;
-
-/**
- * This struct defines the Command qualifier values for select item command.
- */
-typedef struct {
- TelSatPresentationType_t presentationType; /**< type of presentation. only presentation type specified */
- TelSatSelectionPreferenceType_t selectionPreference; /**< type of selection preference */
- int bIsHelpInfoAvailable; /**< flag for checking whether help info available or not. if FALSE, no help information available */
-} TelSatCmdQualiSelectItem_t;
-
-/**
- * This struct defines the Command qualifier values for setup menu command.
- */
-typedef struct {
- TelSatSelectionPreferenceType_t selectionPreference; /**< type of selection preference */
- int bIsHelpInfoAvailable; /**< flag to verify help info available or not. if FALSE, no help information available */
-} TelSatCmdQualiSetupMenu_t;
-
-/**
- * This struct defines the Command qualifier values for language notification command.
- */
-typedef struct {
- int bSpecificLanguageNotification; /**< flag for specific language notification. if FALSE, non-specific language notification */
-} TelSatCmdQualiLanguageNotification_t;
-
-/**
- * SAT command qualifier open channel
- */
-typedef struct {
- int bIsEstablishImmediateLink; /**< flag whether establishing immediate link or not. if FALSE, on demand link establishment */
- int bIsAutomaticReconnection; /**< flag whether automatic reconnection or not. if FALSE, no automatic reconnection */
- int bIsModeBackground; /**< flag whether background mode or not. */
-} TelSatCmdQualiOpenChannel_t;
-
-/**
- * SAT command qualifier send data
- */
-typedef struct {
- int bIsSendDataImmediately; /**< flag whether to send data immediately or not. if FALSE, store data in Tx buffer*/
-} TelSatCmdQualiSendData_t;
-
-/**
- * This structure contains the command number, type and the qualifier objects of a SATK command.
- */
-typedef struct {
- unsigned char commandNumber; /**< specific command number */
- TelSatCommandType_t commandType; /**< proactive command type */
-
- union {
- TelSatCmdQualiRefresh_t cmdQualiRefresh; /**< refresh command qualifier info */
- TelSatCmdQualiSetupCall_t cmdQualiSetupCall; /**< setup call command qualifier info */
- TelSatCmdQualiSendSms_t cmdQualiSendSms; /**< send sms command qualifier info */
- TelSatCmdQualiDisplayText_t cmdQualiDisplayText; /**< display text command qualifier info */
- TelSatCmdQualiGetInkey_t cmdQualiGetInkey; /**< get inkey command qualifier info */
- TelSatCmdQualiGetInput_t cmdQualiGetInput; /**< get input command qualifier info */
- TelSatCmdQualiPlayTone_t cmdQualiPlayTone; /**< play tone command qualifier info */
- TelSatCmdQualiSelectItem_t cmdQualiSelectItem; /**< select item command qualifier info */
- TelSatCmdQualiSetupMenu_t cmdQualiSetupMenu; /**< setup menu command qualifier info */
- TelSatCmdQualiProvideLocalInfo_t cmdQualiProvideLocalInfo;/**< provide local info command qualifier info */
- TelSatCmdQualiLanguageNotification_t cmdQualiLanguageNotification;/**< language notification command qualifier info */
- TelSatCmdQualiLaunchBrowser_t cmdQualiLaunchBrowser; /**< launch Browser command qualifier info */
- TelSatCmdQualiOpenChannel_t cmdQualiOpenChannel; /**< Open channel command qualifier info */
- TelSatCmdQualiSendData_t cmdQualiSendData; /**< send data command qualifier info */
- } u; /**< Union */
-} TelSatCommandDetailInfo_t;
-
-/**
- * This struct defines the device identity values.
- */
-typedef struct {
- TelSatDeviceIdentitiesTagType_t source; /**< device identity tag for source */
- TelSatDeviceIdentitiesTagType_t destination; /**< device identity for destination */
-} TelSatDeviceIdentitiesInfo_t;
-
-/**
- * This structure defines the Duration data object.
- */
-typedef struct {
- TelSatTimeUnitType_t timeUnit; /**< time units for the duration data */
- unsigned char timeInterval; /**< time interval */
-} TelSatDurationInfo_t;
-
-/**
- * This structure defines the menu item data object.
- */
-typedef struct {
- unsigned char itemId; /**< item identifier */
- unsigned char textLen; /**< text length */
- unsigned char text[TAPI_SAT_ITEM_TEXT_LEN_MAX + 1]; /**< text information */
-} TelSatMenuItemInfo_t;
-
-/**
- * This structure defines the item identifier object.
- */
-typedef struct {
- unsigned char selectedItemIdentifier; /**< selected item identifier */
-} TelSatItemIdentifierInfo_t;
-
-/**
- * This structure defines expected user response length.
- */
-typedef struct {
- unsigned char min; /**< user response length minimum value */
- unsigned char max; /**< user response length maximum value */
-} TelSatRespLenInfo_t;
-
-/**
- * This structure defines RESUlT data object.
- */
-typedef struct {
- TelSatResultType_t generalResult; /**< general result */
- TelSatMeProblemType_t meProblem; /**< additional information on general result */
-} TelSatResultInfo_t;
-
-/**
- * This structure defines RESUlT data object.
- */
-typedef struct {
- TelSatSmsTpduType_t tpduType; /**< SMS TPDU TYPE */
- unsigned char dataLen; /**< SMS TPDU DATA LENGTH */
- unsigned char data[TAPI_SAT_SMS_TPDU_SMS_DATA_LEN_MAX]; /**< SMS TPDU DATA*/
-} TelSatSmsTpduInfo_t;
-
-/**
- * This structure defines SS STRING data object.
- */
-typedef struct {
- TelSimTypeOfNum_t ton; /**< type of number */
- TelSimNumberingPlanIdentity_t npi; /**< number plan identity */
- unsigned char stringLen; /**< ss string length */
- char string[TAPI_SAT_SS_STRING_LEN_MAX]; /**< ss string */
-} TelSatSsStringInfo_t;
-
-/**
- * This structure defines TEXT STRING data object.
- */
-typedef struct {
- int bIsDigitOnly; /**< flag for checking whether only digits used or not */
- TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */
- unsigned short stringLen; /**< text length */
- char string[TAPI_SAT_TEXT_STRING_LEN_MAX + 1]; /**< text string */
-} TelSatTextTypeInfo_t;
-
-/**
- * This structure defines menu item text object.
- */
-typedef struct {
- int bIsDigitOnly; /**< flag for checking whether only digits used or not */
- TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */
- unsigned char stringLen; /**< menu item string length */
- char* pString; /**< Menu Item String */
-} TelSatMenuItemTextInfo_t;
-
-/**
- * This structure defines tone object.
- */
-typedef struct {
- TelSatToneType_t type; /**< tone type */
-} TelSatToneInfo_t;
-
-/**
- * This structure defines USSD string data object.
- */
-typedef struct {
- TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */
- unsigned char ussdStringLen; /**< ussd string length */
- char ussdString[TAPI_SAT_USSD_STRING_LEN_MAX]; /**< ussd string */
-} TelSatUssdStringInfo_t;
-
-/**
- * This structure defines File list data object.
- */
-typedef struct {
- unsigned char fileCount; /**< file count */
-// TelSimFileName_t fileId[TAPI_SAT_FILE_ID_LIST_MAX_COUNT]; /**< file identifier */
-} TelSatFileListInfo_t;
-
-/**
- * This structure defines default text data object.
- */
-typedef struct {
- int bIsPresent; /**< flag for checking whether default text exists or not */
- int bIsDigitOnly; /**< flag for checking whether only digits used or not */
- TelSatDataCodingSchemeInfo_t dcs; /**< data coding scheme */
- unsigned char stringLen; /**< default text string length */
- char string[TAPI_SAT_TEXT_STRING_LEN_MAX]; /**< default text */
-} TelSatDefaultTextInfo_t;
-
-/**
- * This structure defines Next Action Indicator List data object.
- */
-typedef struct {
- unsigned char listCount; /**< next action identifier count */
- unsigned char list[TAPI_SAT_ITEMS_NEXT_ACTION_INDI_LIST_MAX_COUNT]; /**< next action identifier list */
-} TelSatItemsNextActionIndiListInfo_t;
-
-/**
- * This structure defines event list data object.
- */
-typedef struct {
- unsigned char eventListCount; /**< event list count */
- TelSatEventDownloadType_t list[TAPI_SAT_EVENT_LIST_MAX_COUNT]; /**< event list */
-} TelSatEventListInfo_t;
-
-/**
- * This structure defines icon info object.
- */
-typedef struct {
- unsigned char width; /**< icon width */
- unsigned char height; /**< icon height */
- TelSatImageCodingSchemeType_t ics; /**< image coding scheme */
- unsigned short iconDataLen; /**< icon data length */
- unsigned short clutDataLen; /**< clut data length */
- char iconFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX];
- char clutFile[TAPI_SAT_IMG_DATA_FILE_PATH_LEN_MAX];
-} TelSatIconInfo_t;
-
-/**
- * This structure defines icon data object.
- */
-typedef struct {
- int bIsPresent; /**< flag for checking whether icon identifier exists or not */
- TelSatIconQualifierType_t iconQualifier; /**< icon qualifier type */
- unsigned char iconIdentifier; /**< icon identifier */
- TelSatIconInfo_t iconInfo; /**< icon info */
-} TelSatIconIdentifierInfo_t;
-
-/**
- * This structure defines icon identifier data object.
- */
-typedef struct {
- int bIsPresent; /**< flag for checking whether icon identifier exists or not */
- TelSatIconQualifierType_t iconListQualifier; /**< icon list qualifier */
- unsigned char iconCount; /**< icon count */
- unsigned char iconIdentifierList[TAPI_SAT_ICON_LIST_MAX_COUNT]; /**< icon identifier list */
- TelSatIconInfo_t iconInfo[TAPI_SAT_ICON_LIST_MAX_COUNT]; /**< icon list info */
-} TelSatIconIdentifierListInfo_t;
-
-/**
- * This structure defines SAT bc repeat indicator Info
- */
-typedef struct {
- TelSatBcRepeatIndicatorType_t indType; /**< bc repeat indicator type */
-} TelSatBcRepeatIndicatorInfo_t;
-
-/**
- * This structure defines call control strings.
- */
-typedef struct {
- TelSatCallCtrlStringType_t callCtrlStringType; /**< call control type */
- union {
- TelSatAddressInfo_t voiceString; /**< voice call string */
- TelSatSsStringInfo_t ssString; /**< ss string */
- TelSatUssdStringInfo_t ussdString; /**< ussd string */
- } u; /**< Union */
-} TelSatCallCtrlAddressStringInfo_t;
-
-/**
- * This structure defines the Action requested call control data.
- */
-typedef struct {
- TelSatCallCtrlAddressStringInfo_t callCtrlAddString; /**< Call control address string */
- TelSatCapaConfigParamInfo_t ccp1; /**< Capability configuration parameter 1 */
- TelSatSubAddressInfo_t subAddress; /**< Subaddress */
- TelSatAlphaIdentifierInfo_t alphaId; /**< Alpha identifier */
- TelSatBcRepeatIndicatorInfo_t bcRepeatIndicator; /**< Bc repeat indicator */
- TelSatCapaConfigParamInfo_t ccp2; /**< Capability configuration parameter 2 */
-} TelSatCallCtrlRequestedActionInfo_t;
-
-/**
- * This structure defines dtmf string data object.
- */
-typedef struct {
- unsigned char stringLen; /**< dtmf string lengh */
- char dtmfTone[TAPI_SAT_DTMF_STRING_LEN_MAX]; /**< dtmf tone data */
-} TelSatDtmfStringInfo_t;
-
-/**
- * This structure defines language data object.
- */
-typedef struct {
- TelSatLanguageType_t language; /**< language type */
-} TelSatLanguageInfo_t;
-
-/**
- * This structure defines date time and time zone data object.
- */
-typedef struct {
- unsigned char year; /**< year */
- unsigned char month; /**< month */
- unsigned char day; /**< day */
- unsigned char hour; /**< hour */
- unsigned char minute; /**< minute */
- unsigned char second; /**< second */
- unsigned char timeZone; /**< timeZone */
-} TelSatDataTimeZoneInfo_t;
-
-/**
- * This structure defines SAT browser identities.
- */
-typedef struct {
- TelSatBrowserIdentityType_t browserIdentity; /**< browser identity */
-} TelSatBrowserIdentitiesInfo_t;
-
-/**
- * This structure defines SAT browser URL Data Object.
- */
-typedef struct {
- char string[TAPI_SAT_URL_LEN_MAX + 1]; /**< url string */
-} TelSatUrlInfo_t;
-
-/**
- * This structure defines SAT bearer type.
- */
-typedef struct {
- unsigned char listLen; /**< bearer list length */
- TelSatBearerType_t bearerList[TAPI_SAT_BEARER_LIST_MAX_COUNT]; /**< bearer list */
-} TelSatBearerInfo_t;
-
-/**
- * This structure defines SAT provisioning reference.
- */
-typedef struct {
- char provisioningFilePath[TAPI_SAT_PROVISIONING_FILE_PATH_LEN_MAX]; /**< provisioning file path */
-} TelSatProvisioningRefInfo_t;
-
-/**
- * This structure defines SAT browser termination cause.
- */
-typedef struct {
- TelSatBrowserTerminationCauseType_t cause; /**< browser termination cause */
-} TelSatBrowserTerminationCauseInfo_t;
-
-/**
- * This structure defines SAT Csd bearer parameters .
- */
-typedef struct {
- TelSatBearerParamCsdDataRateType_t dataRate; /**< bearer csd data rate */
- TelSatBearerParamCsdBearerServiceType_t bearerService; /**< bearer csd service type */
- TelSatBearerParamCsdConnectionElementType_t connectionElement; /**< bearer connection element type */
-} TelSatBearerParametersCsdInfo_t;
-
-/**
- * This structure defines SAT bearer parameters GPRS.
- */
-typedef struct {
- TelSatBearerParamGprsPrecedenceClassType_t precedenceClass; /**< bearer gprs precedence class */
- TelSatBearerParamGprsDelayClassType_t delayClass; /**< bearer gprs delay */
- TelSatBearerParamGprsReliabilityClassType_t reliabilityClass; /**< bearer gprs reliability */
- TelSatBearerParamGprsPeakThroughputClassType_t peakThroughputClass;/**< bearer gprs peak throughput */
- TelSatBearerParamGprsMeanThroughputClassType_t meanThroughputClass;/**< bearer gprs mean throughput */
- TelSatBearerParamGprsPdpType_t pdpType; /**< bearer gprs pdp type */
-} TelSatBearerParametersGprsInfo_t;
-
-/**
- * This structure defines SAT bearer parameters local links.
- */
-typedef struct {
- TelSatBearerParamLocalLinksServiceIdentityType_t serviceIdentifier; /**< bearer local link service identifier */
- char serviceRecord[TAPI_SAT_BEARER_PARAMS_LEN_MAX]; /**< bearer local link service record */
-} TelSatBearerParametersLocalLinksInfo_t;
-
-/**
- * This structure defines SAT bearer description.
- */
-typedef struct {
- TelSatBearerDescType_t bearerType; /**< bearer type */
- union {
- TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**< csd */
- TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< gprs */
- TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**< local link */
- } bearer_params; /**<Union */
-} TelSatBearerDescriptionInfo_t;
-
-/**
- * This structure defines SAT channel data.
- */
-typedef struct {
- unsigned char channelDataStringLen; /**< channel data length */
- char channelDataString[TAPI_SAT_CHANNEL_DATA_STRING_LEN_MAX]; /**< channel data */
-} TelSatChannelDataInfo_t;
-
-/**
- * This structure defines SAT channel data length.
- */
-typedef struct {
- unsigned char channelDataLen; /**< channel data length */
-} TelSatChannelDataLengthInfo_t;
-
-/**
- * This structure defines SAT buffer size.
- */
-typedef struct {
- unsigned char bufferSize[2]; /**< channel data buffer size */
-} TelSatBufferSizeInfo_t;
-
-/**
- * This structure defines SAT channel status.
- */
-typedef struct {
- unsigned char channelId; /**< channel id */
- TelSatChannelStatusType_t status; /**< channel status */
- TelSatChannelStatusInfoType_t channelInfo; /**< channel status info */
-} TelSatChannelStatusInfo_t;
-
-/**
- * This structure defines SAT other address.
- */
-typedef struct {
- TelSatAddressType_t addressType; /**< channel address type */
- unsigned char addressLen; /**< channel address length */
- char address[TAPI_SAT_OTHER_ADDR_LEN_MAX]; /**< channel address */
-} TelSatOtherAddressInfo_t;
-
-/**
- * This structure defines SIM me interface transport level.
- */
-typedef struct {
- TelSatTransportProtocolType_t transportProtocolType; /**< transport protocol type */
- unsigned short portNumber; /**< port number */
-} TelSatSimMeInterfaceTransportLevelInfo_t;
-
-/**
- * This structure defines SAT network access name.
- */
-typedef struct {
- unsigned char length; /**< network access name length */
- unsigned char netAccName[TAPI_SAT_NET_ACC_NAM_LEN_MAX]; /**< network access name */
-} TelSatnetworkAccessNameInfo_t;
-
-/**
- * This structure defines SAT aid.
- */
-typedef struct {
- char aid[TAPI_SAT_AID_LEN_MAX]; /**< application Id */
-} TelSatAidInfo_t;
-
-/**
- * This structure defines SAT remote entity address.
- */
-typedef struct {
- TelSatRemoteEntityAddrCodingType_t codingType; /**< remote entity address coding type */
- unsigned short length; /**< remote entity address length */
- unsigned char remoteEntityAddress[TAPI_SAT_REMOTE_ENTITY_ADDR_LEN_MAX]; /**< remote entity address data */
-} TelSatRemoteEntityAddressInfo_t;
-
-/**
- * This structure defines SAT text attribute.
- */
-typedef struct {
- unsigned char textFormatting[4]; /**< text attribute -e.g. bold, center align, etc */
-} TelSatTextAttributeInfo_t;
-
-/**
- * This structure defines SAT text attribute list.
- */
-typedef struct {
- unsigned int listCount; /**< text attribute list count */
- TelSatTextAttributeInfo_t list[TAPI_SAT_ITEM_TEXT_ATTRIBUTES_LIST_MAX_COUNT]; /**< text attribute list info */
-} TelSatTextAttributeListInfo_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_SAT_OBJ_H_ */
-
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup SAT_TAPI SAT
- * @{
- *
- * @file TelSatProactvCmd.h
-
- @brief This file serves as a "C" header file defines structures for Tapi SAT Proactive commands and terminal response Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_SAT_PROACTV_CMD_H_
-#define _TEL_SAT_PROACTV_CMD_H_
-
-#include <TelSatObj.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#define TAPI_SAT_MENU_ITEM_COUNT_MAX 40 /**< max count of sat menu items */
-#define TAPI_SAT_PROVISIONING_REF_MAX_COUNT 10 /**< max count of sat provisioning reference */
-
-/**
- * This structure contains the data objects for DISPLAY TEXT proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
-} TelSatMoreTimeIndInfo_t;
-
-/**
- * This structure contains the data objects for DISPLAY TEXT proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatTextTypeInfo_t text; /**< display text info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- int bImmediateRespRequested; /**< flag for checking whether immediate response required or not */
- TelSatDurationInfo_t duration; /**< duration for which text should be displayed */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatDisplayTextIndInfo_t;
-
-/**
- * This structure contains the data objects for GET INKEY proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatTextTypeInfo_t text; /**< display text info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatDurationInfo_t duration; /**< duration for which text should be displayed */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatGetInkeyIndInfo_t;
-
-/**
- * This structure contains the data objects for GET INPUT proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatTextTypeInfo_t text; /**< display text info */
- TelSatRespLenInfo_t respLen; /**< input response length */
- TelSatTextTypeInfo_t defaultText; /**< default text info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatGetInputIndInfo_t;
-
-/**
- * This structure contains the data objects for PLAY TONE proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatToneInfo_t tone; /**< tone info */
- TelSatDurationInfo_t duration; /**< duration for which tone should be played */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatPlayToneIndInfo_t;
-
-/**
- * This structure contains the data objects for SETUP MENU proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- unsigned char menuItemCount; /**< count of menu items */
- TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu item data */
- TelSatItemsNextActionIndiListInfo_t itemNextActionIndList; /**< next action indication list */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatIconIdentifierListInfo_t iconIdList; /**< icon identifier list info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
- TelSatTextAttributeListInfo_t itemTextAttributeList; /**< item text attribute list */
-} TelSatSetupMenuIndInfo_t;
-
-/**
- * This structure contains the data objects for SELECT ITEM proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatItemsNextActionIndiListInfo_t itemNextActionIndList; /**< next action indication list */
- unsigned char defaultItemIdentifier; /**< default item identifier(default selected item id) */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatIconIdentifierListInfo_t iconIdList; /**< icon identifier list info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
- TelSatTextAttributeListInfo_t itemTextAttributeList; /**< item text attribute list */
- unsigned char menuItemCount; /**< count of menu items */
- TelSatMenuItemInfo_t menuItem[TAPI_SAT_MENU_ITEM_COUNT_MAX]; /**< menu item data */
-} TelSatSelectItemIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND SHORT MESSAGE proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatAddressInfo_t address; /**< address for sending sms */
- TelSatSmsTpduInfo_t smsTpdu; /**< sms tpdu info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSendSmsIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND SS proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatSsStringInfo_t ssString; /**< ss string */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSendSsIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND USSD proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatUssdStringInfo_t ussdString; /**< ussd string info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSendUssdIndInfo_t;
-
-/**
- * This structure contains the data objects for SETUP CALL proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAddressInfo_t address; /**< setup call address info*/
- TelSatCapaConfigParamInfo_t ccp; /**< capability configuration parameter */
- TelSatSubAddressInfo_t subAddress; /**< setup call sub address */
- TelSatDurationInfo_t duration; /**< command execution time duration */
- TelSatAlphaIdentifierInfo_t userConfirmPhaseAlphaId;/**< user Confirmation Phase AlphaId */
- TelSatAlphaIdentifierInfo_t callSetupPhaseAlphaId; /**< call Setup Phase AlphaId */
- TelSatIconIdentifierInfo_t userConfirmPhaseIconId; /**< user Confirmation Phase IconId */
- TelSatIconIdentifierInfo_t callSetupPhaseIconId; /**< call Setup Phase IconId */
- TelSatTextAttributeInfo_t userConfirmPhaseTextAttribute; /**< user Confirmation Phase Text Attribute */
- TelSatTextAttributeInfo_t callSetupPhaseTextAttribute; /**< call Setup PhaseText Attribute */
-} TelSatSetupCallIndInfo_t;
-
-/**
- * This structure contains the data objects for REFRESH proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatFileListInfo_t fileList; /**< file list for refresh */
- TelSatAidInfo_t aid; /**< application Id */
-} TelSatRefreshIndInfo_t;
-
-/**
- * This structure contains the data objects for PROVIDE LOCAL INFO proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
-
-} TelSatProvideLocalInfoIndInfo_t;
-
-/**
- * This structure contains the data objects for SETUP EVENT LIST proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatEventListInfo_t eventList; /**< event list contains events which are required by USIM application */
-
-} TelSatSetupEventListIndInfo_t;
-
-/**
- * This structure contains the data objects for SETUP IDLE MODE TEXT proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatTextTypeInfo_t text; /**< text to be shown on idle screen */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSetupIdleModeTextIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND DTMF COMMAND proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatDtmfStringInfo_t dtmfString; /**< dtmf string */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatSendDtmfIndInfo_t;
-
-/**
- * This structure contains the data objects for LANGUAGE NOTIFICATION proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatLanguageInfo_t language; /**< language info from USIM application */
-} TelSatLanguageNotificationIndInfo_t;
-
-/**
- * This structure contains the data objects for LAUNCH BROWSER proactive command indication.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatBrowserIdentitiesInfo_t browserId; /**< browser identity */
- TelSatUrlInfo_t url; /**< url */
- TelSatBearerInfo_t bearer; /**< bearer which is used by browser */
- unsigned char provisioningRefCount; /**< provisioning reference count */
- TelSatProvisioningRefInfo_t provisioningRef[TAPI_SAT_PROVISIONING_REF_MAX_COUNT]; /**< provisioning reference data */
- TelSatTextTypeInfo_t text; /**< display text info */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatLaunchBrowserIndInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL CSB proactive command indication data.
- */
-typedef struct {
- TelSatAddressInfo_t address; /**< channel address */
- TelSatSubAddressInfo_t subAddress; /**< channel sub address */
- TelSatDurationInfo_t duration1; /**< connection require time */
- TelSatDurationInfo_t duration2; /**< connection require time2 */
- TelSatBearerParametersCsdInfo_t bearerParamsCsd; /**< csd info */
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */
- TelSatTextTypeInfo_t userLogin; /**< userLogin */
- TelSatTextTypeInfo_t userPassword; /**< userPassword */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */
- TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */
-} TelSatOpenChannelCsbInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL (packet) proactive command indication data.
- */
-typedef struct {
- TelSatBearerParametersGprsInfo_t bearerParamsGprs; /**< gprs info */
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatnetworkAccessNameInfo_t networkAccessName; /**< networkAccessName */
- TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */
- TelSatTextTypeInfo_t userLogin; /**< userLogin */
- TelSatTextTypeInfo_t userPassword; /**< userPassword */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */
- TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatOpenChannelpdbInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL LOCAL LINK proactive command indication data.
- */
-typedef struct {
- TelSatDurationInfo_t duration1; /**< command execution time duration1 */
- TelSatDurationInfo_t duration2; /**< command execution time duration2 */
- TelSatBearerParametersLocalLinksInfo_t bearerParamsLocalLinks; /**< local link info */
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatTextTypeInfo_t userPassword; /**< userPassword */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */
- TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */
- TelSatRemoteEntityAddressInfo_t remoteEntityAddress; /**< remoteEntityAddress */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatOpenChannelLocalBearerInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL (DEFAULT BEARER) proactive command indication data.
- */
-typedef struct {
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatOtherAddressInfo_t otherAddress; /**< otherAddress */
- TelSatTextTypeInfo_t userLogin; /**< userLogin */
- TelSatTextTypeInfo_t userPassword; /**< userPassword */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel;/**< simMeInterfaceTransportLevel */
- TelSatOtherAddressInfo_t dataDestinationAddress; /**< dataDestinationAddress */
-} TelSatOpenChannelDefaultBearerInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL (UICC Server Mode) proactive command indication data.
- */
-typedef struct {
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
- TelSatSimMeInterfaceTransportLevelInfo_t simMeInterfaceTransportLevel; /**< simMeInterfaceTransportLevel */
-} TelSatOpenChannelUiccServerModeInfo_t;
-
-/**
- * This structure contains the data objects for OPEN CHANNEL proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- int bIsUiccServerMode; /**< flag whether UICC server mode or not */
- TelSatBearerDescType_t bearerType; /**< bearer destination type */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- union {
- TelSatOpenChannelCsbInfo_t csBearer; /**< cs info */
- TelSatOpenChannelpdbInfo_t pdBearer; /**< pbd info */
- TelSatOpenChannelLocalBearerInfo_t locBearer; /**< local link info */
- TelSatOpenChannelDefaultBearerInfo_t defaultBearer; /**< defaultBearer */
- TelSatOpenChannelUiccServerModeInfo_t uiccServerMode; /**< uiccServerMode */
- } details; /**< Open Channel Details */
-} TelSatOpenChannelIndInfo_t;
-
-/**
- * This structure contains the data objects for CLOSE CHANNEL proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatTextAttributeInfo_t textAttribute; /**< text attribute info -e.g. bold, center align */
-} TelSatCloseChannelIndInfo_t;
-
-/**
- * This structure contains the data objects for RECEIVE DATA proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatChannelDataLengthInfo_t channelDataLen; /**< channel data length */
-} TelSatReceiveDataIndInfo_t;
-
-/**
- * This structure contains the data objects for SEND DATA proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
- TelSatAlphaIdentifierInfo_t alphaId; /**< alpha identifier(string) info */
- TelSatIconIdentifierInfo_t iconId; /**< icon identifier info */
- TelSatChannelDataInfo_t channel_data; /**< channel data for sending */
-} TelSatSendDataIndInfo_t;
-
-/**
- * This structure contains the data objects for GET CHANNEL STATUS proactive command indication data.
- */
-typedef struct {
- TelSatCommandDetailInfo_t commandDetail; /**< command detail info. includes command number, type, qualifier */
- TelSatDeviceIdentitiesInfo_t deviceIdentities; /**< device identities info. includes source and destination devices */
-} TelSatGetChannelStatusIndInfo_t;
-
-/**
- * This structure contains the data object for END PROACTIVE SESSION command indication.
- */
-typedef struct {
- TelSatCommandType_t commandType; /**< proactive command type */
-} TelSatEndProactiveSessionIndInfo_t;
-
-/**
- * This structure contains the data objects for PROACTIVE command indication union data.
- */
-typedef struct {
- union {
- TelSatMoreTimeIndInfo_t moreTime;
- TelSatDisplayTextIndInfo_t displayText; /**< Parsed proactive command info from TLV to Telephony data type - display text */
- TelSatGetInkeyIndInfo_t getInkey; /**< Parsed proactive command info from TLV to Telephony data type - getInkey */
- TelSatGetInputIndInfo_t getInput; /**< Parsed proactive command info from TLV to Telephony data type - getInput */
- TelSatPlayToneIndInfo_t playTone; /**< Parsed proactive command info from TLV to Telephony data type - play tone */
- TelSatSetupMenuIndInfo_t setupMenu; /**< Parsed proactive command info from TLV to Telephony data type - setup menu */
- TelSatSelectItemIndInfo_t selectItem; /**< Parsed proactive command info from TLV to Telephony data type - select item */
- TelSatSendSmsIndInfo_t sendSms; /**< Parsed proactive command info from TLV to Telephony data type - send sms */
- TelSatSendSsIndInfo_t sendSs; /**< Parsed proactive command info from TLV to Telephony data type - send ss */
- TelSatSendUssdIndInfo_t sendUssd; /**< Parsed proactive command info from TLV to Telephony data type - send ussd */
- TelSatSetupCallIndInfo_t setupCall; /**< Parsed proactive command info from TLV to Telephony data type - setup call */
- TelSatRefreshIndInfo_t refresh; /**< Parsed proactive command info from TLV to Telephony data type - refresh */
- TelSatProvideLocalInfoIndInfo_t provideLocInfo; /**< Parsed proactive command info from TLV to Telephony data type - provide local info */
- TelSatLaunchBrowserIndInfo_t launchBrowser; /**< Parsed proactive command info from TLV to Telephony data type - launch browser */
- TelSatSetupIdleModeTextIndInfo_t idleText; /**< Parsed proactive command info from TLV to Telephony data type - setup idle mode text */
- TelSatSendDtmfIndInfo_t sendDtmf; /**< Parsed proactive command info from TLV to Telephony data type - send dtmf */
- TelSatLanguageNotificationIndInfo_t languageNotification;/**< Parsed proactive command info from TLV to Telephony data type - language notification */
- TelSatSetupEventListIndInfo_t setupEventList; /**< Parsed proactive command info from TLV to Telephony data type - setup event list */
- TelSatOpenChannelIndInfo_t openChannel; /**< Parsed proactive command info from TLV to Telephony data type - open channel */
- TelSatCloseChannelIndInfo_t closeChannel; /**< Parsed proactive command info from TLV to Telephony data type - close channel */
- TelSatReceiveDataIndInfo_t receiveData; /**< Parsed proactive command info from TLV to Telephony data type - receive data */
- TelSatSendDataIndInfo_t sendData; /**< Parsed proactive command info from TLV to Telephony data type - send data */
- TelSatGetChannelStatusIndInfo_t getChannelStatus; /**< Parsed proactive command info from TLV to Telephony data type - get channel status */
- } cmdInfo; /**< Union */
-} TelSatProactiveCmdData_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of DISPLAY TEXT proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatDisplayTextRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of GET INKEY proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatTextTypeInfo_t text; /**< inserted key info */
- TelSatDurationInfo_t duration;
-} TelSatGetInkeyRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of PLAY TONE proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatPlayToneRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of MORE TIME proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatMoreTimeRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SETUP MENU proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatSetupMenuRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of GET INPUT proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatTextTypeInfo_t text; /**< inserted string info */
-} TelSatGetInputRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SELECT ITEM proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether other information is required or not */
- unsigned char itemIdentifier; /**< item identifier */
-} TelSatSelectItemRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of PROVIDE LOCAL INFORMATION proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether other information is required or not */
- TelSatCmdQualiProvideLocalInfo_t infoType; /**< local info type - e.g. time zone or language info, etc */
- union {
- TelSatDataTimeZoneInfo_t timeZoneInfo; /**< current time zone info */
- TelSatLanguageInfo_t languageInfo; /**< current ME language setting info */
- } u; /**< Union */
-} TelSatProvideLocalInfoRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SETUP EVENT LIST proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatSetupEventListRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND SMS proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< call control problem */
-} TelSatSendSmsRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SET UP CALL proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether other information are required or not */
- TelSatNetworkProblemType_t networkProblem; /**< network problem during setup call */
- TelSatCallCtrlProblemType_t permanentCallCtrlProblem; /**< permanent call control problem */
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */
- TelSatResultInfo_t result2; /**< additional response on general result */
- TelSatTextTypeInfo_t text; /**< text string info */
- int bIsTapiCause; /**< flag to check whether tapi makes problem or not */
- unsigned long tapiCause; /**< tapi call level cause */
- unsigned long tapiSsCause; /**< tapi ss level cause */
-} TelSatSetupCallRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND SS proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether whether other information is required or not */
- TelSatSsProblemType_t additionalSsProblemInfo; /**< additional ss problem */
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< additional call control problem */
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */
- TelSatResultInfo_t result2; /**< additional response on general result */
- TelSatTextTypeInfo_t text; /**< text string info */
-} TelSatSendSsRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND USSD proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag to check whether other information is required or not */
- TelSatUssdProblemType_t additionalUssdProblemInfo; /**< additional ussd problem */
- TelSatCallCtrlProblemType_t additionalCallCtrlProblemInfo; /**< additional call control problem */
- int bCallCtrlHasModification; /**< flag to check whether modification happens during call control */
- TelSatTextTypeInfo_t text; /**< text string info */
- TelSatCallCtrlRequestedActionInfo_t callCtrlRequestedAction; /**< call control requested action info */
- TelSatResultInfo_t result2; /**< additional response on general result */
- TelSatTextTypeInfo_t text2; /**< text string info */
-} TelSatSendUssdRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of REFRESH proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatRefreshRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of GET CHANNEL STATUS proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag whether other information are required or not */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
- TelSatChannelStatusInfo_t channelStatus; /**< channel Status */
-} TelSatGetChannelStatusRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of CLOSE CHANNEL proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
-} TelSatCloseChannelRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of OPEN CHANNEL proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- int bOtherInfo; /**< flag whether other information are required or not */
- TelSatBearerDescriptionInfo_t bearerDescription; /**< bearerDescription */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
- TelSatChannelStatusInfo_t channelStatus; /**< channelStatus */
- TelSatBufferSizeInfo_t bufferSize; /**< bufferSize */
-} TelSatOpenChannelRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of LANGAUGE NOTIFICATION proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatLanguageNotificationRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of LAUNCH BROWSER proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatLaunchBrowserProblemType_t additionalProblemInfo; /**< browser specific problem info */
-} TelSatLaunchBrowserRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of RECEIVE DATA proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
- int bOtherInfo; /**< flag whether other information are required or not */
- TelSatChannelDataInfo_t channel_data; /**< channel data */
- unsigned char channelDataLen; /**< channel data length */
-} TelSatReceiveDataRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND DATA proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
- TelSatBipProblemType_t additionalProblemInfo; /**< bip specific problem info */
- unsigned char channelDataLen; /**< channel data length */
-} TelSatSendDataRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SETUP IDLE MODE TEXT proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatSetupIdlemodeTextRespInfo_t;
-
-/**
- * This structure contains the data objects for the Terminal Response of SEND DTMF proactive command.
- */
-typedef struct {
- TelSatResultInfo_t result; /**< result whether current proactive command request was executed successfully or not */
-} TelSatSendDtmfRespInfo_t;
-
-/**
- * This contains the data structures to be used to send proactive command response.
- */
-typedef struct {
- unsigned char commandNumber; /**< proactive command number */
- TelSatCommandType_t commandType; /**< proactive command type */
- union {
- TelSatMoreTimeRespInfo_t moreTime;
- TelSatDisplayTextRespInfo_t displayText; /**< terminal response info from displayText proactive command */
- TelSatGetInkeyRespInfo_t getInkey; /**< terminal response info from getInkey proactive command */
- TelSatGetInputRespInfo_t getInput; /**< terminal response info from getInput proactive command */
- TelSatPlayToneRespInfo_t playTone; /**< terminal response info from playTone proactive command */
- TelSatSetupMenuRespInfo_t setupMenu; /**< terminal response info from setupMenu proactive command */
- TelSatSelectItemRespInfo_t selectItem; /**< terminal response info from selectItem proactive command */
- TelSatSendSmsRespInfo_t sendSms; /**< terminal response info from sendSms proactive command */
- TelSatSendSsRespInfo_t sendSs; /**< terminal response info from sendSs proactive command */
- TelSatSendUssdRespInfo_t sendUssd; /**< terminal response info from sendUssd proactive command */
- TelSatSetupCallRespInfo_t setupCall; /**< terminal response info from setupCall proactive command */
- TelSatRefreshRespInfo_t refresh; /**< terminal response info from refresh proactive command */
- TelSatProvideLocalInfoRespInfo_t provideLocInfo; /**< terminal response info from provide Local Info proactive command */
- TelSatLaunchBrowserRespInfo_t launchBrowser; /**< terminal response info from launch Browser proactive command */
- TelSatSetupIdlemodeTextRespInfo_t idleText; /**< terminal response info from setup idle mode text proactive command */
- TelSatSendDtmfRespInfo_t sendDtmf; /**< terminal response info from send Dtmf proactive command */
- TelSatLanguageNotificationRespInfo_t languageNotification; /**< terminal response info from language Notification proactive command */
- TelSatSetupEventListRespInfo_t setupEventList; /**< terminal response info from setup Event List proactive command */
- TelSatOpenChannelRespInfo_t openChannel; /**< terminal response info from openChannel proactive command */
- } terminalRespInfo; /**< Union */
-} TelSatRespInfo_t;
-
-/*
- *SAT Icon Data
- */
-
-typedef struct {
- unsigned char iconId;
- unsigned char imgType;
- unsigned char imgLen;
- unsigned char imgData[256];
-} TelSatIconDataResp_t;
-
-typedef struct {
- unsigned char iconId;
- unsigned char imgType;
- unsigned char fileId[2];
- unsigned char reqDataLen[2];
- unsigned char offset[2];
-} TelsatIconDataGet_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _TEL_SAT_PROACTV_CMD_H_ */
-
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup SIM_TAPI SIM
- * @{
- *
- * @file TelSim.h
-
- @brief This file serves as a "C" header file defines structures for Tapi SIM Services. \n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TELSIM_H_
-#define _TELSIM_H_
-
-#include <TelDefines.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/** Maximum ICCID Length */
-#define TAPI_SIM_ICCID_LEN_MAX 20
-
-/** Alpha Id max length */
-#define TAPI_SIM_XDN_ALPHA_ID_MAX_LEN 30
-
-/** Dialing number max length */
-#define TAPI_SIM_XDN_DIALING_NUMBER_LEN 20
-
-/** CSP profile entry count max length */
-#define TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX 11
-
-/** Authentication code max length */
-#define TAPI_SIM_AUTH_MAX_REQ_DATA_LEN 256
-
-/** Authentication response data max length */
-#define TAPI_SIM_AUTH_MAX_RESP_DATA_LEN 128
-
-/** SAP APDU max length */
-#define TAPI_SIM_APDU_MAX_LEN 256+2 // to be fine tuned according to lower layers, 2bytes for SW1 & SW2 should be added
-
-/** SIM 3G Phone book EF Max count */
-#define TAPI_SIM_PB_3G_FILE_MAX_COUNT 13
-
-/** SAP Answer to Reset data max length */
-#define TAPI_SIM_SAP_ATR_DATA 256
-
-#define TAPI_SIM_NET_FULL_NAME_MAX_LEN 40
-
-#define TAPI_SIM_NET_SHORT_NAME_MAX_LEN 10
-
-#define TAPI_SIM_OPERATION_TIMEOUT 1234
-
-/**
- * @enum TelSimCardType_t
- * This enumeration defines the card type.
- */
-typedef enum {
- TAPI_SIM_CARD_TYPE_UNKNOWN, /**< Unknown card */
- TAPI_SIM_CARD_TYPE_GSM, /**< SIm(GSM) card*/
- TAPI_SIM_CARD_TYPE_USIM, /**< USIM card */
- TAPI_SIM_CARD_TYPE_RUIM,
- TAPI_SIM_CARD_TYPE_IMS,
-} TelSimCardType_t;
-
-/**
- * @enum TelSimFileID_t
- * This enumeration defines the card type.
- */
-typedef enum {
- TAPI_SIM_EF_DIR = 0x2F00, /**< Root Directory for the USIM */
- TAPI_SIM_EF_ICCID = 0x2FE2, /**< the ICC Identification file */
- TAPI_SIM_EF_IMSI = 0x6F07, /**< the IMSI file */
- TAPI_SIM_EF_SST = 0x6F38, /**< the SIM Service Table file */
- TAPI_SIM_EF_EST = 0x6F56, /**< the Enabled Service Table file */
- TAPI_SIM_EF_OPLMN_ACT = 0x6F61, /**< the OPLMN List file*/
- TAPI_SIM_EF_GID1 = 0x6F3E, /**< the Group Identifier Level 1 */
- TAPI_SIM_EF_GID2 = 0x6F3F, /**< the Group Identifier Level 2 */
-
- TAPI_SIM_EF_ELP = 0x2F05, /**< the Extended Language Preference file */
- TAPI_SIM_EF_LP = 0x6F05, /**< SIM: Language preference */
- TAPI_SIM_EF_ECC = 0x6FB7, /**< the Emergency Call Codes */
- TAPI_SIM_EF_SPN = 0x6F46, /**< the Service Provider Name */
- TAPI_SIM_EF_SPDI = 0x6FCD, /**< the Service provider display information*/
- TAPI_SIM_EF_PNN = 0x6FC5, /**< the PLMN Network Name File*/
- TAPI_SIM_EF_OPL = 0x6FC6, /**< the Operator PLMN List File*/
- TAPI_SIM_EF_MSISDN = 0x6F40, /**< MSISDN */
-
- TAPI_SIM_EF_SMS = 0x6F3C, /** < Short Messages file */
- TAPI_SIM_EF_SMSP = 0x6F42, /** < SMS Parameter */
- TAPI_SIM_EF_SMSS = 0x6F43, /** < SMS Status */
- TAPI_SIM_EF_CBMI = 0x6F45, /** < Cell Broadcast Message Identifier */
- TAPI_SIM_EF_MBDN = 0x6FC7, /** < SIM Mail Box Dialing Number file */
-
- TAPI_SIM_EF_USIM_MBI = 0x6FC9, /** < Mailbox Identifier -linear fixed*/
- TAPI_SIM_EF_USIM_MWIS = 0x6FCA, /** < Message Waiting Indication Status -linear fixed*/
- TAPI_SIM_EF_USIM_CFIS = 0x6FCB, /** < Call forward indication status -linear fixed*/
-
- /* CPHS FILE ID */
- TAPI_SIM_EF_CPHS_VOICE_MSG_WAITING = 0x6F11, /** < CPHS voice MSG waiting indication */
- TAPI_SIM_EF_CPHS_SERVICE_STRING_TABLE = 0x6F12, /** < CPHS service string table */
- TAPI_SIM_EF_CPHS_CALL_FORWARD_FLAGS = 0x6F13, /** < CPHS call forward flags */
- TAPI_SIM_EF_CPHS_OPERATOR_NAME_STRING = 0x6F14, /** < CPHS operator name string */
- TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE = 0x6F15, /** < CPHS customer service profile */
- TAPI_SIM_EF_CPHS_CPHS_INFO = 0x6F16, /** < CPHS information */
- TAPI_SIM_EF_CPHS_MAILBOX_NUMBERS = 0x6F17, /** < CPHS mail box numbers */
- TAPI_SIM_EF_CPHS_OPERATOR_NAME_SHORT_FORM_STRING = 0x6F18, /** < CPHS operator name short form string */
- TAPI_SIM_EF_CPHS_INFORMATION_NUMBERS = 0x6F19, /** < CPHS information numbers */
- /* CPHS ALS FILE ID */
- TAPI_SIM_EF_CPHS_DYNAMICFLAGS = 0x6F9F, /** < CPHS Dynamics flags */
- TAPI_SIM_EF_CPHS_DYNAMIC2FLAG = 0x6F92, /** < CPHS Dynamics2 flags */
- TAPI_SIM_EF_CPHS_CUSTOMER_SERVICE_PROFILE_LINE2 = 0x6F98, /** < CPHS CSP2 */
-
- /* Invalid File ID, All the file ID are less than this Value*/
- TAPI_SIM_EF_INVALID = 0xFFFF, /**< Invalid file.*/
- TAPI_SIM_EF_OTHERS, /**< Element to indicate an unknown file.*/
-}TelSimFileID_t;
-
-/**
- * @enum TelSimFacilityStatus_t
- * This enumeration defines the pin status.
- */
-typedef enum {
- TAPI_SIM_FACILITY_DISABLED = 0x00,
- TAPI_SIM_FACILITY_ENABLED = 0x01,
- TAPI_SIM_FACILITY_UNKNOWN = 0xFF
-} TelSimFacilityStatus_t;
-
-/**
- * @enum TelSimPinOperationResult_t
- * This enumeration defines the pin operation result from the lower layers.
- */
-typedef enum {
- TAPI_SIM_PIN_OPERATION_SUCCESS, /**< Operation involving PIN (verification/change/enable/disable, etc) is successful. */
- TAPI_SIM_BUSY, /**< SIM is busy */
- TAPI_SIM_CARD_ERROR, /**< SIM card error - Permanently blocked and general errors */
- TAPI_SIM_INCOMPATIBLE_PIN_OPERATION, /**< SIM Incompatible pin operation that is in case when invalid SIM command is given or incorrect parameters are supplied to the SIM. */
- TAPI_SIM_PIN_INCORRECT_PASSWORD, /**< SIM PIN Incorrect password */
- TAPI_SIM_PUK_INCORRECT_PASSWORD, /**< SIM PUK Incorrect Password */
- TAPI_SIM_PUK_REQUIRED, /**< PUK Required */
- TAPI_SIM_PIN_REQUIRED, /**< PIN Required */
- TAPI_SIM_NCK_REQUIRED, /**< Network Control Key Required */
- TAPI_SIM_NSCK_REQUIRED, /**< Network Subset Control Key Required */
- TAPI_SIM_SPCK_REQUIRED, /**< Service Provider Control Key Required */
- TAPI_SIM_CCK_REQUIRED, /**< Corporate Control Key Required */
- TAPI_SIM_LOCK_REQUIRED, /**< PH-SIM (phone-SIM) locked state **/
-} TelSimPinOperationResult_t;
-
-/**
- * @enum TelSimAccessResult_t
- * This enumeration defines the SIM access result from the lower layers.
- */
-typedef enum {
- TAPI_SIM_ACCESS_SUCCESS, /**< Access to file successful. */
- TAPI_SIM_ACCESS_CARD_ERROR, /**< SIM card error */
- TAPI_SIM_ACCESS_FILE_NOT_FOUND, /**< File not found */
- TAPI_SIM_ACCESS_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition is not fulfilled */
- TAPI_SIM_ACCESS_FAILED, /**< Access failed. */
-} TelSimAccessResult_t;
-
-/**
- * @enum TelSimPinType_t
- * This enumeration defines the pin type.
- */
-typedef enum {
- TAPI_SIM_PTYPE_PIN1 = 0x00, /**< PIN 1 code */
- TAPI_SIM_PTYPE_PIN2 = 0x01, /**< PIN 2 code */
- TAPI_SIM_PTYPE_PUK1 = 0x02, /**< PUK 1 code */
- TAPI_SIM_PTYPE_PUK2 = 0x03, /**< PUK 2 code */
- TAPI_SIM_PTYPE_UPIN = 0x04, /**< Universal PIN - Unused now */
- TAPI_SIM_PTYPE_ADM = 0x05, /**< Administrator - Unused now */
- TAPI_SIM_PTYPE_SIM = 0x06 /**< SIM Lock code */
-} TelSimPinType_t;
-
-/**
- * @enum TelSimTypeOfNum_t
- * This enumeration defines the type of number.
- */
-typedef enum {
- TAPI_SIM_TON_UNKNOWN = 0, /**< unknown */
- TAPI_SIM_TON_INTERNATIONAL = 1, /**< international number */
- TAPI_SIM_TON_NATIONAL = 2, /**< national number */
- TAPI_SIM_TON_NETWORK_SPECIFIC = 3, /**< network specific number */
- TAPI_SIM_TON_DEDICATED_ACCESS = 4, /**< subscriber number */
- TAPI_SIM_TON_ALPHA_NUMERIC = 5, /**< alphanumeric, GSM 7-bit default alphabet) */
- TAPI_SIM_TON_ABBREVIATED_NUMBER = 6, /**< abbreviated number */
- TAPI_SIM_TON_RESERVED_FOR_EXT = 7 /**< reserved for extension */
-} TelSimTypeOfNum_t;
-
-/**
- * @enum TelSimTextEncrypt_t
- * This enumeration defines the text encryption types
- */
-typedef enum {
- TAPI_SIM_TEXT_ENC_ASCII, /**< ASCII Encoding */
- TAPI_SIM_TEXT_ENC_GSM7BIT, /**< GSM 7 Bit Encoding */
- TAPI_SIM_TEXT_ENC_UCS2, /**< UCS2 Encoding */
- TAPI_SIM_TEXT_ENC_HEX, /**< HEX Encoding */
-} TelSimTextEncrypt_t;
-
-/**
- * @enum TelSimNumberingPlanIdentity_t
- * This enumeration defines the numbering plan identifier.
- */
-typedef enum {
- TAPI_SIM_NPI_UNKNOWN = 0, /**< Unknown */
- TAPI_SIM_NPI_ISDN_TEL = 1, /**< ISDN/Telephone numbering plan */
- TAPI_SIM_NPI_DATA_NUMBERING_PLAN = 3, /**< Data numbering plan */
- TAPI_SIM_NPI_TELEX = 4, /**< Telex numbering plan */
- TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN = 5, /**< Service Center Specific plan */
- TAPI_SIM_NPI_SVC_CNTR_SPECIFIC_PLAN2 = 6, /**< Service Center Specific plan */
- TAPI_SIM_NPI_NATIONAL = 8, /**< National numbering plan */
- TAPI_SIM_NPI_PRIVATE = 9, /**< Private numbering plan */
- TAPI_SIM_NPI_ERMES_NUMBERING_PLAN = 10, /**< ERMES numbering plan */
- TAPI_SIM_NPI_RESERVED_FOR_EXT = 0xF /**< Reserved for extension */
-} TelSimNumberingPlanIdentity_t;
-
-/**
- * @enum TelSimEccEmergencyServiceInfo_t
- * This enumeration defines the emergency service type.
- */
-typedef enum {
- TAPI_SIM_ECC_ESC_POLICE = 0x01, /**< Police */
- TAPI_SIM_ECC_ESC_AMBULANCE = 0x02, /**< Ambulance */
- TAPI_SIM_ECC_ESC_FIREBRIGADE = 0x04, /**< Fire brigade */
- TAPI_SIM_ECC_ESC_MARAINEGUARD = 0x08, /**< Marine guard */
- TAPI_SIM_ECC_ESC_MOUTAINRESCUE = 0x10, /**< Mountain rescue */
- TAPI_SIM_ECC_ESC_SPARE = 0x00 /**< Spare */
-} TelSimEccEmergencyServiceInfo_t;
-
-/**
- * @enum TelSimLanguagePreferenceCode_t
- * This enumeration defines the language indication code.
- */
-typedef enum {
- TAPI_SIM_LP_GERMAN = 0x00, /**< German */
- TAPI_SIM_LP_ENGLISH = 0x01, /**< English */
- TAPI_SIM_LP_ITALIAN = 0x02, /**< Italian */
- TAPI_SIM_LP_FRENCH = 0x03, /**< French */
- TAPI_SIM_LP_SPANISH = 0x04, /**< Spanish */
- TAPI_SIM_LP_DUTCH = 0x05, /**< Dutch */
- TAPI_SIM_LP_SWEDISH = 0x06, /**< Swedish */
- TAPI_SIM_LP_DANISH = 0x07, /**< Danish */
- TAPI_SIM_LP_PORTUGUESE = 0x08, /**< Portuguese */
- TAPI_SIM_LP_FINNISH = 0x09, /**< Finnish */
- TAPI_SIM_LP_NORWEGIAN = 0x0A, /**< Norwegian */
- TAPI_SIM_LP_GREEK = 0x0B, /**< Greek */
- TAPI_SIM_LP_TURKISH = 0x0C, /**< Turkish */
- TAPI_SIM_LP_HUNGARIAN = 0x0D, /**< Hungarian */
- TAPI_SIM_LP_POLISH = 0x0E, /**< Polish */
- TAPI_SIM_LP_KOREAN = 0x0F, /**< Korean */
- TAPI_SIM_LP_CHINESE = 0x10, /**< Chinese */
- TAPI_SIM_LP_RUSSIAN = 0x11, /**< Russian */
- TAPI_SIM_LP_JAPANESE = 0x12, /**< Japanese */
- TAPI_SIM_LP_LANG_UNSPECIFIED = 0xFF /**< Unspecified */
-} TelSimLanguagePreferenceCode_t;
-
-/**
- * @enum TelSimCardStatus_t
- * This enumeration defines the SIM card status
- */
-typedef enum {
- TAPI_SIM_STATUS_CARD_ERROR = 0x00, /**< Bad card / On the fly SIM gone bad **/
- TAPI_SIM_STATUS_CARD_NOT_PRESENT = 0x01, /**< Card not present **/
- TAPI_SIM_STATUS_SIM_INITIALIZING = 0x02, /**< SIM is Initializing state **/
- TAPI_SIM_STATUS_SIM_INIT_COMPLETED = 0x03, /**< SIM Initialization ok **/
- TAPI_SIM_STATUS_SIM_PIN_REQUIRED = 0x04, /**< PIN required state **/
- TAPI_SIM_STATUS_SIM_PUK_REQUIRED = 0x05, /**< PUK required state **/
- TAPI_SIM_STATUS_CARD_BLOCKED = 0x06, /**< PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed) **/
- TAPI_SIM_STATUS_SIM_NCK_REQUIRED = 0x07, /**< Network Control Key required state **/
- TAPI_SIM_STATUS_SIM_NSCK_REQUIRED = 0x08, /**< Network Subset Control Key required state **/
- TAPI_SIM_STATUS_SIM_SPCK_REQUIRED = 0x09, /**< Service Provider Control Key required state **/
- TAPI_SIM_STATUS_SIM_CCK_REQUIRED = 0x0a, /**< Corporate Control Key required state **/
- TAPI_SIM_STATUS_CARD_REMOVED = 0x0b, /**< Card removed **/
- TAPI_SIM_STATUS_SIM_LOCK_REQUIRED = 0x0c, /**< PH-SIM (phone-SIM) locked state **/
- TAPI_SIM_STATUS_UNKNOWN = 0xff /**< Unknown status. It can be initial status **/
-} TelSimCardStatus_t;
-
-/**
- * @enum TelSimCphsPhaseType_t
- * This enum gives the current CPHS phase of SIM card.
- */
-typedef enum {
- TAPI_SIM_CPHS_PHASE1 = 0x01, /**< phase1 */
- TAPI_SIM_CPHS_PHASE2 = 0x02, /**< phase2 */
- TAPI_SIM_CPHS_PHASE_RFU = 0xff /**< RFU */
-} TelSimCphsPhaseType_t;
-
-/**
- * @enum TelSimCphsIndexLevelIndicator_t
- * This struct gives CPHS index level indication.
- */
-typedef enum {
- TAPI_SIM_CPHS_INDEX_LEVEL_ONE = 0x01, /**< SIM cphs index level one */
- TAPI_SIM_CPHS_INDEX_LEVEL_TWO = 0x02, /**< SIM cphs index level two */
- TAPI_SIM_CPHS_INDEX_LEVEL_THREE = 0x03, /**< SIM cphs index level three */
- TAPI_SIM_CPHS_INDEX_LEVEL_RFU = 0xff /**< SIM cphs index level rfu */
-} TelSimCphsIndexLevelIndicator_t;
-
-/**
- * @enum TelSimCphsCustomerServiceGroup_t
- * This struct gives CPHS group service type information .
- */
-typedef enum {
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_OFFERING = 0x01, /**< Group csp offering*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_RESTRICTION = 0x02, /**< Group csp restriction*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_OTHER_SUPP_SERVICES = 0x03, /**< Group csp supplementary services*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CALL_COMPLETION = 0x04, /**< Group csp completion*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_TELESERVICES = 0x05, /**< Group csp teleservices*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_TELESERVICES = 0x06, /**< Group csp cphs teleservies*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_CPHS_FEATURES = 0x07, /**< Group csp cphs features*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_NUMBER_IDENTIFIERS = 0x08, /**< Group csp number identifiers*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_PHASE_SERVICES = 0x09, /**< Group csp phase services*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_VALUE_ADDED_SERVICES = 0xC0, /**< Group csp value added services*/
- TAPI_SIM_CPHS_CSP_SERVICE_GROUP_INFORMATION_NUMBERS = 0xD5 /**< Group csp information numbers*/
-} TelSimCphsCustomerServiceGroup_t;
-
-/**
- * @enum TelSimMailboxType_t
- * This enum gives mailbox type.
- */
-typedef enum {
- TAPI_SIM_MAILBOX_VOICE = 0x01, /**< CFIS voice*/
- TAPI_SIM_MAILBOX_VOICE2 = 0x02, /**< CFIS voice*/
- TAPI_SIM_MAILBOX_FAX = 0x03, /**< CFIS fax*/
- TAPI_SIM_MAILBOX_DATA = 0x04, /**< CFIS data*/
-} TelSimMailboxType_t;
-
-/**
- * @enum TelSimDynamicFlagsSelectedLineId_t
- * This enum gives dynamics flag selected line information.
- */
-typedef enum {
- TAPI_SIM_DYNAMIC_FLAGS_LINE1 = 0x01, /**< line 1 */
- TAPI_SIM_DYNAMIC_FLAGS_LINE2 = 0x00, /**< line 2*/
- TAPI_SIM_DYNAMIC_FLAGS_RFU = 0xff /**< rfu*/
-} TelSimDynamicFlagsSelectedLineId_t;
-
-/**
- * @enum tapi_sim_dynamic2_flag_als_status_t
- * This enum gives dynamics2 flag selected line information.
- */
-typedef enum {
- TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_LOCKED = 0x01, /**< Dynamic flags locked */
- TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_UNLOCKED = 0x00, /**< Dynamic flags unlocked */
- TAPI_SIM_PIN2_ACCESSIBLE_FLAGS_RFU = 0xff /**< rfu */
-} TelSimDynamic2FlagAlsStatus_t;
-
-
-/**
- * @enum TelSimAuthenticationType_t
- * This is used for Authentication Procedure by using SIM.
- */
-typedef enum {
- TAPI_SIM_AUTH_TYPE_IMS = 0x00, /**< IMS Authentication */
- TAPI_SIM_AUTH_TYPE_GSM, /**< GSM Authentication */
- TAPI_SIM_AUTH_TYPE_3G, /**< 3G Authentication */
- TAPI_SIM_AUTH_TYPE_MAX /**< TBD */
-} TelSimAuthenticationType_t;
-
-/**
- * @enum TelSimAuthenticationResult_t
- * This is used for Authentication Procedure.
- */
-typedef enum {
- TAPI_SIM_AUTH_NO_ERROR = 0x00, /**< ISIM no error */
- TAPI_SIM_AUTH_CANNOT_PERFORM, /**< status - can't perform authentication */
- TAPI_SIM_AUTH_SKIP_RESPONSE, /**< status - skip authentication response */
- TAPI_SIM_AUTH_MAK_CODE_FAILURE, /**< status - MAK(Multiple Activation Key) code failure */
- TAPI_SIM_AUTH_SQN_FAILURE, /**< status - SQN(SeQuenceNumber) failure */
- TAPI_SIM_AUTH_SYNCH_FAILURE, /**< status - synch failure */
- TAPI_SIM_AUTH_UNSUPPORTED_CONTEXT, /**< status - unsupported context */
- TAPI_SIM_AUTH_MAX /**< TBD */
-} TelSimAuthenticationResult_t;
-
-/**
- * @enum TelSimLockType_t
- * This structure gives security lock type enum values
- */
-typedef enum {
- TAPI_SIM_LOCK_PS = 0x01, /** < PH-SIM (phone-SIM) locked.Lock Phone to SIM/UICC card
- * (MT asks password when other than current SIM/UICC card inserted;
- * MT may remember certain amount of previously used cards thus not
- * requiring password when they are inserted
- */
- TAPI_SIM_LOCK_PF, /** < PH-FSIM (phone-first-SIM) Lock Phone to the very
- * First inserted SIM/UICC card(MT asks password when other than the first SIM/UICC
- * card is inserted
- */
- TAPI_SIM_LOCK_SC, /** < SIM Lock (PIN, PIN2, PUK, PUK2) Lock SIM/UICC card ( SIM asks password in ME power-up and
- * when this command is issued
- */
- TAPI_SIM_LOCK_FD, /** < FDN - SIM card or active application in the UICC (GSM or USIM)
- * fixed dialing memory feature */
- TAPI_SIM_LOCK_PN, /**< Network Personalization */
- TAPI_SIM_LOCK_PU, /** < network subset Personalization */
- TAPI_SIM_LOCK_PP, /** < service Provider Personalization */
- TAPI_SIM_LOCK_PC, /** < Corporate Personalization */
-} TelSimLockType_t;
-
-/**
- * @enum TelSimLockKey_t
- * This structure gives security lock key information enum values
- */
-typedef enum {
- TAPI_SIM_LOCK_KEY_NOT_NEED = 0x00, /**< key not need */
- TAPI_SIM_LOCK_KEY_PIN = 0x01, /**< PIN required */
- TAPI_SIM_LOCK_KEY_PUK = 0x02, /**< PUK required */
- TAPI_SIM_LOCK_KEY_PIN2 = 0x03, /**< PIN2 required */
- TAPI_SIM_LOCK_KEY_PUK2 = 0x04, /**< PUK2 required */
- TAPI_SIM_LOCK_PERM_BLOCKED = 0x05, /**< Permanent block SIM */
-} TelSimLockStatus_t;
-
-/**
- * @enum TelSimSapPowerMode_t
- * This enum gives the SAP message Ids between SAP client and SAP server.
- */
-typedef enum {
- TAPI_SIM_SAP_POWER_SIM_ON_REQ, /**< SAP Client request about power SIM on in Server */
- TAPI_SIM_SAP_POWER_SIM_OFF_REQ, /**< SAP Client request about power SIM off in Server */
- TAPI_SIM_SAP_RESET_SIM_REQ, /**< SAP Client request about SIM reset in Server */
-} TelSimSapPowerMode_t;
-
-/**
- * @enum TelSimSapConnectionStatus_t
- * This enum gives the SAP connection status information .
- */
-typedef enum {
- TAPI_SIM_SAP_CONNECTION_STATUS_OK = 0x00, /**< connect successfully */
- TAPI_SIM_SAP_CONNECTION_STATUS_UNABLE_TO_ESTABLISH, /**< unable to establish connection */
- TAPI_SIM_SAP_CONNECTION_STATUS_NOT_SUPPORT_MAX_SIZE, /**< when server does not support message length that client want send */
- TAPI_SIM_SAP_CONNECTION_STATUS_TOO_SMALL_MAX_SIZE /**< when client want to connect with very small message length which is not supported by Server */
-} TelSimSapConnectionStatus_t;
-
-/**
- * @enum TelSimSapDissconnectType_t
- * This enum gives the SAP disconnect type information.
- */
-typedef enum {
- TAPI_SIM_SAP_DISCONNECT_TYPE_GRACEFUL = 0x00, /**< disconnection procedure ends after finishing current work */
- TAPI_SIM_SAP_DISCONNECT_TYPE_IMMEDIATE /**< disconnection procedure ends immediately*/
-} TelSimSapDissconnectType_t;
-
-/**
- * @enum TelSimSapStatusInfo_t
- * This enum gives the SAP current connection status information
- */
-typedef enum {
- TAPI_SIM_SAP_STATUS_UNKNOWN = 0x00, /**< SAP server connection status - unknown*/
- TAPI_SIM_SAP_STATUS_NO_SIM, /**< SAP server connection status - no SIM*/
- TAPI_SIM_SAP_STATUS_NOT_READY, /**< SAP server connection status - not ready*/
- TAPI_SIM_SAP_STATUS_READY, /**< SAP server connection status - ready*/
- TAPI_SIM_SAP_STATUS_CONNECTED /**< SAP server connection status - connected*/
-} TelSimSapStatusInfo_t;
-
-/**
- * @enum TelSimSapCardStatus_t
- * This enum gives the SIM card status if server`s status changed about connection with subscription module
- */
-typedef enum {
- TAPI_SIM_SAP_CARD_STATUS_UNKNOWN = 0x00, /**< SAP server status(card reader status) - unknown*/
- TAPI_SIM_SAP_CARD_STATUS_RESET, /**< SAP server status(card reader status) - reset*/
- TAPI_SIM_SAP_CARD_STATUS_NOT_ACCESSIBLE, /**< SAP server status(card reader status) - not accessible*/
- TAPI_SIM_SAP_CARD_STATUS_REMOVED, /**< SAP server status(card reader status) - removed*/
- TAPI_SIM_SAP_CARD_STATUS_INSERTED, /**< SAP server status(card reader status) - inserted*/
- TAPI_SIM_SAP_CARD_STATUS_RECOVERED /**< SAP server status(card reader status) - recovered*/
-} TelSimSapCardStatus_t;
-
-/**
- * @enum TelSimSapResultCode_t
- * This enum gives the SAP result information.
- */
-typedef enum {
- TAPI_SIM_SAP_RESULT_CODE_OK = 0x00, /**< SAP operation result - ok*/
- TAPI_SIM_SAP_RESULT_CODE_NO_REASON, /**< SAP operation result - no reason*/
- TAPI_SIM_SAP_RESULT_CODE_CARD_NOT_ACCESSIBLE, /**< SAP operation result - not accessible*/
- TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_OFF, /**< SAP operation result - card already power off*/
- TAPI_SIM_SAP_RESULT_CODE_CARD_REMOVED, /**< SAP operation result - card removed*/
- TAPI_SIM_SAP_RESULT_CODE_CARD_ALREADY_POWER_ON, /**< SAP operation result - card already power on*/
- TAPI_SIM_SAP_RESULT_CODE_DATA_NOT_AVAILABLE, /**< SAP operation result - data not available*/
- TAPI_SIM_SAP_RESULT_CODE_NOT_SUPPORT /**< SAP operation result - not support*/
-} TelSimSapResultCode_t;
-
-/**
- * @enum TelSimSapProtocol_t
- * This enum gives SAP transport protocol type
- */
-typedef enum {
- TAPI_SIM_SAP_PROTOCOL_T0, /**< T = 0, character*/
- TAPI_SIM_SAP_PROTOCOL_T1 /**< T = 1, block*/
-} TelSimSapProtocol_t;
-
-/**
- * @enum TelSimPbAccessResult_t
- * This enumeration defines the Phone book access result
- */
-typedef enum {
- TAPI_SIM_PB_SUCCESS, /**< SIM phonebook operation successful. */
- TAPI_SIM_PB_FAIL, /**< SIM phonebook operation failure. */
- TAPI_SIM_PB_INVALID_INDEX, /**< The index passed was not a valid index. */
- TAPI_SIM_PB_INVALID_NUMBER_LENGTH, /**< The number length is exceeds the max length allowed (or 0). */
- TAPI_SIM_PB_INVALID_NAME_LENGTH, /**< The name length is exceeds the max length allowed (or 0). */
- TAPI_SIM_PB_ACCESS_CONDITION_NOT_SATISFIED, /**< Access condition for PB file is not satisfied. */
-} TelSimPbAccessResult_t;
-
-/**
- * @enum TelSimPbFileType_t
- * This enumeration defines different storage types to be selected in SIM or USIM
- */
-typedef enum {
- TAPI_SIM_PB_FDN, /**< Fixed Dialing Number */
- TAPI_SIM_PB_ADN, /**< SIM - ADN */
- TAPI_SIM_PB_SDN, /**< Service Dialing Number */
- TAPI_SIM_PB_3GSIM, /**< USIM - 3G phone book */
- TAPI_SIM_PB_AAS, /**< Additional number Alpha String */
- TAPI_SIM_PB_GAS, /**< Grouping identifier Alpha String */
- TAPI_SIM_PB_UNKNOWNN = 0xFF, /**< Unknown file type */
-} TelSimPbType_t;
-
-/**
- * @enum TelSimPb3GFileType_t
- * This enumeration defines the different storage field types in 3G Phone book.
- */
-typedef enum {
- /* for 3G phone storage field type */
- TAPI_PB_3G_NAME = 0x01, /**< Name */
- TAPI_PB_3G_NUMBER, /**< Number */
- TAPI_PB_3G_ANR1, /**< First Another number*/
- TAPI_PB_3G_ANR2, /**< Second Another number */
- TAPI_PB_3G_ANR3, /**< Third Another number */
- TAPI_PB_3G_EMAIL1, /**< First Email */
- TAPI_PB_3G_EMAIL2, /**< Second Email */
- TAPI_PB_3G_EMAIL3, /**< Third Email */
- TAPI_PB_3G_EMAIL4, /**< Fourth Email */
- TAPI_PB_3G_SNE, /**< Second name entry of main name*/
- TAPI_PB_3G_GRP, /**< Group */
- TAPI_PB_3G_PBC, /** <1 byte control info and 1 byte hidden info*/
-} TelSimPb3GFileType_t;
-
-/**
- * This data structure defines the data for the Imsi information.
- */
-typedef struct {
- char szMcc[3 + 1]; /**< mobile country code */
- char szMnc[3 + 1]; /**< mobile network code */
- char szMsin[10 + 1]; /**< mobile station identification number */
-} TelSimImsiInfo_t;
-
-typedef struct {
- char name[30+1];
- char number[6+1];
- TelSimEccEmergencyServiceInfo_t category;
-}TelSimEcc_t;
-
-typedef struct {
- int ecc_count;
- TelSimEcc_t list[15];
-}TelSimEccList_t;
-
-/**
- *This data structure defines the data which is provided a unique identification number for the (U)ICC.
- */
-typedef struct {
- int icc_length; /**< Integrated Circuit Card number length */
- char icc_num[TAPI_SIM_ICCID_LEN_MAX]; /**< Integrated Circuit Card number */
-} TelSimIccIdInfo_t;
-
-typedef struct {
- int line1;
- int line2;
-}TelSimCallForwardingInfo_t;
-
-typedef struct {
- int line1;
- int line2;
- int fax;
- int video;
-}TelSimMessageWaitingInfo_t;
-
-typedef struct {
- TelSimMailboxType_t type;
- char name[TAPI_SIM_XDN_DIALING_NUMBER_LEN+1];
- char number[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN+1];
- TelSimTypeOfNum_t ton;
-}TelSimMailboxInfo_t;
-
-typedef struct {
- int count;
- TelSimMailboxInfo_t list[4]; //max is 4
-}TelSimMailboxList_t;
-
-/**
- * This data structure represents MSISDN information
- */
-typedef struct {
- char num[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< MSISDN number. If not exist, Null string will be returned*/
- char name[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< MSISDN name. If not exist, Null string will be returned*/
-} TelSimSubscriberInfo_t;
-
-typedef struct {
- int count;
- TelSimSubscriberInfo_t list[3]; //max is 3
-}TelSimMsisdnList_t;
-
-typedef struct {
- char plmn[6+1];
- int b_umts;
- int b_gsm;
-}TelSimOplmnwact_t;
-
-typedef struct {
- int count;
- TelSimOplmnwact_t list[30]; //max is 30
-}TelSimOplmnwactList_t;
-
-typedef struct {
- unsigned char display_condition; /**< display condition (1 byte) */
- unsigned char spn[TAPI_SIM_NET_FULL_NAME_MAX_LEN + 1]; /**< SPN */
-}TelSimSpn_t;
-
-typedef struct {
- unsigned char full_name[TAPI_SIM_NET_FULL_NAME_MAX_LEN + 1];
- unsigned char short_name[TAPI_SIM_NET_SHORT_NAME_MAX_LEN + 1];
-}TelSimCphsNetName_t;
-
-/**
- *This is used for authentication request procedure.
- */
-typedef struct {
- TelSimAuthenticationType_t auth_type; /**< Authentication type */
- int rand_length; /**< the length of RAND */
- int autn_length; /**< the length of AUTN. it is not used in case of GSM AUTH */
- char rand_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< RAND data */
- char autn_data[TAPI_SIM_AUTH_MAX_REQ_DATA_LEN]; /**< AUTN data. it is not used in case of GSM AUTH */
-} TelSimAuthenticationData_t;
-
-/**
- * This is used for result data of authentication.
- */
-typedef struct {
- TelSimAuthenticationType_t auth_type; /**< authentication type */
- TelSimAuthenticationResult_t auth_result; /**< authentication result */
- int resp_length; /**< response length. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
- char resp_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< response data. IMS and 3G case, it stands for RES_AUTS. GSM case, it stands for SRES. */
- int authentication_key_length; /**< the length of authentication key, Kc*/
- char authentication_key[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< the data of of authentication key, Kc*/
- int cipher_length; /**< the length of cipher key length */
- char cipher_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< cipher key */
- int integrity_length; /**< the length of integrity key length */
- char integrity_data[TAPI_SIM_AUTH_MAX_RESP_DATA_LEN]; /**< integrity key */
-} TelSimAuthenticationResponse_t;
-
-
-/**
- * This structure contains information about pin data.
- * SIM PIN DATA. For PIN handling (Change, UnBlock) & for Type of PIN information.
- */
-typedef struct {
- TelSimPinType_t type; /**< Pin type */
- unsigned char* pw; /**< PIN code */
- unsigned int pw_len; /**< PIN code length*/
-} TelSimSecPw_t;
-
-/**
- * This data structure defines the data for the PIN Information.
- */
-typedef struct {
- TelSimPinType_t type; /**< Specifies the PIN or PUK type.*/
- int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
-} TelSimSecResult_t;
-
-/**
- * This structure is used to en/disable facility
- */
-typedef struct {
- TelSimLockType_t lock_type; /**< Facility type */
- unsigned char *pw; /**< password */
- int pw_len; /**< password length */
-} TelSimFacilityPw_t;
-
-typedef struct {
- TelSimLockType_t type; /**< Specifies the PIN or PUK type.*/
- int retry_count; /**< Number of attempts remaining for PIN/PUK verification.*/
-} TelSimFacilityResult_t;
-
-typedef struct {
- TelSimLockType_t type;
- TelSimFacilityStatus_t f_status;
-}TelSimFacilityInfo_t;
-
-/**
- *
- * This structure is used to get information about LOCK_TYPE
- */
-typedef struct {
- TelSimLockType_t lock_type; /**< Lock type */
- TelSimLockStatus_t lock_status; /**< Lock key */
- int retry_count; /**< retry counts */
-} TelSimLockInfo_t;
-
-/**
- * This data structure defines the data for the apdu.
- */
-typedef struct {
- unsigned short apdu_len;
- unsigned char* apdu;
-} TelSimApdu_t;
-
-/**
- * This data structure defines the data for the Response of sending apdu.
- */
-typedef struct {
- unsigned short apdu_resp_len;
- unsigned char apdu_resp[TAPI_SIM_APDU_MAX_LEN];
-} TelSimApduResp_t;
-
-/**
- * This data structure defines the data for the Response of sending apdu.
- */
-typedef struct {
- unsigned short atr_resp_len;
- unsigned char atr_resp[TAPI_SIM_APDU_MAX_LEN];
-} TelSimAtrResp_t;
-
-
-/**CPHS related structs **/
-
-/**
- * This sturcture gives information of available optional CPHS SIM files.
- */
-typedef struct {
- /* Byte 2 - bit1 & 2*/
- int bCustomerServiceProfile; /**< Customer Service Profile (CSP) */
- /* Byte 2 - bit3 & 4*/
- int bServiceStringTable; /**< Service String Table (SST) */
- /* Byte 2 - bit5 & 6*/
- int bMailBoxNumbers; /**< MailBoxNumbers */
- /* Byte 2 - bit7 & 8*/
- int bOperatorNameShortForm; /**< Short form of operator name */
- /* Byte 3 - bit1 & 2*/
- int bInformationNumbers; /**< Information numbers */
-} TelSimCphsServiceTable_t;
-
-/*
- These requirements are additional to the GSM 900 and DCS1800 recommendations.
- They apply to all products which are to be compliant with the CPHS specification.
-
- In addition to those SIM storage fields previously defined in DCS1800 to support
- existing MS features and services, the Association has defined the following fields :-
-
- 1) Call Forwarding flag (mandatory)
- 2) Voice message waiting flag (mandatory)
- 3) PLMN operator name (mandatory)
- 4) Customer Service Profile (CSP) (optional)
- 5) CPHS Information (mandatory)
- 6) Mailbox Numbers (optional)
- 7) Information Numbers (optional)
-
- */
-
-/*
- DATA FIELD - 6F 16: CPHS INFORMATION
- Access Conditions:
- READ CHV1
- UPDATE ADM
- */
-/**
- *
- *This structure gives CPHS information data.
- */
-typedef struct {
- TelSimCphsPhaseType_t CphsPhase; /**< CPHS phase type */
- TelSimCphsServiceTable_t CphsServiceTable; /**< CPHS service table */
-} TelSimCphsInfo_t;
-
-/*
- DATA FIELD -6F 11: Voice message waiting flag
- Access Conditions:
- READ CHV1
- UPDATE CHV1
- */
-/**
- *
- * This struct gives CPHS voice message waiting flag information .
- */
-typedef struct {
- int bWaitVoiceMsgLine1; /**< VoiceMsgLine 1 */
- int bWaitVoiceMsgLine2; /**< VoiceMsgLine 2 */
- int bWaitFaxMsg; /**< FAX Msg */
- int bWaitDataMsg; /**< Data Msg */
-} TelSimCphsVoiceMsgWaitFlagInfo_t;
-
-/*
- DATA FIELD -6F 13: Call forwarding flags
- Access Conditions:
- READ CHV1
- UPDATE CHV1
- */
-/**
- * This struct gives CPHS call forwarding flag information.
- */
-typedef struct {
- int bCallForwardUnconditionalLine1; /**< CallForwardUnconditionalLine 1 */
- int bCallForwardUnconditionalLine2; /**< CallForwardUnconditionalLine 2 */
- int bCallForwardUnconditionalFax; /**< CallForwardUnconditional FAX */
- int bCallForwardUnconditionalData; /**<CallForwardUnconditional data*/
- int bCallForwardUnconditionalSms; /**< CallForwardUnconditional SMS */
- int bCallForwardUnconditionalBearer; /**< CallForwardUnconditional bearer*/
-} TelSimCphsCallForwardingFlagInfo_t;
-
-/*
- DATA FIELD -6F 19: Information Numbers
- Access Conditions:
- READ CHV1
- UPDATE CHV1
- */
-/**
- * This struct gives CPHS information numbers data.
- */
-typedef struct {
- int bUsed; /**< SIM CPHS index level one */
- unsigned char AlphaIdLength; /**< length of alpha identifier */
-
- TelSimCphsIndexLevelIndicator_t IndexLevelIndicator; /**< SIM CPHS index level one */
- int PremiumServiceIndicator; /**< SIM CPHS index level one */
- int NetworkSpecificIndicator; /**< SIM CPHS index level one */
- unsigned char Alpha_id[TAPI_SIM_XDN_ALPHA_ID_MAX_LEN + 1]; /**< Alpha Identifier */
-
- unsigned long DiallingnumLength; /**< Length of BCD number/SSC contents */
- TelSimTypeOfNum_t TypeOfNumber; /**< TON */
- TelSimNumberingPlanIdentity_t NumberingPlanIdentity; /**< NPI */
- char DiallingNum[TAPI_SIM_XDN_DIALING_NUMBER_LEN + 1]; /**< dialing Number/SSC String */
- unsigned char Ext1RecordId; /**< Extensiion1 Record Identifier */
-} TelSimCphsInformationNum_t;
-
-/*
- DATA FIELD- 6F 15: Customer Service Profile (Storing a list of service options which are relevant to that specific customer)
- Access Conditions:
- READ CHV1
- UPDATE CHV1
- */
-/**
- *
- * This struct gives CPHS service call offering information.
- */
-typedef struct {
- int bCallForwardingUnconditional; /**< CallForwarding Unconditional */
- int bCallForwardingOnUserBusy; /**< CallForwarding On UserBusy */
- int bCallForwardingOnNoReply; /**< CallForwarding On NoReply */
- int bCallForwardingOnUserNotReachable; /**< CallForwarding On User Not Reachable */
- int bCallTransfer; /**< Call Transfer */
-} TelSimCphsServiceCallOffering_t;
-
-/**
- *
- * This struct gives CPHS service call restriction information.
- */
-typedef struct {
- int bBarringOfAllOutgoingCalls; /**< Barring Of All Outgoing Calls*/
- int bBarringOfOutgoingInternationalCalls; /**< Barring Of Outgoing International Calls */
- int bBarringOfOutgoingInternationalCallsExceptHplmn; /**< Barring Of Outgoing International Calls Except HPLMN */
- int bBarringOfAllIncomingCallsRoamingOutsideHplmn; /**< Barring Of All Incoming Calls Roaming Outside HPLMN */
- int bBarringOfIncomingCallsWhenRoaming; /**< Barring Of IncomingCalls When Roaming */
-} TelSimCphsServiceCallRestriction_t;
-
-/**
- *
- * This struct gives CPHS service SS information.
- */
-typedef struct {
- int bMultiPartyService; /**< MultiPartyService*/
- int bClosedUserGroup; /**< ClosedUserGroup*/
- int bAdviceOfCharge; /**< AdviceOfCharge*/
- int bPreferentialClosedUserGroup; /**< PreferentialClosedUserGroup*/
- int bClosedUserGroupOutgoingAccess; /**< ClosedUserGroupOutgoingAccess*/
-} TelSimCphsServiceOtherSupplimentaryService_t;
-
-/**
- *
- * This struct gives CPHS service call complete information.
- */
-typedef struct {
- int bCallHold; /**< Call Hold*/
- int bCallWaiting; /**< Call Waiting*/
- int bCompletionOfCallToBusySubscriber; /**< Completion Of Call To Busy Subscriber*/
- int bUserUserSignalling; /**< User User Signaling*/
-} TelSimCphsServiceCallComplete_t;
-
-/**
- *
- * This struct gives CPHS service teleservices information.
- */
-typedef struct {
- int bShortMessageMobileOriginated; /**< Short Message Mobile Originated*/
- int bShortMessageMobileTerminated; /**< Short Message Mobile Terminated*/
- int bShortMessageCellBroadcast; /**< Short Message Cell Broadcast*/
- int bShortMessageReplyPath; /**< Short Message Reply Path*/
- int bShortMessageDeliveryConf; /**< Short Message Delivery Conf*/
- int bShortMessageProtocolIdentifier; /**< Short Message Protocol Identifier*/
- int bShortMessageValidityPeriod; /**< Short Message Validity Period*/
-} TelSimCphsServiceTeleservices_t;
-
-/**
- *
- * This struct gives CPHS alternative line service information.
- */
-typedef struct {
- int bAlternativeLineService; /**< Alternative Line Service*/
-} TelSimCphsServiceCphsTeleservices_t;
-
-/**
- *
- * This struct gives CPHS string service table information.
- */
-typedef struct {
- int bStringServiceTable; /**< String Service Table*/
-} TelSimCphsServiceCphsFeatures_t;
-
-/**
- *
- * This struct gives CPHS service number identifier information.
- */
-typedef struct {
- int bCallingLineIdentificationPresent; /**< Calling Line Identification Present*/
- int bConnectedLineIdentificationRestrict; /**< Connected Line Identification Restrict*/
- int bConnectedLineIdentificationPresent; /**< Connected Line Identification Present*/
- int bMaliciousCallIdentifier; /**< Malicious Call Identifier*/
- int bCallingLineIdentificationSend; /**< Calling Line Identification Send*/
- int bCallingLineIdentificationBlock; /**< Calling Line Identification Block*/
-} TelSimCphsServiceNumberIdentifier_t;
-
-/**
- *
- * This struct gives CPHS service phase services information.
- */
-typedef struct {
- int bMenuForGprs; /**< Menu For GPRS*/
- int bMenuForHighSpeedCsd; /**< Menu For HighSpeedCsd*/
- int bMenuForVoiceGroupCall; /**< Menu For VoiceGroupCall*/
- int bMenuForVoiceBroadcastService; /**< Menu For VoiceBroadcastService*/
- int bMenuForMultipleSubscriberProfile; /**< Menu For MultipleSubscriberProfile*/
- int bMenuForMultipleBand; /**< Menu For MultipleBand*/
-} TelSimCphsServicePhaseServices_t;
-
-/**
- *
- * This struct gives CPHS value added service information.
- */
-typedef struct {
- int bRestrictMenuForManualSelection; /**< RestrictMenu For ManualSelection*/
- int bRestrictMenuForVoiceMail; /**< RestrictMenu For VoiceMail*/
- int bRestrictMenuForMoSmsAndPaging; /**< RestrictMenu For MoSmsAndPaging*/
- int bRestrictMenuForMoSmsWithEmialType; /**< RestrictMenu For MoSmsWithEmialType*/
- int bRestrictMenuForFaxCalls; /**< RestrictMenu For FaxCalls*/
- int bRestrictMenuForDataCalls; /**< RestrictMenu For DataCalls*/
- int bRestrictMenuForChangeLanguage; /**< RestrictMenu For ChangeLanguage*/
-} TelSimCphsServiceValueAddedServices_t;
-
-/**
- *
- * This struct gives CPHS service information number data.
- */
-typedef struct {
- int bInformationNumbers; /**< Information Numbers*/
-} TelSimCphsServiceInformationNumbers_t;
-
-/**
- *
- * This struct gives CPHS service profile entry information.
- */
-typedef struct {
- TelSimCphsCustomerServiceGroup_t CustomerServiceGroup; /**< customer service group*/
- union {
- TelSimCphsServiceCallOffering_t CallOffering; /**< call offering*/
- TelSimCphsServiceCallRestriction_t CallRestriction; /**< call restriction*/
- TelSimCphsServiceOtherSupplimentaryService_t OtherSuppServices; /**< other SS services*/
- TelSimCphsServiceCallComplete_t CallComplete; /**< call complete*/
- TelSimCphsServiceTeleservices_t Teleservices; /**< teleservices*/
- TelSimCphsServiceCphsTeleservices_t CphsTeleservices; /**< CPHS teleservices*/
- TelSimCphsServiceCphsTeleservices_t CphsFeatures; /**< CPHS features*/
- TelSimCphsServiceNumberIdentifier_t NumberIdentifiers; /**< number identifiers*/
- TelSimCphsServicePhaseServices_t PhaseServices; /**< phase services*/
- TelSimCphsServiceValueAddedServices_t ValueAddedServices; /**< value added services*/
- TelSimCphsServiceInformationNumbers_t InformationNumbers; /**< information numbers*/
- } u;
-} TelSimCphsCustomerServiceProfileEntry_t;
-
-/**
- *
- * This struct gives CPHS service profile information.
- */
-typedef struct {
- TelSimCphsCustomerServiceProfileEntry_t ServiceProfileEntry[TAPI_SIM_CPHS_CUSTOMER_SERVICE_PROFILE_ENTRY_COUNT_MAX]; /**< service profile entry*/
-} TelSimCphsCustomerServiceProfileInfo_t;
-
-/**
- *
- * This struct gives dynamics flag selected line information.
- */
-typedef struct {
- TelSimDynamicFlagsSelectedLineId_t DynamicFlags; /**< Dynamic flags information */
-} TelSimDynamicFlagsInfo_t;
-
-/**
- *
- * This struct gives dynamics flag selected line information.
- */
-typedef struct {
- TelSimDynamic2FlagAlsStatus_t Dynamic2Flag; /**< Dynamic flags status */
-} TelSimDynamic2FlagsInfo_t;
-
-
-/**
- * This data structure gives the phone book availability of current SIM.
- */
-typedef struct {
- int b_fdn; /**< Fixed Dialing Number */
- int b_adn; /**< SIM - ADN(2G phonebook */
- int b_sdn; /**< Service Dialing Number */
- int b_3g; /**< USIM - 3G phonebook */
- int b_aas; /**< Additional number Alpha String phonebook */
- int b_gas; /**< Grouping information Alpha String phonebook */
-} TelSimPbList_t;
-
-typedef struct {
- TelSimPbType_t phonebook_type;
- unsigned short index;
- unsigned short next_index; //this field is not used in add/update case
-
- unsigned char name[60];
- TelSimTextEncrypt_t dcs;
-
- unsigned char number[40];
- TelSimTypeOfNum_t ton;
-
- /* following field is valid in only USIM*/
- unsigned char sne[60];
- TelSimTextEncrypt_t sne_dcs;
- unsigned char anr1[40];
- TelSimTypeOfNum_t anr1_ton;
- unsigned char anr2[40];
- TelSimTypeOfNum_t anr2_ton;
- unsigned char anr3[40];
- TelSimTypeOfNum_t anr3_ton;
-
- unsigned char email1[60];
- unsigned char email2[60];
- unsigned char email3[60];
- unsigned char email4[60];
-
- unsigned short group_index; //GRP
- unsigned short pb_control; //PBC
-} TelSimPbRecord_t;
-
-/**
- * This data structure defines the phone book storage count information.
- */
-typedef struct {
- TelSimPbType_t StorageFileType; /**< Storage file type */
- unsigned short TotalRecordCount; /**< Total record count */
- unsigned short UsedRecordCount; /**< Used record count */
-} TelSimPbStorageInfo_t;
-
-/**
- * This data structure gives the phone book entry information.
- */
-typedef struct {
- TelSimPbType_t StorageFileType; /**< Storage file type */
- unsigned short PbIndexMin; /**< Phone book minimum index*/
- unsigned short PbIndexMax; /**< Phone book maximum index */
- unsigned short PbNumLenMax; /**< Phone number maximum length */
- unsigned short PbTextLenMax; /**< Text maximum length */
-} TelSimPbEntryInfo_t;
-
-/**
- *
- This structure gives 3G phone book capability information.
- */
-typedef struct {
- TelSimPb3GFileType_t field_type; /**< 3G phonebook file type */
- unsigned short index_max; /**< max index */
- unsigned short text_max; /**< max text length */
- unsigned short used_count; /**< used record count */
-} TelSimPb3GFileTypeCapabiltyInfo_t;
-
-/**
- *
- * This data structure defines the data for the SIM PHONEBOOK & ITS CAPABILITIES information.
- * It refers to EF_PBR
- */
-typedef struct {
- unsigned short FileTypeCount; /**< phonebook file type count */
- TelSimPb3GFileTypeCapabiltyInfo_t FileTypeInfo[TAPI_SIM_PB_3G_FILE_MAX_COUNT]; /**< phonebook file type information */
-} TelSimPbCapabilityInfo_t;
-
-
-
-/* SAP (SIM Access Profile) related interface structures and enum */
-/**
- * This struct gives the SAP ATR response data information.
- */
-typedef struct {
- int atr_len; /**< SAP ATR response data length */
- unsigned char atr_data[TAPI_SIM_SAP_ATR_DATA]; /**< SAP ATR response data */
-} TelSapAtrInfo_t;
-
-/* SAP transfer APDU request */
-
-/**
- * This data structure gives the SAP APDU data information.
- */
-typedef struct {
- int apdu_len; /**< SAP APDU length */
- unsigned char apdu_data[TAPI_SIM_APDU_MAX_LEN]; /**< SAP APDU data */
-} TelSapApduData_t;
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _TELSIM_H_
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/**
- * @open
- * @ingroup TelephonyAPI
- * @addtogroup SS_TAPI SS(Supplementary services)
- * @{
- *
- * @file TelSs.h
-
- @brief This file serves as a "C" header file and defines structures for Tapi Supplementary Services\n
- It contains a sample set of constants, enums, structs that would be required by applications.
- */
-
-#ifndef _TEL_SS_H_
-#define _TEL_SS_H_
-
-#include <TelDefines.h>
-#include <TelErr.h>
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-/** maximum length of barring password */
-#define TAPI_SS_GSM_BARR_PW_LEN_MAX 4 /**<Maximum length of barring password */
-
-/** maximum length of dial digit */
-#define TAPI_CALL_DIALDIGIT_LEN_MAX 82 /**<maximum length of dial digit *///( To Accommodate Unpacked string length, which will be greater than 182, 182* 8 /7 = 208, Packed len = 182* 7/8 = 160)
-#define TAPI_SS_USSD_DATA_SIZE_MAX 208 /**<User-to-user data maximum size */
-#define TAPI_SS_RECORD_NUM_MAX 5 /**< SS record maximum size */
-#define TAPI_SS_AOC_CURRENCY_LEN_MAX 3 /**< maximum length of AOC currency */
-
-/* Supplementary Svc */
-#define TAPI_SS_ADDRESS_LEN_MAX 40
-#define TAPI_SS_CCBS_SIZE_MAX 5
-#define TAPI_SS_TELECOMM_SERVCE_SIZE_MAX 13
-#define TAPI_SS_PHONE_NUM_LEN_MAX 33
-#define TAPI_SS_MMISTRING_LEN_MAX 33
-#define TAPI_SS_PWD_LEN_MAX 5
-#define TAPI_MAX_RELEASE_COMPLETE_DATA_LEN 260
-#define TAPI_MAX_ULONG 0xffffffff
-
-/**
- * This enumeration defines the call forwarding flavor.
- */
-typedef enum {
- TAPI_SS_CF_WHEN_CFU = 0x01, /* 0x01 : Call Forwarding Unconditional */
- TAPI_SS_CF_WHEN_CFB, /* 0x02 : Call Forwarding Mobile Busy */
- TAPI_SS_CF_WHEN_CFNRy, /* 0x03 : Call Forwarding No Reply */
- TAPI_SS_CF_WHEN_CFNRc, /* 0x04 : Call Forwarding Not Reachable */
- TAPI_SS_CF_WHEN_CF_ALL, /* 0x05 : All Call Forwarding */
- TAPI_SS_CF_WHEN_CFC, /* 0x06 : All Conditional Call Forwarding */
- TAPI_SS_CF_WHEN_MAX /* 0x07 : Max */
-} TelSsForwardWhen_t;
-
-/**
- * The various types of call barring. Note, only one type of incoming barring and only one type of outgoing barring may be active at any time.
- */
-typedef enum {
- TAPI_SS_CB_TYPE_BAOC = 0x01, /* 0x01 : Barring All Outgoing Calls */
- TAPI_SS_CB_TYPE_BOIC, /* 0x02 : Barring Outgoing International Calls */
- TAPI_SS_CB_TYPE_BOIC_NOT_HC, /* 0x03 : Barring Outgoing International Calls
- except to Home Country */
- TAPI_SS_CB_TYPE_BAIC, /* 0x04 : Barring All Incoming Calls */
- TAPI_SS_CB_TYPE_BIC_ROAM, /* 0x05 : Barring Incoming Calls when roam,
- outside of the Home Country */
- TAPI_SS_CB_TYPE_AB, /* 0x06 : All Barring Services */
- TAPI_SS_CB_TYPE_AOB, /* 0x07 : All Outgoing Barring Services */
- TAPI_SS_CB_TYPE_AIB, /* 0x08 : All Incoming Barring Services */
- TAPI_SS_CB_TYPE_BIC_NOT_SIM, /* 0x09 : Barring Incoming Calls which is
- not stored in the SIM memory */
- TAPI_SS_CB_TYPE_MAX
-} TelSsBarringType_t;
-
-/**
- * This enumeration defines the ussd Indication Type
- */
-typedef enum {
- TAPI_SS_USSD_STATUS_NOTIFY = 0x00, /**< notify : to display USSD data to user */
- TAPI_SS_USSD_STATUS_NO_ACTION_REQUIRE = 0x01, /**< No further user action required */
- TAPI_SS_USSD_STATUS_ACTION_REQUIRE = 0x02, /**< Further user action required*/
- TAPI_SS_USSD_STATUS_TERMINATED_BY_NET = 0x03, /**< 0x03 : USSD terminated by network */
- TAPI_SS_USSD_STATUS_OTHER_CLIENT = 0x04, /**< 0x04 : other local client has responded */
- TAPI_SS_USSD_STATUS_NOT_SUPPORT = 0x05, /**< 0x05 : operation not supported */
- TAPI_SS_USSD_STATUS_TIME_OUT = 0x06 /**< 0x06 : Time out when there is no response from network */
-} TelSsUssdStatus_t;
-
-/**
- *
- * This enum defines the values for USSD type.
- */
-typedef enum {
- TAPI_SS_USSD_TYPE_USER_INIT = 0x01, /**< USSD request type User Initiated. */
- TAPI_SS_USSD_TYPE_USER_RSP, /**< USSD request type User Response. */
- TAPI_SS_USSD_TYPE_USER_REL /**< USSD request type User Release. */
-} TelSsUssdType_t;
-
-/**
- * This enumeration defines the call barring operation mode .
- */
-typedef enum {
- TAPI_SS_CB_MODE_ACTIVATE, /**< Activate call barring */
- TAPI_SS_CB_MODE_DEACTIVATE, /**< De Activate call barring */
-} TelSsBarringMode_t;
-
-/**
- * This enumeration defines the call barring operation mode .
- */
-typedef enum {
- TAPI_SS_CW_MODE_ACTIVATE, /**< Activate call barring */
- TAPI_SS_CW_MODE_DEACTIVATE, /**< De Activate call barring */
-} TelSsCallWaitingMode_t;
-
-/**
- * This enumeration defines the call type .
- */
-typedef enum {
- /* TELESERVICE */
- TAPI_SS_CLASS_ALL_TELE=0x10, /* 0x10 : All Teleservices */
- TAPI_SS_CLASS_VOICE=0x11, /* 0x11 : All Voice ( telephony ) */
- TAPI_SS_CLASS_ALL_DATA_TELE=0x12, /* 0x12 : All Data Teleservices */
- TAPI_SS_CLASS_FAX=0x13, /* 0x13 : All Fax Service */
- TAPI_SS_CLASS_SMS=0x16, /* 0x16 : SMS service */
- TAPI_SS_CLASS_VGCS=0x17, /* 0x17 : Voice Group Call Service */
- TAPI_SS_CLASS_VBS=0x18, /* 0x18 : Voice Broadcast */
- TAPI_SS_CLASS_ALL_TELE_EXPT_SMS=0x19, /* 0x19 : All teleservice except SMS */
-
- /* BEARER SERVICE */
- TAPI_SS_CLASS_ALL_BEARER=0x20, /* 0X20 : all bearer services */
- TAPI_SS_CLASS_ALL_ASYNC=0x21, /* 0x21 : All Async services */
- TAPI_SS_CLASS_ALL_SYNC=0x22, /* 0x22 : All sync services*/
- TAPI_SS_CLASS_ALL_CS_SYNC=0x24, /* 0x24 : All Circuit switched sync */
- TAPI_SS_CLASS_ALL_CS_ASYNC=0x25, /* 0x25 : All Circuit switched async */
- TAPI_SS_CLASS_ALL_DEDI_PS=0x26, /* 0x26 : All Dedicated packet Access */
- TAPI_SS_CLASS_ALL_DEDI_PAD=0x27, /* 0x27 : All Dedicated PAD Access */
- TAPI_SS_CLASS_ALL_DATA_CDA=0x28, /*0x28 : All Data CDA*/
-
- /* PLMN SPECIFIC TELESERVICE */
- TAPI_SS_CLASS_PLMN_TELE_ALL = 0x50, /*0x50 : PLMN specific teleservices*/
- TAPI_SS_CLASS_PLMN_TELE_1 = 0x51, /*0x51 :PLMN specific teleservice 1*/
- TAPI_SS_CLASS_PLMN_TELE_2 = 0x52, /*0x52 : PLMN specific teleservice 2*/
- TAPI_SS_CLASS_PLMN_TELE_3 = 0x53, /*0x53 : PLMN specific teleservice 3*/
- TAPI_SS_CLASS_PLMN_TELE_4 = 0x54, /*0x54 : PLMN specific teleservice 4*/
- TAPI_SS_CLASS_PLMN_TELE_5 = 0x55, /*0x55 : PLMN specific teleservice 5*/
- TAPI_SS_CLASS_PLMN_TELE_6 = 0x56, /*0x56 : PLMN specific teleservice 6*/
- TAPI_SS_CLASS_PLMN_TELE_7 = 0x57, /*0x57 : PLMN specific teleservice 7*/
- TAPI_SS_CLASS_PLMN_TELE_8 = 0x58, /*0x58 : PLMN specific teleservice 8*/
- TAPI_SS_CLASS_PLMN_TELE_9 = 0x59, /*0x59 : PLMN specific teleservice 9*/
- TAPI_SS_CLASS_PLMN_TELE_A = 0x60, /*0x60 :PLMN specific teleservice 10*/
- TAPI_SS_CLASS_PLMN_TELE_B = 0x61, /*0x61 :PLMN specific teleservice 11*/
- TAPI_SS_CLASS_PLMN_TELE_C = 0x62, /*0x62 : PLMN specific teleservice 12*/
- TAPI_SS_CLASS_PLMN_TELE_D = 0x63, /*0x63 : PLMN specific teleservice 13*/
- TAPI_SS_CLASS_PLMN_TELE_E = 0x64, /*0x64 : PLMN specific teleservice 14*/
- TAPI_SS_CLASS_PLMN_TELE_F = 0x65, /*0x65 : PLMN specific teleservice 15*/
-
- /* PLMN SPECIFIC BEARER SERVICE */
- TAPI_SS_CLASS_PLMN_BEAR_ALL = 0x70, /*0x70 : All PLMN specific bearer services*/
- TAPI_SS_CLASS_PLMN_BEAR_1 = 0x71, /*0x71 :PLMN specific bearer service 1*/
- TAPI_SS_CLASS_PLMN_BEAR_2 = 0x72, /*0x72 : PLMN specific bearer service 2*/
- TAPI_SS_CLASS_PLMN_BEAR_3 = 0x73, /*0x73 : PLMN specific bearer service 3*/
- TAPI_SS_CLASS_PLMN_BEAR_4 = 0x74, /*0x74 : PLMN specific bearer service 4*/
- TAPI_SS_CLASS_PLMN_BEAR_5 = 0x75, /*0x75 : PLMN specific bearer service 5*/
- TAPI_SS_CLASS_PLMN_BEAR_6 = 0x76, /*0x76 : PLMN specific bearer service 6*/
- TAPI_SS_CLASS_PLMN_BEAR_7 = 0x77, /*0x77 : PLMN specific bearer service 7*/
- TAPI_SS_CLASS_PLMN_BEAR_8 = 0x78, /*0x78 : PLMN specific bearer service 8*/
- TAPI_SS_CLASS_PLMN_BEAR_9 = 0x79, /*0x79 : PLMN specific bearer service 9*/
- TAPI_SS_CLASS_PLMN_BEAR_A = 0x80, /*0x80 : PLMN specific bearer service 10*/
- TAPI_SS_CLASS_PLMN_BEAR_B = 0x81, /*0x81 : PLMN specific bearer service 11*/
- TAPI_SS_CLASS_PLMN_BEAR_C = 0x82, /*0x82 : PLMN specific bearer service 12*/
- TAPI_SS_CLASS_PLMN_BEAR_D = 0x83, /*0x83 : PLMN specific bearer service 13*/
- TAPI_SS_CLASS_PLMN_BEAR_E = 0x84, /*0x84 : PLMN specific bearer service 14*/
- TAPI_SS_CLASS_PLMN_BEAR_F = 0x85, /*0x85 : PLMN specific bearer service 15*/
-
- /* CPHS - AUXILIARY SERVICE */
- TAPI_SS_CLASS_AUX_VOICE = 0x89, /* 0x89 : All Auxiliary Voice ( Auxiliary telephony ) */
-
- TAPI_SS_CLASS_ALL_GPRS_BEARER=0x99, /* 0x99 : All GPRS bearer services */
- TAPI_SS_CLASS_ALL_TELE_BEARER=0xFF, /* 0xFF : all tele and bearer services */
-} TelSsClass_t;
-
-/**
- * This enumeration defines the forward mode .
- */
-typedef enum {
- TAPI_SS_CF_MODE_DISABLE_EV, /**< Deactivate call forwarding */
- TAPI_SS_CF_MODE_ENABLE_EV, /**< Activate call forwarding */
- TAPI_SS_CF_MODE_REGISTRATION_EV, /**< Register Call forwarding */
- TAPI_SS_CF_MODE_ERASURE_EV, /**< De-register call forwarding */
-} TelSsForwardMode_t;
-
-typedef enum {
- TAPI_SS_CF_NO_REPLY_TIME_5_SECS = 5, /**< Timer value set to 5secs*/
- TAPI_SS_CF_NO_REPLY_TIME_10_SECS = 10, /**< Timer value set to 10secs*/
- TAPI_SS_CF_NO_REPLY_TIME_15_SECS = 15, /**< Timer value set to 15secs*/
- TAPI_SS_CF_NO_REPLY_TIME_20_SECS = 20, /**< Timer value set to 20secs*/
- TAPI_SS_CF_NO_REPLY_TIME_25_SECS = 25, /**< Timer value set to 25secs*/
- TAPI_SS_CF_NO_REPLY_TIME_30_SECS = 30, /**< Timer value set to 30secs*/
-} TelSsNoReplyTime_t;
-
-/**
- * Describes whether a supplementary service request was a success or a failure; and if it failed, why.
- */
-typedef enum {
- TAPI_SS_SUCCESS, /**< SS operation was successful */
- TAPI_SS_TIMEREXPIRE, /**< SS operation timer expired on network. */
- TAPI_SS_UNKNOWNSUBSCRIBER, /**< SS error indicating unknown/illegal subscriber. */
- TAPI_SS_BEARERSERVICENOTPROVISIONED, /**<The network returns this error when it is requested to @n
- perform an operation on a supplementary service */
- TAPI_SS_TELESERVICENOTPROVISIONED, /**<The network returns this error when it is requested to perform @n
- an operation on a supplementary service */
- TAPI_SS_ILLEGALSSOPERATION, /**<This error is returned by the network when it is requested to perform an illegal operation @n
- which is defined as not applicable for the relevant supplementary service */
- TAPI_SS_ERRORSTATUS, /**<This error is returned by the network when it is requested to perform an operation @n
- which is not compatible with the current status of the relevant supplementary service. */
- TAPI_SS_NOTAVAILABLE, /**< SS not available in network */
- TAPI_SS_SUBSCRIPTIONVIOLATION, /**< SS service subscription violation. */
- TAPI_SS_INCOMPATIBILITY, /**< This error is returned by the network when it is requested for a supplementary service operation incompatible with the @n
- status of another supplementary service or with the teleservice or bearer service for which the operation is requested */
- TAPI_SS_SYSTEMFAILURE, /**< This error is returned by the network, when it cannot perform an operation because of a failure in the network */
- TAPI_SS_DATAMISSING, /**< This error is returned by the network when an optional parameter is missing in an invoke component @n
- or an inner data structure, while it is required by the context of the request. */
- TAPI_SS_UNEXPECTEDDATAVALUE, /**< SS error indicating unexpected data value on network side *//**< SS operation barred. */
- TAPI_SS_PWREGISTRATIONFAILURE, /**< SS error indicating change password failure. */
- TAPI_SS_NEGATIVEPWCHECK, /**< SS error indicating negative password check. */
- TAPI_SS_FACILITYNOTSUPPORTED, /**< SS service facility not supported */
- TAPI_SS_RESOURCESNOTAVAILABLE, /**< SS error indicating resources not available in network. */
- TAPI_SS_MAXNOMPTYEXCEEDED, /**< SS error indicating Maximum MPTY is reached. */
- TAPI_SS_CALLBARRED, /**< This error is returned by the network to the MS when call independent subscriber control procedures are barred by the operator */
- TAPI_SS_NUMBEROFPWATTEMPTSVIOLATION, /**< SS error indicating barring password attempts violated. */
- TAPI_SS_ABSENTSUBSCRIBER, /**< This error is returned when the subscriber has activated the detach service or the system detects the absence condition */
- TAPI_SS_ILLEGALSUBSCRIBER, /**<This error is returned when illegality of the access has been @n
- established by use of authentication procedure. */
- TAPI_SS_ILLEGALEQUIPMENT, /**<This error is returned when the IMEI check procedure has shown that @n
- the IMEI is blacklisted or not whitelisted */
- TAPI_SS_USSDBUSY, /**< SS error indicating USSD Busy(Already SS / USSD is ongoing). */
- TAPI_SS_UNKNOWNALPHABET, /**< SS error indicating unknown SS data coding of alphabet */
- TAPI_SS_INVALIDDEFLECTEDTONUMBER, /**< SS error indicating the invalid deflected to number. */
- TAPI_SS_DEFLECTIONTOSERVEDSUBSCRIBER, /**< This error is returned if a diversion to the served @n
- subscriber's number was requested. */
- TAPI_SS_SPECIALSERVICECODE, /**< This error is returned if diversion to a special service code was requested. */
- TAPI_SS_REJECTEDBYUSER, /**< SS operation rejected by user. */
- TAPI_SS_REJECTEDBYNETWORK, /**< SS operation rejected by network. */
- TAPI_SS_NET_NOT_ALLOWED_EMERGENCY_CALLS_ONLY, /**< SS operation is not allowed by network. */
- TAPI_SS_UNKNOWNERROR, /**< SS error indicating unknown error */
- TAPI_SS_OEM_NOT_SUPPORTED /**< If oem do not support any of SS requests, then this error will be returned back */
-} TelSsCause_t;
-
-/**
- * The status of a supplementary service feature (e.g. Call Forwarding or Call Barring). @n
- * These enumerated values should be used as masks
- */
-typedef enum {
- TAPI_SS_STATUS_REGISTERED = 0x01, /**< Provisioned & registered (but not active/active-quiescent */
- TAPI_SS_STATUS_PROVISIONED, /**<Provisioned but not registered (or active/active-quiescent) */
- TAPI_SS_STATUS_ACTIVE, /**< Provisioned & registered & active */
- TAPI_SS_STATUS_QUIESCENT, /**< Provisioned & registered & active but quiescent */
- TAPI_SS_STATUS_NOTHING /**< Not provisioned */
-} TelSsStatus_t;
-
-/**
- * These are the four types of identity presentation / restriction services.
- */
-typedef enum {
- TAPI_CALLING_LINE_IDENTITY_PRESENTATION, /**< identify the party calling this phone */
- TAPI_CALLING_LINE_IDENTITY_RESTRICTION, /**< hide the identity of this phone when calling others */
- TAPI_CONNECTED_LINE_IDENTITY_PRESENTATION, /**< identify the party to whom the calling party (this phone) is connected */
- TAPI_CONNECTED_LINE_IDENTITY_RESTRICTION, /**< restrict yourself from being identified by incoming calls, such as forwarded calls */
- TAPI_CALLED_LINE_IDENTITY_PRESENTATION, /**< Called line identity presentation */
- TAPI_CALLING_NAME_PRESENTATION /**< Calling Name Presentation */
-} TelSsLineIdentificationType_t;
-
-/**
- * This enumeration defines the cli service status .
- */
-typedef enum {
- TAPI_CLI_STATUS_NOT_PROVISONED = 0x01, /**<Service not provided by the service provider */
- TAPI_CLI_STATUS_PROVISIONED, /**<Service is provided by the service provider */
- TAPI_CLI_STATUS_ACTIVATED, /**<Service is activated at the network */
- TAPI_CLI_STATUS_UNKOWN, /**<Service status is unknown*/
- TAPI_CLI_STATUS_TEMP_RESTRICTED, /**<Service is temporarily restricted */
- TAPI_CLI_STATUS_TEMP_ALLOWED /**<Service is temporarily allowed */
-} TelSsCliStatus_t;
-
-/**
- * This enumeration defines the values for Cli service type .
- */
-typedef enum {
- TAPI_SS_CLI_CLIP = 0x01, /**< Calling Line Identification Presentation. */
- TAPI_SS_CLI_CLIR = 0x02, /**< Calling Line Identification Restriction. */
- TAPI_SS_CLI_COLP = 0x03, /**< Connected Line Identification Presentation. */
- TAPI_SS_CLI_COLR = 0x04, /**< Connected Line Identification Restriction. */
- TAPI_SS_CLI_CDIP = 0x05, /**< Called Line Identification Presentation. */
- TAPI_SS_CLI_CNAP = 0x06, /**< Calling Name Presentation.*/
-} TelSsCliType_t;
-
-/**
- * This enum defines the values for AOC type.
- */
-typedef enum {
- TAPI_SS_AOC_TYPE_RESET = 0x00, /**< Specifies the Reset MAXACM Value. */
- TAPI_SS_AOC_TYPE_ACM = 0x01, /**< Specifies the Accumulated call meter. */
- TAPI_SS_AOC_TYPE_CCM = 0x02, /**< Specifies the Current call meter. */
- TAPI_SS_AOC_TYPE_MAXACM = 0x04, /**< Specifies the Max accumulated call meter. */
- TAPI_SS_AOC_TYPE_PUC = 0x08 /**< Specifies the Price per unit and currency.*/
-} TelSsAocType_t;
-
-/**
- * This structure defines the different parameters related to forward info.
- */
-typedef struct {
- TelSsClass_t Class;
- TelSsForwardMode_t Mode; /**< Forward Mode */
- TelSsForwardWhen_t Condition; /**< Forward Condition */
- char szPhoneNumber[TAPI_CALL_DIALDIGIT_LEN_MAX]; /**< Phone Number*/
- TelSsNoReplyTime_t NoReplyConditionTimer; /**< No reply wait time 5-30 secs in intervals of 5. */
-} TelSsForwardInfo_t;
-
-/**
- * This structure defines the values for USSD request type.
- */
-typedef struct {
- TelSsUssdType_t Type;
- int Length; /**< USSD String Length */
- char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD String */
-} TelSsUssdMsgInfo_t;
-
-/**
- * This structure defines the different parameters related to call barring.
- */
-typedef struct {
- TelSsClass_t Class; /**< Call type */
- TelSsBarringMode_t Mode; /**< Barring mode */
- TelSsBarringType_t Type; /**< Barring type */
- char szPassword[TAPI_SS_GSM_BARR_PW_LEN_MAX]; /**< password */
-} TelSsBarringInfo_t;
-
-/**
- * This structure defines the different parameters related to call waiting.
- */
-typedef struct {
- TelSsClass_t Class; /**< Call type */
- TelSsCallWaitingMode_t Mode; /**< Waiting mode */
-} TelSsWaitingInfo_t;
-
-/**
- * This structure defines the release complete message notification type.
- */
-typedef struct {
- unsigned char RelCompMsgLen; /**< Specifies the Release complete msg length.*/
- unsigned char szRelCompMsg[TAPI_MAX_RELEASE_COMPLETE_DATA_LEN]; /**< Specifies the Release complete msg. */
-} TelSsRelCompMsgInfo_t;
-
-/**
- * This structure defines the values for AOC request type.
- */
-
-typedef struct {
- float PPM;
- unsigned char CharTypeOfCurrency;
- unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX];
-} TelAocPucInfo_t;
-
-typedef struct {
- TelSsAocType_t AocType; /**< Specifies the AOC type. */
- unsigned int ACM; /**< Specifies the accumulated call meter value. */
- unsigned int MaxAcm; /**< Specifies the maximum value of ACM . */
- float CCM; /**< Specifies the Current call meter value. */
- float PPM; /**< Specifies the Price per unit value. */
- unsigned char CharTypeOfCurrency; /**< Specifies the Char type of currency. */
- unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX]; /**< Specifies the Currency characters. */
-} TelCallAocInfo_t;
-
-/**
- * This structure defines the values for ss call barring record
- */
-typedef struct {
- int record_num;
- struct {
- TelSsClass_t Class;
- TelSsStatus_t Status; /**< SS status */
- TelSsBarringType_t Flavour; /**< Call barring types providing various barring conditions on that basis call be barred */
- } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the Maximum of TAPI_SS_RECORD_NUM_MAX records. */
-} TelSsBarringResp_t;
-
-/**
- * This structure defines the values for ss call forwarding record
- */
-typedef struct {
- int record_num;
- struct {
- TelSsClass_t Class;
- TelSsStatus_t Status; /**< Call forwarding SS status */
- TelSsForwardWhen_t ForwardCondition; /**< Call forward types providing various conditions when call can be forwarded */
- int bCallForwardingNumberPresent; /**< Call forwarding number present or not */
- unsigned char NoReplyWaitTime;
- unsigned char szCallForwardingNumber[TAPI_CALL_DIALDIGIT_LEN_MAX]; /**< forwarded number.[Null Terminated string]*/
- } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the Maximum of TAPI_SS_RECORD_NUM_MAX records. */
-} TelSsForwardResp_t;
-
-/**
- * This structure defines the values for ss call waiting record
- */
-typedef struct {
- int record_num;
- struct {
- TelSsClass_t Class;
- TelSsStatus_t Status; /**< SS status */
- } record[TAPI_SS_RECORD_NUM_MAX]; /**< Specifies the Maximum of TAPI_SS_RECORD_NUM_MAX records. */
-} TelSsWaitingResp_t;
-
-/**
- * This structure defines the values for Calling line identity service
- */
-typedef struct {
- TelSsLineIdentificationType_t Type; /**< Various line identification types */
- TelSsCliStatus_t Status; /**< Line identification status from network */
-} TelSsCliResp_t;
-
-typedef struct {
- TelSsUssdType_t Type;
- TelSsUssdStatus_t Status;
- int Length; /**< USSD String Length */
- char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD String */
-} TelSsUssdResp_t;
-
-typedef struct {
- TelSsUssdStatus_t Status;
- int Length; /**< USSD String Length */
- char szString[TAPI_SS_USSD_DATA_SIZE_MAX]; /**< USSD String */
-} TelSsUssdNoti_t;
-
-typedef struct {
- float PPM; /**< Specifies the Price per unit value. */
- unsigned char CharTypeOfCurrency; /**< Specifies the Char type of currency. */
- unsigned char szCurrency[TAPI_SS_AOC_CURRENCY_LEN_MAX]; /**< Specifies the Currency characters. */
-} TelSsAoc_ppm_info_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif // _TEL_SS_H_
-/**
- * @}
- */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <sys/types.h>
-#include <sys/xattr.h>
-#include <errno.h>
-#include <aul.h>
-#include <appsvc.h>
-#include <bundle.h>
-
-#include "TelSat.h"
-#include "sat_ui_support.h"
-
-static Storage *strg_vconf = NULL;
-
-static gboolean _sat_ui_support_processing_setup_menu_ind(GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatSetupMenuInfo_t setup_menu;
-
- gchar *title;
- gint command_id, item_cnt;
- gboolean b_present, b_helpinfo, b_updated;
- GVariant *items = NULL, *icon_id, *icon_list;
-
- memset(&setup_menu, 0, sizeof(TelSatSetupMenuInfo_t));
-
- g_variant_get(data, "(ibs@vibb@v@v)", &command_id, &b_present, &title, &items, &item_cnt,
- &b_helpinfo, &b_updated, &icon_id, &icon_list);
-
- setup_menu.commandId = command_id;
- setup_menu.bIsMainMenuPresent = (b_present ? 1 : 0);
- memcpy(setup_menu.satMainTitle, title, TAPI_SAT_DEF_TITLE_LEN_MAX+1);
- setup_menu.satMainMenuNum = item_cnt;
- if(items && item_cnt > 0){
- int index = 0;
- GVariant *unbox;
- GVariantIter *iter;
-
- gchar *item_str;
- gint item_id;
- unbox = g_variant_get_variant(items);
- dbg("items(%p) items type_format(%s)", items, g_variant_get_type_string(unbox));
-
- g_variant_get(unbox, "a(si)", &iter);
- while(g_variant_iter_loop(iter,"(si)",&item_str, &item_id)){
- setup_menu.satMainMenuItem[index].itemId = item_id;
- memcpy(setup_menu.satMainMenuItem[index].itemString, item_str, TAPI_SAT_DEF_ITEM_STR_LEN_MAX + 6);
- index++;
- }
- g_variant_iter_free(iter);
- }
- setup_menu.bIsSatMainMenuHelpInfo = (b_helpinfo ? 1 : 0);
- setup_menu.bIsUpdatedSatMainMenu = (b_updated ? 1 : 0);
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SETUP_MENU);
- encoded_data = g_base64_encode((const guchar*)&setup_menu, sizeof(TelSatSetupMenuInfo_t));
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("setup menu ind (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_processing_display_text_ind(GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatDisplayTextInd_t display_text;
-
- gchar* text;
- gint command_id, text_len, duration;
- gboolean high_priority, user_rsp_required, immediately_rsp;
- GVariant *icon_id = NULL;
-
- memset(&display_text, 0, sizeof(TelSatDisplayTextInd_t));
-
- g_variant_get(data, "(isiibbb@v)", &command_id, &text, &text_len, &duration,
- &high_priority, &user_rsp_required, &immediately_rsp, &icon_id);
-
- display_text.commandId = command_id;
- memcpy(display_text.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
- display_text.text.stringLen = text_len;
- display_text.duration = duration;
- display_text.bIsPriorityHigh = (high_priority ? 1 : 0);
- display_text.bIsUserRespRequired = (user_rsp_required ? 1 : 0);
- display_text.b_immediately_resp = (immediately_rsp ? 1 : 0);
- dbg("duration(%d) user_rsp(%d) immediately_rsp(%d)", duration, user_rsp_required, immediately_rsp);
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_DISPLAY_TEXT);
- encoded_data = g_base64_encode((const guchar*)&display_text, sizeof(TelSatDisplayTextInd_t));
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("display text ind (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_processing_select_item_ind(GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatSelectItemInd_t select_item;
-
- gboolean help_info ;
- gchar *selected_text;
- gint command_id, default_item_id, menu_cnt, text_len =0;
- GVariant *menu_items, *icon_id, *icon_list;
-
- memset(&select_item, 0, sizeof(TelSatSelectItemInd_t));
-
- g_variant_get(data, "(ibsiii@v@v@v)", &command_id, &help_info, &selected_text,
- &text_len, &default_item_id, &menu_cnt, &menu_items, &icon_id, &icon_list);
-
- select_item.commandId = command_id;
- select_item.bIsHelpInfoAvailable = (help_info ? 1 : 0);
- memcpy(select_item.text.string, selected_text, TAPI_SAT_DEF_TITLE_LEN_MAX+1);
- select_item.text.stringLen = text_len;
- select_item.defaultItemIndex = default_item_id;
- select_item.menuItemCount = menu_cnt;
- if(menu_items && menu_cnt > 0){
- int index = 0;
- GVariant *unbox;
- GVariantIter *iter;
-
- gchar *item_str;
- gint item_id, item_len;
- unbox = g_variant_get_variant(menu_items);
- dbg("items(%p) items type_format(%s)", menu_items, g_variant_get_type_string(unbox));
-
- g_variant_get(unbox, "a(iis)", &iter);
- while(g_variant_iter_loop(iter,"(iis)",&item_id, &item_len, &item_str)){
- select_item.menuItem[index].itemId = item_id;
- select_item.menuItem[index].textLen = item_len;
- memcpy(select_item.menuItem[index].text, item_str, TAPI_SAT_ITEM_TEXT_LEN_MAX + 1);
- index++;
- }
- g_variant_iter_free(iter);
- }
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SELECT_ITEM);
- encoded_data = g_base64_encode((const guchar*)&select_item, sizeof(TelSatSelectItemInd_t));
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("select item aul (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_processing_get_inkey_ind(GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatGetInkeyInd_t get_inkey;
-
- gint command_id, key_type, input_character_mode;
- gint text_len, duration;
- gboolean b_numeric, b_help_info;
- gchar *text;
- GVariant *icon_id;
-
- memset(&get_inkey, 0, sizeof(TelSatGetInkeyInd_t));
-
- g_variant_get(data, "(iiibbsii@v)", &command_id, &key_type, &input_character_mode,
- &b_numeric,&b_help_info, &text, &text_len, &duration, &icon_id);
-
- get_inkey.commandId = command_id;
- get_inkey.keyType = key_type;
- get_inkey.inputCharMode = input_character_mode;
- get_inkey.bIsNumeric = (b_numeric ? 1 : 0);
- get_inkey.bIsHelpInfoAvailable = (b_help_info ? 1 : 0);
- memcpy(get_inkey.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
- get_inkey.text.stringLen = text_len;
- get_inkey.duration = duration;
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_GET_INKEY);
- encoded_data = g_base64_encode((const guchar*)&get_inkey, sizeof(TelSatGetInkeyInd_t));
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("get inkey aul (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_processing_get_input_ind(GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatGetInputInd_t get_input;
-
- gint command_id, input_character_mode;
- gint text_len, def_text_len, rsp_len_min, rsp_len_max;
- gboolean b_numeric, b_help_info, b_echo_input;
- gchar *text, *def_text;
- GVariant *icon_id;
-
- memset(&get_input, 0, sizeof(TelSatGetInputInd_t));
-
- g_variant_get(data, "(iibbbsiiisi@v)", &command_id, &input_character_mode, &b_numeric, &b_help_info, &b_echo_input,
- &text, &text_len, &rsp_len_max, &rsp_len_min, &def_text, &def_text_len, &icon_id);
-
- get_input.commandId = command_id;
- get_input.inputCharMode = input_character_mode;
- get_input.bIsNumeric = (b_numeric ? 1 : 0);
- get_input.bIsHelpInfoAvailable = (b_help_info ? 1 : 0);
- get_input.bIsEchoInput = (b_echo_input ? 1 : 0);
- memcpy(get_input.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
- get_input.text.stringLen = text_len;
- get_input.respLen.max = rsp_len_max;
- get_input.respLen.min = rsp_len_min;
- memcpy(get_input.defaultText.string, def_text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
- get_input.defaultText.stringLen = def_text_len;
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_GET_INPUT);
- encoded_data = g_base64_encode((const guchar*)&get_input, sizeof(TelSatGetInputInd_t));
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("get input aul (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_processing_refresh_ind(GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatRefreshIndUiInfo_t refresh_info;
-
- gint command_id = 0;
- gint refresh_type =0;
- GVariant *file_list = NULL;
-
- memset(&refresh_info, 0, sizeof(TelSatRefreshIndUiInfo_t));
-
- dbg("refresh type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(ii@v)", &command_id, &refresh_type, &file_list);
-
- refresh_info.commandId = command_id;
- refresh_info.duration = 10000;
- refresh_info.refreshType = refresh_type;
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_REFRESH);
- encoded_data = g_base64_encode((const guchar*)&refresh_info, sizeof(TelSatRefreshIndUiInfo_t));
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("get input aul (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_processing_play_tone_ind(GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatPlayToneInd_t play_tone_info;
-
- gint command_id, tone_type, duration;
- gint text_len;
- gchar* text;
- GVariant *icon_id;
-
- memset(&play_tone_info, 0, sizeof(TelSatPlayToneInd_t));
-
- g_variant_get(data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &tone_type, &duration);
-
- play_tone_info.commandId = command_id;
- play_tone_info.duration = duration;
- play_tone_info.text.stringLen = text_len;
- memcpy(play_tone_info.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
- play_tone_info.tone.type = tone_type;
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_PLAY_TONE);
- encoded_data = g_base64_encode((const guchar*)&play_tone_info, sizeof(TelSatPlayToneInd_t));
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("play tone ind (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_processing_idle_mode_text_ind(GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatSetupIdleModeTextInd_t idle_mode_text_info;
-
- gint command_id, text_len;
- gchar* text;
- GVariant *icon_id;
-
- memset(&idle_mode_text_info, 0, sizeof(TelSatSetupIdleModeTextInd_t));
-
- g_variant_get(data, "(isi@v)", &command_id, &text, &text_len, &icon_id);
-
- idle_mode_text_info.commandId = command_id;
- idle_mode_text_info.text.stringLen = text_len;
- memcpy(idle_mode_text_info.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT);
- encoded_data = g_base64_encode((const guchar*)&idle_mode_text_info, sizeof(TelSatSetupIdleModeTextInd_t));
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("setup idle mode text ind (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_processing_ui_info_ind(enum tel_sat_proactive_cmd_type cmd, GVariant *data)
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd_type = NULL;
- TelSatSendUiInfo_t ui_info;
-
- gint command_id, text_len;
- gboolean user_confirm;
- gchar *text;
-
- memset(&ui_info, 0, sizeof(TelSatSendUiInfo_t));
-
- g_variant_get(data, "(isib)", &command_id, &text, &text_len, &user_confirm);
- dbg("command_id(%d) data(%s) len(%d) user_confirm(%d)", command_id, text, text_len, user_confirm);
-
- ui_info.commandId = command_id;
- memcpy(ui_info.text.string, text, TAPI_SAT_DEF_TEXT_STRING_LEN_MAX+1);
- ui_info.text.stringLen = text_len;
- ui_info.user_confirm = (user_confirm ? 1 : 0);
-
- cmd_type = g_strdup_printf("%d", cmd);
- encoded_data = g_base64_encode((const guchar*)&ui_info, sizeof(TelSatSendUiInfo_t));
-
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
- bundle_add(bundle_data, "data", encoded_data);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("ui info aul (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(encoded_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-static gboolean _sat_ui_support_create_desktop_file(const gchar *title)
-{
- int rv = 0;
- int b_check = 0;
- FILE *f_out;
-
- if(!title){
- dbg("title does not exist");
- return FALSE;
- }
-
- b_check = access("/opt/share/applications/org.tizen.sat-ui.desktop", F_OK);
- if( b_check == 0 && !(g_strcmp0(title,"temp")) ){
- dbg("desktop file aleady exist");
- return FALSE;
- }
-
- f_out = fopen("/opt/share/applications/org.tizen.sat-ui.desktop", "w");
- if(!f_out){
- dbg("fail to create sat-ui desktop file");
- return FALSE;
- }
-
- fprintf(f_out, "Package=org.tizen.sat-ui\n");
- fprintf(f_out, "Name=%s\n",title);
- fprintf(f_out, "Type=Application\n");
- fprintf(f_out, "Version=0.2.2\n");
-
- if( g_strcmp0(title,"temp") == 0 ){
- fprintf(f_out, "NoDisplay=true\n");
- }
-
- fprintf(f_out, "Exec=/usr/apps/org.tizen.sat-ui/bin/sat-ui KEY_EXEC_TYPE 0\n");
- fprintf(f_out, "Icon=org.tizen.sat-ui.png\n");
- fprintf(f_out, "X-Tizen-TaskManage=True\n");
- fprintf(f_out, "X-Tizen-Multiple=False\n");
- fprintf(f_out, "X-Tizen-Removable=False\n");
- fprintf(f_out, "Comment=SIM Application UI\n");
- fclose(f_out);
- //fflush(f_out);
-
- //rv = system("/bin/cp /tmp/org.tizen.sat-ui.desktop /opt/share/applications/");
- //dbg("the result to create desktop file (%d)", rv);
- //rv = system("/bin/rm /tmp/org.tizen.sat-ui.desktop");
-
- rv = setxattr("/opt/share/applications/org.tizen.sat-ui.desktop", "security.SMACK64","_",1,0);
- dbg("the result to apply the smack value(%d)", rv);
-
- b_check = access("/opt/share/applications/org.tizen.sat-ui.desktop", F_OK);
- dbg("access result (%d)", b_check);
-
- if(rv == -1 || rv == 127) {
- dbg("rv (%d)", rv);
- return FALSE;
- }
-
- //rv = system("/bin/ls -al /opt/share/applications > /opt/var/log/desktop_file_list.txt");
-
- return TRUE;
-}
-
-static void _sat_ui_support_storage_key_callback(enum tcore_storage_key key, void *value, void *user_data)
-{
- GVariant *tmp = NULL;
- gboolean type_check = FALSE;
-
- dbg("storage key(%d) callback", key);
- tmp = (GVariant *)value;
- if(!tmp || !strg_vconf){
- err("value is null");
- return;
- }
-
- if(key == STORAGE_KEY_IDLE_SCREEN_LAUNCHED_BOOL) {
- int b_launched = 0;
- const gchar *title = (const gchar*)user_data;
- gboolean ret;
-
- type_check = g_variant_is_of_type(tmp, G_VARIANT_TYPE_INT32);
- if(!type_check){
- dbg("wrong variant data type");
- goto EXIT;
- }
-
- b_launched = g_variant_get_int32(tmp);
- if(b_launched < 0) {
- dbg("tcore_storage_get_int(VCONFKEY_IDLE_SCREEN_LAUNCHED) failed");
- goto EXIT;
- }
-
- if(b_launched) {
- dbg("idle screen is ready, create desktop file.");
- ret = _sat_ui_support_create_desktop_file(title);
- }
- }
- else {
- dbg("unspported key.");
- }
-
-EXIT:
- g_variant_unref(tmp);
- return;
-}
-
-static gboolean _sat_ui_support_register_key_callback(enum tcore_storage_key key, void * user_data)
-{
- gboolean ret = FALSE;
-
- if (strg_vconf == NULL) {
- err("VCONF Storage is NULL!!!");
- return ret;
- }
-
- dbg("Set key callback - KEY: [%d]", key);
- ret = tcore_storage_set_key_callback(strg_vconf, key, _sat_ui_support_storage_key_callback, user_data);
-
- return ret;
-}
-
-gboolean sat_ui_support_terminate_sat_ui()
-{
- gint rv;
- bundle *bundle_data = 0;
- gchar *cmd_type = NULL;
-
- cmd_type = g_strdup_printf("%d", SAT_PROATV_CMD_TYPE_END_PROACTIVE_SESSION);
-
- bundle_data = bundle_create();
- bundle_add(bundle_data, "KEY_EXEC_TYPE", "1");
- bundle_add(bundle_data, "cmd_type", cmd_type);
-
- rv = aul_launch_app("org.tizen.sat-ui", bundle_data);
- dbg("session end aul (%d)", rv);
-
- bundle_free(bundle_data);
- g_free(cmd_type);
-
- return TRUE;
-}
-
-gboolean sat_ui_support_launch_sat_ui(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
-{
- gboolean result = FALSE;
- sat_ui_support_create_desktop_file("temp");
-
- switch(cmd_type){
- case SAT_PROATV_CMD_NONE:
- case SAT_PROATV_CMD_SEND_DTMF:
- result = _sat_ui_support_processing_ui_info_ind(cmd_type, data);
- break;
- case SAT_PROATV_CMD_SETUP_MENU:
- result = _sat_ui_support_processing_setup_menu_ind(data);
- break;
- case SAT_PROATV_CMD_DISPLAY_TEXT:
- result = _sat_ui_support_processing_display_text_ind(data);
- break;
- case SAT_PROATV_CMD_SELECT_ITEM:
- result = _sat_ui_support_processing_select_item_ind(data);
- break;
- case SAT_PROATV_CMD_GET_INKEY:
- result = _sat_ui_support_processing_get_inkey_ind(data);
- break;
- case SAT_PROATV_CMD_GET_INPUT:
- result = _sat_ui_support_processing_get_input_ind(data);
- break;
- case SAT_PROATV_CMD_REFRESH:
- result = _sat_ui_support_processing_refresh_ind(data);
- break;
- case SAT_PROATV_CMD_PLAY_TONE:
- result = _sat_ui_support_processing_play_tone_ind(data);
- break;
- case SAT_PROATV_CMD_SETUP_IDLE_MODE_TEXT:
- result = _sat_ui_support_processing_idle_mode_text_ind(data);
- break;
- case SAT_PROATV_CMD_SETUP_EVENT_LIST:
- break;
- default:
- dbg("does not need to launch sat-ui");
- break;
- }
-
- return result;
-}
-
-gboolean sat_ui_support_launch_call_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
-{
- //gint rv;
- char buffer[300];
- bundle *bundle_data = 0;
-
- dbg("launch call application by aul");
- bundle_data = bundle_create();
-
- appsvc_set_operation(bundle_data, APPSVC_OPERATION_CALL);
- appsvc_set_uri(bundle_data,"tel:MT");
-
- switch(cmd_type){
- case SAT_PROATV_CMD_SETUP_CALL:{
- gint command_id, call_type, confirm_text_len, text_len, duration;
- gchar *confirm_text, *text, *call_number;
- GVariant *icon_id;
-
- dbg("setup call type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(isisi@visi)", &command_id, &confirm_text, &confirm_text_len, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
-
- appsvc_add_data(bundle_data, "launch-type","SATSETUPCALL");
-
- snprintf(buffer, 300, "%d",command_id);
- appsvc_add_data(bundle_data, "cmd_id",buffer);
- dbg("cmd_id(%s)",buffer);
-
- snprintf(buffer, 300, "%d",call_type);
- appsvc_add_data(bundle_data, "cmd_qual", buffer);
- dbg("cmd_qual(%s)",buffer);
-
- snprintf(buffer, 300, "%s", text);
- appsvc_add_data(bundle_data, "disp_text", buffer);
- dbg("disp_text(%s)",buffer);
-
- snprintf(buffer, 300, "%s", call_number);
- appsvc_add_data(bundle_data, "call_num", buffer);
- dbg("call_num(%s)",buffer);
-
- snprintf(buffer, 300, "%d", duration);
- appsvc_add_data(bundle_data, "dur", buffer);
- dbg("dur(%s)",buffer);
- } break;
-
- default:
- bundle_free(bundle_data);
- return FALSE;
- break;
- }
-
- appsvc_run_service(bundle_data, 0, NULL, NULL);
- dbg("call app is called");
- //rv = aul_launch_app("com.samsung.call",bundle_data);
- //dbg("call app aul (%d)", rv);
- bundle_free(bundle_data);
-
- return TRUE;
-}
-
-gboolean sat_ui_support_launch_browser_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
-{
-// gint rv;
- char buffer[300];
- bundle *bundle_data = 0;
-
- dbg("launch browser application by aul");
- bundle_data = bundle_create();
-
- appsvc_set_operation(bundle_data, APPSVC_OPERATION_VIEW);
-
- switch(cmd_type){
- case SAT_PROATV_CMD_LAUNCH_BROWSER:{
- gint command_id, launch_type, browser_id;
- gint url_len, text_len, gateway_proxy_len;
- gchar *url, *text, *gateway_proxy;
- GVariant *icon_id = NULL;
-
- dbg("launch_browser type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iiisisisi@v)", &command_id, &launch_type, &browser_id, &url, &url_len, &gateway_proxy, &gateway_proxy_len, &text, &text_len, &icon_id);
-
- appsvc_set_uri(bundle_data, url);
-
- snprintf(buffer, 300, "%d",command_id);
- appsvc_add_data(bundle_data, "cmd_id",buffer);
- dbg("cmd_id(%s)",buffer);
-
- snprintf(buffer, 300, "%d",launch_type);
- appsvc_add_data(bundle_data, "launch_type", buffer);
- dbg("launch_type(%s)",buffer);
-
- snprintf(buffer, 300, "%s", gateway_proxy);
- appsvc_add_data(bundle_data, "proxy", buffer);
- dbg("proxy(%s)",buffer);
-
- } break;
-
- default:
- bundle_free(bundle_data);
- return FALSE;
- break;
- }
-
- appsvc_run_service(bundle_data, 0, NULL, NULL);
- dbg("browser app is called");
- //rv = aul_launch_app("com.samsung.call",bundle_data);
- //dbg("call app aul (%d)", rv);
- bundle_free(bundle_data);
-
- return TRUE;
-}
-
-gboolean sat_ui_support_launch_ciss_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
-{
- bundle *bundle_data = 0;
- gchar *encoded_data = NULL, *cmd = NULL;
-
- dbg("launch ciss application by aul");
- bundle_data = bundle_create();
-
- appsvc_set_operation(bundle_data, "http://tizen.org/appcontrol/operation/ciss");
- appsvc_set_pkgname(bundle_data, "com.samsung.ciss");
-
- switch(cmd_type){
- case SAT_PROATV_CMD_SEND_SS:{
- TelSatSendSsIndSsData_t ss_info;
-
- gint command_id, ton, npi;
- gint text_len, ss_str_len;
- gchar* text, *ss_string;
- GVariant *icon_id;
-
- dbg("launch ciss ui for send ss proactive cmd");
-
- memset(&ss_info, 0, sizeof(TelSatSendSsIndSsData_t));
-
- dbg("send ss type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(isi@viiis)", &command_id, &text, &text_len, &icon_id, &ton, &npi, &ss_str_len, &ss_string);
-
- ss_info.commandId = command_id;
- memcpy(ss_info.ssString, ss_string, TAPI_SAT_DEF_SS_LEN_MAX+1);
- ss_info.ssStringLen = ss_str_len;
-
- cmd = g_strdup_printf("%d", cmd_type);
- encoded_data = g_base64_encode((const guchar*)&ss_info, sizeof(TelSatSendSsIndSsData_t));
-
- } break;
-
- case SAT_PROATV_CMD_SEND_USSD:{
- TelSatSendUssdIndUssdData_t ussd_info;
-
- gint command_id;
- gint text_len, ussd_str_len;
- gchar* text, *ussd_string;
-
- GVariant *icon_id;
-
- dbg("launch ciss ui for send ussd proactive cmd");
-
- memset(&ussd_info, 0, sizeof(TelSatSendUssdIndUssdData_t));
-
- dbg("send ussd type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(isi@vis)", &command_id, &text, &text_len, &icon_id, &ussd_str_len, &ussd_string);
-
- ussd_info.commandId = command_id;
- memcpy(ussd_info.ussdString, ussd_string, TAPI_SAT_DEF_USSD_LEN_MAX+1);
- ussd_info.ussdStringLen = ussd_str_len;
-
- cmd = g_strdup_printf("%d", cmd_type);
- encoded_data = g_base64_encode((const guchar*)&ussd_info, sizeof(TelSatSendUssdIndUssdData_t));
-
- } break;
-
- default:
- bundle_free(bundle_data);
- return FALSE;
- break;
- }
-
- appsvc_add_data(bundle_data, "CISS_LAUNCHING_MODE", "RESP");
- appsvc_add_data(bundle_data, "KEY_EVENT_TYPE", cmd);
- appsvc_add_data(bundle_data, "KEY_ENCODED_DATA", encoded_data);
-
- appsvc_run_service(bundle_data, 0, NULL, NULL);
- dbg("ciss is called");
- bundle_free(bundle_data);
-
- return TRUE;
-}
-
-gboolean sat_ui_support_launch_setting_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
-{
- gint rv;
- char buffer[300];
- bundle *bundle_data = 0;
-
- dbg("launch setting application by aul");
-
- /*TODO : need to make a sync with app engineer*/
-
- switch(cmd_type){
- case SAT_PROATV_CMD_LANGUAGE_NOTIFICATION:{
- gint command_id, call_type, text_len, duration;
- gchar *text, *call_number;
- GVariant *icon_id;
-
- dbg("setup call type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(isi@visi)", &command_id, &text, &text_len, &icon_id, &call_type, &call_number, &duration);
-
- bundle_add(bundle_data, "launch-type","SATSETUPCALL");
-
- snprintf(buffer, 300, "%d",command_id);
- bundle_add(bundle_data, "cmd_id",buffer);
- dbg("cmd_id(%s)",buffer);
-
- snprintf(buffer, 300, "%d",call_type);
- bundle_add(bundle_data, "cmd_qual", buffer);
- dbg("cmd_qual(%s)",buffer);
-
- snprintf(buffer, 300, "%s", text);
- bundle_add(bundle_data, "disp_text", buffer);
- dbg("disp_text(%s)",buffer);
-
- snprintf(buffer, 300, "%s", call_number);
- bundle_add(bundle_data, "call_num", buffer);
- dbg("call_num(%s)",buffer);
-
- snprintf(buffer, 300, "%d", duration);
- bundle_add(bundle_data, "dur", buffer);
- dbg("dur(%s)",buffer);
- } break;
-
- case SAT_PROATV_CMD_PROVIDE_LOCAL_INFO:
- break;
-
- default:
- return FALSE;
- break;
- }
-
- rv = aul_launch_app("com.samsung.call",bundle_data);
- bundle_free(bundle_data);
-
- return TRUE;
-}
-
-gboolean sat_ui_support_create_desktop_file(const gchar *title)
-{
- gboolean ret = FALSE;
- int b_launched = 0;
-
- dbg("check vconf if starter is ready.");
-
- if (strg_vconf == NULL) {
- err("VCONF Storage is NULL!!!");
- return ret;
- }
-
- b_launched = tcore_storage_get_int(strg_vconf, STORAGE_KEY_IDLE_SCREEN_LAUNCHED_BOOL);
- if(b_launched < 0) {
- dbg("tcore_storage_get_int(VCONFKEY_IDLE_SCREEN_LAUNCHED) failed");
- return FALSE;
- }
-
- dbg("Launch: [%s]", (b_launched ? "YES" : "NO"));
- if(b_launched) {
- dbg("Idle screen is Ready!!! Create Desktop file");
- ret = _sat_ui_support_create_desktop_file(title);
- if (ret)
- return TRUE;
- }
-
- dbg("Idle screen is NOT launched yet!!! Register VCONF notification for Starter ready");
- ret = _sat_ui_support_register_key_callback(STORAGE_KEY_IDLE_SCREEN_LAUNCHED_BOOL, (void *)title);
-
- return ret;
-}
-
-gboolean sat_ui_support_remove_desktop_file(void)
-{
- int rv = 0;
- int b_check = 0;
-
- b_check = access("/opt/share/applications/org.tizen.sat-ui.desktop", F_OK);
- if(b_check != 0){
- dbg("desktop file does not exist");
- return TRUE;
- }
-
- rv = system("/bin/rm /opt/share/applications/org.tizen.sat-ui.desktop");
- dbg("the result to remove desktop file (%d)", rv);
-
- return TRUE;
-}
-
-gboolean sat_ui_support_exec_bip(GDBusConnection *connection, const gchar *path, enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
-{
- gboolean rv = FALSE;
- gchar *signal_name = NULL;
- GVariant *out_param = NULL;
-
- switch(cmd_type){
- case SAT_PROATV_CMD_OPEN_CHANNEL:{
- gint command_id, bearer_type, protocol_type, dest_addr_type;
- gboolean immediate_link, auto_reconnection, bg_mode;
- gint text_len, buffer_size, port_number;
- gchar *text, *dest_address;
- GVariant *icon_id;
- GVariant *bearer_param;
- GVariant *bearer_detail;
-
- dbg("open channel type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data,"(isi@vbbbiviiiisv)", &command_id, &text, &text_len, &icon_id, &immediate_link, &auto_reconnection, &bg_mode,
- &bearer_type, &bearer_param, &buffer_size, &protocol_type, &port_number, &dest_addr_type, &dest_address, &bearer_detail);
-
- out_param = g_variant_new("(isibbbiviiiisv)", command_id, text, text_len, immediate_link, auto_reconnection, bg_mode,
- bearer_type, bearer_param, buffer_size, protocol_type, port_number, dest_addr_type, dest_address, bearer_detail);
- signal_name = g_strdup("OpenChannel");
- } break;
- case SAT_PROATV_CMD_CLOSE_CHANNEL:{
- gint command_id, channel_id, text_len;
- gchar *text;
- GVariant *icon_id;
-
- dbg("close channel type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(isi@vi)", &command_id, &text, &text_len, &icon_id, &channel_id);
-
- out_param = g_variant_new("(isii)", command_id, text, text_len, channel_id);
- signal_name = g_strdup("CloseChannel");
- } break;
- case SAT_PROATV_CMD_RECEIVE_DATA:{
- gint command_id, text_len, channel_id, channel_data_len = 0;
- gchar *text;
- GVariant *icon_id;
-
- dbg("receive data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(isi@vii)", &command_id, &text, &text_len, &icon_id, &channel_id, &channel_data_len);
-
- out_param = g_variant_new("(isiii)", command_id, text, text_len, channel_id, channel_data_len);
- signal_name = g_strdup("ReceiveData");
- } break;
- case SAT_PROATV_CMD_SEND_DATA:{
- gint command_id, channel_id, text_len, channel_data_len;
- gboolean send_data_immediately;
- gchar *text;
- GVariant *channel_data;
- GVariant *icon_id;
-
- dbg("send data type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(isi@vibvi)", &command_id, &text, &text_len, &icon_id, &channel_id, &send_data_immediately, &channel_data, &channel_data_len);
-
- out_param = g_variant_new("(isiibvi)", command_id, text, text_len, channel_id, send_data_immediately, channel_data, channel_data_len);
- signal_name = g_strdup("SendData");
- } break;
- case SAT_PROATV_CMD_GET_CHANNEL_STATUS:{
- gint command_id;
-
- dbg("get channel status type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(i)", &command_id);
-
- out_param = g_variant_new("(i)", command_id);
- signal_name = g_strdup("GetChannelStatus");
- } break;
- case SAT_PROATV_CMD_SETUP_EVENT_LIST:{
- gint event_cnt;
- GVariant *evt_list;
-
- dbg("setup event list type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iv)", &event_cnt, &evt_list);
-
- out_param = g_variant_new("(iv)", event_cnt, evt_list);
- signal_name = g_strdup("SetupEventList");
- } break;
- default:
- dbg("no matched command");
- return FALSE;
- break;
- }
-
- dbg("dbus conn(%p), path(%s)", connection, path);
- rv = g_dbus_connection_emit_signal(connection, "org.tizen.bip-manager", path, "org.tizen.telephony.SAT", signal_name, out_param, NULL);
-
- dbg("send signal to bip-mananger result (%d)", rv);
-
- return rv;
-}
-
-gboolean sat_ui_support_exec_evtdw(GDBusConnection *connection, const gchar *path, enum tel_sat_proactive_cmd_type cmd_type, GVariant *data)
-{
- gboolean rv = FALSE;
- gchar *signal_name = NULL;
- GVariant *out_param = NULL;
-
- switch(cmd_type){
- case SAT_PROATV_CMD_SETUP_EVENT_LIST:{
- gint event_cnt;
- GVariant *evt_list;
-
- dbg("setup event list type_format(%s)", g_variant_get_type_string(data));
- g_variant_get(data, "(iv)", &event_cnt, &evt_list);
-
- out_param = g_variant_new("(iv)", event_cnt, evt_list);
- signal_name = g_strdup("SetupEventList");
- } break;
- default:
- dbg("no matched command");
- return FALSE;
- break;
- }
-
- dbg("dbus conn(%p), path(%s)", connection, path);
- rv = g_dbus_connection_emit_signal(connection, "org.tizen.sat-event-downloader", path, "org.tizen.telephony.SAT", signal_name, out_param, NULL);
-
- dbg("send signal to sat-event-downloader result (%d)", rv);
-
- return rv;
-}
-
-gboolean sat_ui_support_storage_init(Server *server)
-{
- Storage *strg = NULL;
-
- if(strg_vconf) {
- dbg("vconf storage already exists!!");
- return TRUE;
- }
-
- dbg("create vconf ");
-
- strg = tcore_server_find_storage(server, "vconf");
- if(!strg) {
- dbg("cannot find vconf storage!!");
- return FALSE;
- }
-
- strg_vconf = strg;
- return TRUE;
-}
-
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-#ifndef SAT_UI_SUPPORT_H_
-#define SAT_UI_SUPPORT_H_
-
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <storage.h>
-#include <server.h>
-#include <type/sat.h>
-
-gboolean sat_ui_support_terminate_sat_ui(void);
-gboolean sat_ui_support_launch_call_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
-gboolean sat_ui_support_launch_browser_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
-gboolean sat_ui_support_launch_ciss_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
-gboolean sat_ui_support_launch_setting_application(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
-gboolean sat_ui_support_launch_sat_ui(enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
-gboolean sat_ui_support_create_desktop_file(const gchar *title);
-gboolean sat_ui_support_remove_desktop_file(void);
-gboolean sat_ui_support_exec_bip(GDBusConnection *connection, const gchar *path, enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
-gboolean sat_ui_support_exec_evtdw(GDBusConnection *connection, const gchar *path, enum tel_sat_proactive_cmd_type cmd_type, GVariant *data);
-gboolean sat_ui_support_storage_init(Server *server);
-
-#endif /* SAT_UI_SUPPORT_H_ */
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <assert.h>
-
-#include <iconv.h>
-#include <glib.h>
-
-#include "sat_manager.h"
-#include "util.h"
-
-#define tabGsmUniMax2 9
-#define tabGsmUniMax 42
-
-static gboolean _find_gsm_code_exception_table(unsigned short src);
-static int _get_gsm_code_size(unsigned short* src, int src_len);
-static gboolean _convert_gsm_to_unicode(unsigned short *dest, int dest_len, unsigned char *src, unsigned int src_len);
-static int _convert_gsm_to_ucs2(unsigned short* dest, unsigned char* src, unsigned int src_len);
-static void _convert_gsm_to_utf8(unsigned char *dest, unsigned short *dest_len, unsigned char *src, unsigned int src_len);
-static gboolean _convert_unicode_to_gsm(unsigned char* dest, int dest_len, unsigned short* src, int src_len);
-static char* _convert_ucs_to_utf8(unsigned char *src, int src_len);
-static int _convert_ucs2_to_gsm(unsigned char* dest, unsigned short* src, unsigned int src_len);
-static int _convert_ucs2_to_utf8(char *out, unsigned short *out_len, char *in, unsigned short in_len);
-static void _convert_alpha_field_ucs2_to_utf8(unsigned char *out, unsigned short *out_len, unsigned char *in, unsigned short in_len);
-static int _convert_utf8_to_unicode(unsigned short* dest, unsigned char* src, unsigned int src_len);
-
-typedef struct {
- char gsm;
- unsigned short unicode;
-} GsmUniTable;
-
-const GsmUniTable gsm_unicode2_table[] = {
- { 0x14, 0x005E }, { 0x28, 0x007B }, { 0x29, 0x007D }, { 0x2F, 0x005C },
- { 0x3C, 0x005B }, { 0x3D, 0x007E }, { 0x3E, 0x005D }, { 0x40, 0x007C },
- { 0x65, 0x20AC } };
-
-const GsmUniTable gsm_unicode_table[] = {
- { 0x00, 0x0040 }, { 0x01, 0x00A3 }, { 0x02, 0x0024 }, { 0x03, 0x00A5 },
- { 0x04, 0x00E8 }, { 0x05, 0x00E9 }, { 0x06, 0x00F9 }, { 0x07, 0x00EC }, { 0x08, 0x00F2 },
- { 0x09, 0x00E7 }, { 0x0B, 0x00D8 }, { 0x0C, 0x00F8 }, { 0x0E, 0x00C5 }, { 0x0F, 0x00E5 },
- { 0x10, 0x0394 }, { 0x11, 0x005F }, { 0x12, 0x03A6 }, { 0x13, 0x0393 }, { 0x14, 0x039B },
- { 0x15, 0x03A9 }, { 0x16, 0x03A0 }, { 0x17, 0x03A8 }, { 0x18, 0x03A3 }, { 0x19, 0x0398 },
- { 0x1A, 0x039E }, { 0x1C, 0x00C6 }, { 0x1D, 0x00E6 }, { 0x1E, 0x00DF }, { 0x1F, 0x00C9 },
- { 0x24, 0x00A4 }, { 0x40, 0x00A1 }, { 0x5B, 0x00C4 }, { 0x5C, 0x00D6 }, { 0x5D, 0x00D1 },
- { 0x5E, 0x00DC }, { 0x5F, 0x00A7 }, { 0x60, 0x00BF }, { 0x7B, 0x00E4 }, { 0x7C, 0x00F6 },
- { 0x7D, 0x00F1 }, { 0x7E, 0x00FC }, { 0x7F, 0x00E0 }, };
-
-
-
-static gboolean _find_gsm_code_exception_table(unsigned short src)
-{
- if ((src >= 0x0020 && src <= 0x0023)
- || (src >= 0x0025 && src <= 0x003F)
- || (src >= 0x0041 && src <= 0x005A)
- || (src >= 0x0061 && src <= 0x007A)
- || src == 0x000A || src == 0x000D)
- return TRUE;
- return FALSE;
-}
-
-static int _get_gsm_code_size(unsigned short* src, int src_len)
-{
- gboolean in_table = FALSE;
- gboolean in_sec_table = FALSE;
- int i, gsm_len = 0;
-
- if (NULL == src) {
- dbg( "INPUT PARAM was NULL");
- return -1;
- }
-
- for (; src_len > 0 && src; src_len--) {
- if (_find_gsm_code_exception_table(*src) == TRUE) {
- src++;
- gsm_len++;
- continue;
- }
- in_table = FALSE;
- for (i = 0; i < tabGsmUniMax; i++) {
- if (*src == gsm_unicode_table[i].unicode) {
- src++;
- in_table = TRUE;
- gsm_len++;
- break;
- }
- }
- if (in_table == FALSE) {
- in_sec_table = FALSE;
- for (i = 0; i < tabGsmUniMax2; i++) {/* second table */
- if (*src == gsm_unicode2_table[i].unicode) {
- src++;
- in_table = TRUE;
- in_sec_table = TRUE;
- gsm_len += 2;
- break;
- }
- }
- if (in_sec_table == FALSE) {/* second*/
- if (_find_gsm_code_exception_table(*src) == FALSE) {
- dbg( "GSM Char[%d], gsm_len[%d]", *src, gsm_len);
- return -1;
- }
- src++;
- gsm_len++;
- }
- }
- }
- return gsm_len;
-}
-
-static gboolean _convert_gsm_to_unicode(unsigned short *dest, int dest_len, unsigned char *src, unsigned int src_len)
-{
- int index, tmp_len;
-
- if(!dest || !src) {
- dbg( "[SAT] dest(%p) or src(%p) is null",dest, src);
- return FALSE;
- }
-
- if(!src_len){
- dest[0] = '\0';
- return TRUE;
- }
-
- dbg("[SAT] source string (%s) len(%d)", src, src_len);
-
- for(index = 0; index < (int)src_len; index++){
- if(src[index] == 0x1B)
- src_len--;
- }
- dbg("[SAT] strlen excluding escape character (%d)", src_len);
-
- tmp_len = _convert_gsm_to_ucs2(dest, src, src_len);
- dest[tmp_len] = '\0';
-
- return TRUE;
-}
-
-static int _convert_gsm_to_ucs2(unsigned short* dest, unsigned char* src, unsigned int src_len)
-{
- int index;
- unsigned short* org;
-
- org = dest;
-
- for(index=0; index < (int)src_len; index++){
- int table_index=0;
- gboolean b_tabled = FALSE;
-
- /*
- * if the first byte is 0x1B, it is the escape character.
- * The byte value shoulbe be changed to unicode.
- */
- if(*src == 0x1B){
- src++; index++;//move to next byte
- for(table_index=0; table_index < tabGsmUniMax2; table_index++){
- if(*src == gsm_unicode2_table[table_index].gsm){
- *dest = gsm_unicode2_table[table_index].unicode;
- b_tabled = TRUE;
- break;
- }
- }
-
- //if matched data is not in table, it should be changed to NULL;
- if(!b_tabled){
- *dest = 0x0020;
- }
- }
- else{
- for(table_index=0; table_index < tabGsmUniMax; table_index++){
- if(*src == gsm_unicode_table[table_index].gsm){
- *dest = gsm_unicode_table[table_index].unicode;
- b_tabled = TRUE;
- break;
- }
- }
-
- //if matched data is not in table, it is using original value;
- if(!b_tabled){
- *dest = *src;
- }
- }
-
- //move to next position
- src++; dest++;
- }
-
- dbg("[SAT] cvt sr(%s), the size of data (%d) ", org, dest - org);
- return (dest - org);
-}
-
-static void _convert_gsm_to_utf8(unsigned char* dest, unsigned short* dest_len, unsigned char* src, unsigned int src_len)
-{
- int tmp_len = 0;
- char *target_tmp = NULL;
- unsigned char *raw_unicode = NULL;
- unsigned short tmp_dest[SAT_TEXT_STRING_LEN_MAX];
-
- memset(tmp_dest, 0 , SAT_TEXT_STRING_LEN_MAX);
-
- _convert_gsm_to_unicode(tmp_dest, SAT_TEXT_STRING_LEN_MAX, src, src_len);
- while(tmp_dest[tmp_len] != '\0')
- tmp_len++;
- tmp_len++; // add null character
-
- tmp_len = tmp_len*2; //for byte align
- raw_unicode = (unsigned char*)malloc(tmp_len);
- memset(raw_unicode, 0, tmp_len);
-
- memcpy(raw_unicode, (unsigned char*)tmp_dest, tmp_len);
-
- *dest_len = tmp_len;
- target_tmp = _convert_ucs_to_utf8(raw_unicode, tmp_len);
- if(!target_tmp){
- dbg( "str is NULL");
- g_free(raw_unicode);
- return;
- }
-
- memcpy(dest, target_tmp, strlen((const char*)target_tmp));
- dbg("final utf8 str (%s), length (%d)", dest, tmp_len);
-
- g_free(raw_unicode);
- g_free(target_tmp);
- return;
-}
-
-static gboolean _convert_unicode_to_gsm(unsigned char* dest, int dest_len, unsigned short* src, int src_len)
-{
- char* tmp_str;
- int gc_len = 0;
-
- if ((NULL == dest) || (NULL == src)) {
- dbg( "INPUT PARAM was NULL");
- return FALSE;
- }
-
- if (src_len == 0)
- return FALSE;
-
- gc_len = _get_gsm_code_size(src, src_len);
- if (0 >= gc_len) {
- dbg( "Warning: Error[%d] while finding the GSM Code Size", gc_len);
- return FALSE;
- }
-
- if (dest_len < gc_len) {
- if (dest_len == sizeof(void*)) {
- dbg( "Out buffer size seems to be small (%s)", dest);
- } else {
- dbg("Buffer size is too small (%s): dest_len(%d), gc_len(%d)", dest, dest_len, gc_len);
- }
- return FALSE;
- }
-
- tmp_str = calloc(1, (unsigned short) gc_len);
- if (tmp_str == NULL) {
- dbg( "Memory Allocation Failed!");
- return FALSE;
- }
-
- gc_len = _convert_ucs2_to_gsm((unsigned char*) tmp_str, src, src_len);
- if (gc_len != -1) {
- memcpy((char*) dest, (char*) tmp_str, gc_len);
- free(tmp_str);
- return TRUE;
- }
-
- free(tmp_str);
- return FALSE;
-}
-
-static char* _convert_ucs_to_utf8(unsigned char* src, int src_len)
-{
- char* utf_str = NULL;
- iconv_t cd = NULL;
- size_t ileft = 0;
- size_t oleft = 0;
- int err = 0;
-
- char* pIn = NULL;
- char* in_buf = NULL;
- char* out_buf = NULL;
-
- if (!src) {
- dbg("src is null");
- return NULL;
- }
-
- ileft = src_len * 2;//over allocate as utf-8 may occupy 3 bytes
- oleft = src_len * 3;//over allocate as utf-8 may occupy 3 bytes
- pIn = in_buf = (char*) malloc(ileft + 2);
- utf_str = out_buf = (char *) malloc(oleft + 1);
-
- memset(in_buf, 0x00, ileft + 2);
- memset(out_buf, 0x00, oleft + 1);
- memcpy(in_buf, src, ileft);
-
- in_buf[ileft] = '\0';
-
- cd = iconv_open("UTF-8", "UCS-2");
- err = iconv(cd, (char**) &in_buf, &ileft, &out_buf, &oleft);
-
- utf_str[src_len * 2 - ileft] = '\0';
- iconv_close(cd);
- free(pIn);
- return utf_str;
-}
-
-static int _convert_ucs2_to_gsm(unsigned char* dest, unsigned short* src, unsigned int src_len)
-{
- unsigned char* rear = NULL;
- unsigned short* p;
- unsigned char temp;
- gboolean in_table = FALSE;
- gboolean in_sec_table = FALSE;
- int i, gc_len = 0;
-
- if ((!dest) || (!src) || (0x00 == src_len)) {
- dbg( "Warning: Wrong Input");
- return -1;
- }
-
- rear = dest;
- p = src;
-
- for (; src_len > 0 && p; src_len--) {
- in_table = FALSE;
- for (i = 0; i < tabGsmUniMax; i++) { /* is in table */
- if (*p == gsm_unicode_table[i].unicode) {
- temp = (unsigned char) (gsm_unicode_table[i].gsm);
- *rear = temp;
- rear++;
- p++;
- in_table = TRUE;
- gc_len++;
- break;
- }
- }
- if (in_table == FALSE) {
- in_sec_table = FALSE;
- for (i = 0; i < tabGsmUniMax2; i++) { /* second table*/
- if (*p == gsm_unicode2_table[i].unicode) {
- *rear = 0x1B;
- rear++;
- temp = (unsigned char) (gsm_unicode2_table[i].gsm);
- *rear = temp;
- rear++;
- p++;
- in_table = TRUE;
- in_sec_table = TRUE;
- gc_len += 2;
- break;
- }
- }
- if (in_sec_table == FALSE) { /* second */
- if (_find_gsm_code_exception_table(*p) == FALSE)
- return -1;
- temp = (unsigned char) (*p); /* isn't in table */
- *rear = temp;
- rear++;
- p++;
- gc_len++;
- }
- }
- }
- src = p;
- return gc_len;
-}
-
-static int _convert_ucs2_to_utf8(char *out, unsigned short *out_len, char *in, unsigned short in_len)
-{
- char *p_o = NULL;
- size_t src_len = in_len;
- size_t dest_len = in_len*3;
-
- iconv_t cd = iconv_open("UTF-8", "UCS2");
- if (cd == (iconv_t) (-1)) {
- perror("iconv_open");
- return 0;
- }
-
- p_o = out;
-
- dbg("expected input bytes:%d dest_len:%d\n", src_len, dest_len);
-
- if (iconv(cd, &in, &src_len, &p_o, &dest_len) == (size_t)(-1)) {
- dbg("failed to iconv errno:%d", errno);
- } else {
- dbg("remained input bytes:%d processed bytes:%d", src_len, in_len*3-dest_len);
- out[in_len*3-dest_len] = '\0';
- }
- *out_len = in_len*3-dest_len;
- dbg("out_len[%d], output[%s]", *out_len, out);
- iconv_close(cd);
- return 0;
-}
-
-static void _convert_alpha_field_ucs2_to_utf8(unsigned char *out, unsigned short *out_len, unsigned char *in, unsigned short in_len)
-{
-
- dbg("[UCS2] prefix case:[0x%02x]", in[0]);
-
- switch(in[0]) {
- case 0x80: {
- unsigned char num = in_len/2; //number of characters
- int i = 0;
- int data_loc = 1; //starting location of data
- unsigned short* in_buf = NULL;
-
- in_buf = (unsigned short*)malloc(num * sizeof(unsigned short));
-
- for(i=0; i<num; i++,data_loc++) {
- in_buf[i] = ((unsigned short)in[data_loc]<<8) + (unsigned short)in[data_loc+1];
- data_loc++;
- dbg("[UCS2]in_buf[%d]=0x%04x", i, in_buf[i]);
- }
- _convert_ucs2_to_utf8((char*)out, out_len, (char*) in_buf, num*2);
- if(in_buf!=NULL) free(in_buf);
- } break;
-
- case 0x81: {
- unsigned char num = in[1]; //number of characters
- unsigned short base = (unsigned short) in[2] << 7; //base pointer for UCS2 type
- int i = 0;
- int data_loc = 3; //starting location of data
- unsigned short* in_buf = NULL;
-
- in_buf = (unsigned short*)malloc(num * sizeof(unsigned short));
-
- for(i=0; i<num; i++,data_loc++) {
- if(in[data_loc]<0x80) { // if the MSB is zero (0x80 => 1000b), then remaining 7 bits are GSM default character.
- _convert_gsm_to_ucs2(&in_buf[i], (unsigned char *)&in[data_loc], 1);
- dbg("[UCS2]in_buf[%d]=0x%04x", i, in_buf[i]);
- } else { // if the MSB is 1 then the remaining 7 bits are offset value added to Base Pointer which the result defines the UCS2 character.
- in_buf[i] = base + ((unsigned short)(in[data_loc]) & 0x7F);
- dbg("[UCS2]in_buf[%d]=0x%04x", i, in_buf[i]);
- }
- }
- _convert_ucs2_to_utf8((char*)out, out_len, (char*) in_buf, num*2);
- if(in_buf!=NULL) free(in_buf);
-
- } break;
-
- case 0x82: {
- unsigned char num = in[1]; //number of characters
- unsigned short base = ((unsigned short) in[2] << 8) | (unsigned short) in[3]; //base pointer for UCS2 type
- int i = 0;
- int data_loc = 4; //starting location of data
- unsigned short* in_buf = NULL;
-
- in_buf = (unsigned short*)malloc(num * sizeof(unsigned short));
-
- for(i=0; i<num; i++,data_loc++) {
- if(in[data_loc]<0x80) {
- _convert_gsm_to_ucs2(&in_buf[i], (unsigned char *)&in[data_loc], (unsigned int)1);
- dbg("[UCS2]in_buf[%d]=0x%04x", i, in_buf[i]);
- } else {
- in_buf[i] = base + ((unsigned short)(in[data_loc]) & 0x7F);
- dbg("[UCS2]in_buf[%d]=0x%04x", i, in_buf[i]);
- }
- }
- _convert_ucs2_to_utf8((char*)out, out_len, (char*) in_buf, num*2);
- if(in_buf!=NULL) free(in_buf);
- } break;
-
- default: {
- int i = 0;
- for(i=0; i<in_len; i++) {
- dbg("[UCS2]in[%d]=0x%02x", i, in[i]);
- }
- _convert_ucs2_to_utf8((char*)out, out_len, (char*)in, in_len);
- } break;
- }
-}
-
-static int _convert_utf8_to_unicode(unsigned short* dest, unsigned char* src, unsigned int src_len)
-{
- unsigned short* org = NULL;
- unsigned char hi = 0;
- unsigned char mid = 0;
- unsigned char low = 0;
-
- if ((NULL == dest) || (NULL == src)) {
- dbg( "[SAT] INPUT PARAM NULL");
- return -1;
- }
-
- org = dest;
-
- while (src_len > 0 && (*src != '\0')) {
- if (*src < 0x80) {
- *dest = (*src & 0x7F);
- dest++;
- src++;
- src_len--;
- } else if (((0xC0 <= *src) && (*src < 0xE0)) && (*(src + 1) >= 0x80)) {
- hi = *src & 0x1F;
- low = *(src+1) & 0x3F;
- *dest = (hi << 6) | low;
- dest++;
- src += 2;
- src_len -= 2;
- } else if ((*src >= 0xE0) && (*(src + 1) >= 0x80) && (*(src + 2) >= 0x80)) {
- hi = *src & 0x0F;
- mid = *(src+1) & 0x3F;
- low = *(src+2) & 0x3F;
- *dest = (hi << 12) | (mid << 6) | low;
- dest++;
- src += 3;
- src_len -= 3;
- } else {
- *dest = (*src & 0x7F);
- dest++;
- src++;
- src_len--;
- dbg( "[SAT] utf8 incorrect range");
- }
- }
- *dest = 0;
- return (dest - org);
-}
-
-void sat_mgr_convert_utf8_to_gsm(unsigned char *dest, int *dest_len, unsigned char* src, unsigned int src_len)
-{
- unsigned short *uc = NULL;
- int gc_len = 0;
- int uc_len = 0;
- gboolean ret = FALSE;
-
- if (src == NULL || src_len == 0) {
- dbg( "WARNING: Invalid Parameter");
- return;
- }
-
- uc = (unsigned short*) calloc(src_len + 1, sizeof(unsigned short));
- if (!uc) {
- dbg( "WARNING: calloc Failed");
- return;
- }
-
- /*Converting from UTF8 => UNICODE*/
- uc_len = _convert_utf8_to_unicode(uc, src, src_len);
- dbg( "uc_len:[%d]", uc_len);
- if(uc_len == -1) {
- dbg( "_convert_utf8_to_unicode returns false!");
- free(uc);
- return;
- }
-
- /*Finding the GSMCode Size*/
- gc_len = _get_gsm_code_size(uc, uc_len);
- dbg( "gc_len:[%d]", gc_len);
- if ( gc_len == -1) {
- dbg( "SM- DATA is not in GSM7BIT Character Set & Error:[%d]", gc_len);
- free(uc);
- return;
- }
-
- *dest_len = gc_len;
- /*Converting from UNICODE ==> GSM CODE */
- ret = _convert_unicode_to_gsm((unsigned char*) dest, *dest_len, uc, uc_len);
- if (ret == FALSE) {
- dbg( "_convert_unicode_to_gsm Failed");
- *dest_len = 0x00;
- free(uc);
- return;
- }
-
- if(uc)
- free(uc);
-}
-
-void sat_mgr_convert_utf8_to_ucs2(unsigned char* dest, int* dest_len, unsigned char* src, int src_len)
-{
- gsize byte_converted = 0;
- gsize byte_read = 0;
- gchar* str_converted = NULL;
- GError *error = NULL;
- int i;
- char tmp_char;
-
- if (dest == NULL || dest_len == NULL || src == NULL) {
- dbg( "Invalid Input Parameter");
- return;
- }
-
- /*Converting from UTF8 => UCS-2 using the g_convert*/
- str_converted = (gchar*) g_convert((gchar*) src, (gsize) src_len,
- (gchar*) "UCS-2", (gchar*) "UTF8",
- (gsize*) &byte_read, (gsize*) &byte_converted,
- &error);
- if (str_converted == NULL) {
- dbg( "str_converted is NULL");
- if (error != NULL) {
- dbg( "Problem while conversion UTF8 => UCS2, ErrorCode[%d]", error->code);
- }
- return;
- }
-
- dbg( "src_len[%u], byte_read[%u], byte_converted[%u]", src_len, byte_read, byte_converted);
- *dest_len = (int) byte_converted;
-
- if (byte_converted % 2 != 0) {
- dbg( "string length is wrong!");
- } else {
- for (i = 0; i < (int)byte_converted; i++) {
- if (i % 2 == 0) {
- tmp_char = str_converted[i];
- str_converted[i] = str_converted[i + 1];
- str_converted[i + 1] = tmp_char;
- }
- }
- }
- memcpy((unsigned char*) dest, (unsigned char*) str_converted, byte_converted);
- g_free(str_converted);
- return;
-}
-
-gboolean sat_mgr_convert_string(unsigned char *dest, unsigned short *dest_len,
- enum alphabet_format dcs, const unsigned char *src, unsigned short src_len)
-{
- dbg("[SAT] dcs=[0x%02x]", dcs );
- dbg("[SAT] src=[%s], src_len=[%d]", src, src_len);
-
- if(src==NULL || src_len==0) {
- err("[SAT] src is NULL or src_len is 0");
- return FALSE;
- }
-
- switch (dcs) {
- case ALPHABET_FORMAT_SMS_DEFAULT: {
- unsigned char* tmp_dest_str = NULL;
- dbg( "[SAT] alphabetFormat : [ALPHABET_FORMAT_SMS_DEFAULT]");
- tmp_dest_str = (unsigned char*)tcore_util_unpack_gsm7bit((const unsigned char *)src, src_len);
-
- if(!tmp_dest_str) {
- err("temp_dest_str is NULL");
- return FALSE;
- }
- _convert_gsm_to_utf8(dest, dest_len, tmp_dest_str, strlen((const char*)tmp_dest_str));
- if(tmp_dest_str) {
- free(tmp_dest_str);
- }
- } break;
-
- case ALPHABET_FORMAT_8BIT_DATA: { //GSM7bit with bit 8 set to 0
- int tmp_str_len = 0;
- unsigned char *src_buf = NULL;
- src_buf = (unsigned char*)malloc(src_len);
- memcpy(src_buf, src, src_len);
-
- /*get string length*/
- /* 0xFF is the end of string */
- while (src[tmp_str_len] != 0xFF && tmp_str_len < src_len) {
- tmp_str_len++;
- }
- /* last space character must be deleted */
- while (src[tmp_str_len - 1] == 0x20 && tmp_str_len > 0) {
- tmp_str_len--;
- }
- dbg( "[SAT] alphabetFormat : [ALPHABET_FORMAT_8BIT_DATA]");
- dbg( "[SAT] tmp_str_len[%d]", tmp_str_len);
-
- _convert_gsm_to_utf8(dest, dest_len, src_buf, tmp_str_len);
- if(src_buf != NULL) free(src_buf);
- } break;
-
- case ALPHABET_FORMAT_UCS2: {
- unsigned char *src_buf = NULL;
- src_buf = (unsigned char*)malloc(src_len);
- memcpy(src_buf, src, src_len);
- dbg( "[SAT] alphabetFormat : [ALPHABET_FORMAT_UCS2]");
- _convert_alpha_field_ucs2_to_utf8(dest, dest_len, src_buf, src_len);
- if(src_buf != NULL) free(src_buf);
- } break;
-
- default: {
- dbg("[SAT] not handled alpha format[0x%02x]", dcs);
- return FALSE;
- } break;
- }
- return TRUE;
-}
-
-void swap_byte_order(unsigned short* dest, const unsigned short* src, int src_len)
-{
- int i = 0;
-
- for (i = 0; i < src_len; i++) {
- dest[i] = (src[i] << 8) + (src[i] >> 8);
- }
-}
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <core_object.h>
-#include <queue.h>
-#include <user_request.h>
-#include <util.h>
-#include <co_sim.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-
-static gboolean dbus_sim_data_request(struct custom_data *ctx, enum tel_sim_status sim_status,
- const char *plugin_name)
-{
- UserRequest *ur = NULL;
-
- switch(sim_status){
- case SIM_STATUS_INITIALIZING :
- case SIM_STATUS_PIN_REQUIRED :
- case SIM_STATUS_PUK_REQUIRED :
- case SIM_STATUS_CARD_BLOCKED :
- case SIM_STATUS_NCK_REQUIRED :
- case SIM_STATUS_NSCK_REQUIRED :
- case SIM_STATUS_SPCK_REQUIRED :
- case SIM_STATUS_CCK_REQUIRED :
- case SIM_STATUS_LOCK_REQUIRED :
- if(ctx->sim_recv_first_status == FALSE) {
- int rv = 0;
- dbg("received sim status at first time");
-
- dbg("req - TREQ_SIM_GET_ECC ");
- ur = tcore_user_request_new(ctx->comm, plugin_name);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_ECC);
- rv = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(rv != TCORE_RETURN_SUCCESS) {
- dbg("dispatch_request failed. return value = %d", rv);
- }
- ctx->sim_recv_first_status = TRUE;
- }
- break;
-
- default :
- break;
- }
- return TRUE;
-}
-
-static gboolean on_sim_get_init_status(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- gint tmp_cardstatus = 0xff;
- gboolean b_changed = FALSE;
- CoreObject *co_sim = NULL;
- TcorePlugin *plugin = NULL;
- char *cp_name = GET_PLUGIN_NAME(invocation);
-
- dbg("Func Entrance");
-
- plugin = tcore_server_find_plugin(ctx->server, cp_name);
- co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
- if (!co_sim) {
- dbg("error- co_sim is NULL");
- return FALSE;
- }
-
- tmp_cardstatus = tcore_sim_get_status(co_sim);
- b_changed = tcore_sim_get_identification(co_sim);
- dbg("sim init info - cardstatus[%d],changed[%d]", tmp_cardstatus, b_changed);
-
- telephony_sim_complete_get_init_status(sim, invocation, tmp_cardstatus, b_changed);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_card_type(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- enum tel_sim_type type = SIM_TYPE_UNKNOWN;
- CoreObject *co_sim = NULL;
- TcorePlugin *plugin = NULL;
- char *cp_name = GET_PLUGIN_NAME(invocation);
-
- dbg("Func Entrance");
-
- plugin = tcore_server_find_plugin(ctx->server, cp_name);
- co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
- if (!co_sim) {
- dbg("error- co_sim is NULL");
- return FALSE;
- }
-
- type = tcore_sim_get_type(co_sim);
-
- telephony_sim_complete_get_card_type(sim, invocation, type);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_imsi(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- struct tel_sim_imsi *n_imsi;
- CoreObject *co_sim = NULL;
- TcorePlugin *plugin = NULL;
- char *cp_name = GET_PLUGIN_NAME(invocation);
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- dbg("Func Entrance");
- plugin = tcore_server_find_plugin(ctx->server, cp_name);
- co_sim = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SIM);
- if (!co_sim) {
- dbg("error- co_sim is NULL");
- return FALSE;
- }
-
- n_imsi = tcore_sim_get_imsi(co_sim);
- dbg("n_imsi->plmn[%s]", n_imsi->plmn);
- dbg("n_imsi->msin[%s]", n_imsi->msin);
- telephony_sim_complete_get_imsi(sim, invocation, n_imsi->plmn, n_imsi->msin);
-
- if(n_imsi)
- g_free(n_imsi);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_ecc(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- GVariant *gv = NULL;
- GVariantBuilder b;
- int i;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- dbg("Func Entrance");
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i = 0; i < ctx->cached_sim_ecc.ecc_count; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string(ctx->cached_sim_ecc.ecc[i].ecc_string));
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string(ctx->cached_sim_ecc.ecc[i].ecc_num));
- g_variant_builder_add(&b, "{sv}", "category", g_variant_new_int32(ctx->cached_sim_ecc.ecc[i].ecc_category));
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- if (!gv)
- dbg("error - ecc gv is NULL");
-
- telephony_sim_complete_get_ecc(sim, invocation, gv);
-
- return TRUE;
-}
-
-static gboolean on_sim_get_iccid(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- dbg("Func Entrance");
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_ICCID);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_get_iccid(sim, invocation, SIM_ACCESS_FAILED, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_language(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_LANGUAGE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_get_language(sim, invocation, SIM_ACCESS_FAILED, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_set_language(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_language, gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_set_language set_language;
-
- if (check_access_control(invocation, AC_SIM, "w") == FALSE)
- return FALSE;
-
- memset(&set_language, 0, sizeof(struct treq_sim_set_language));
- set_language.language = arg_language;
-
- dbg("set_language.language[%d]", set_language.language);
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_language), &set_language);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_LANGUAGE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_set_language(sim, invocation, SIM_ACCESS_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_call_forwarding(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_CALLFORWARDING);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariant *gv_cf = NULL;
- GVariant *gv_cphs_cf = NULL;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv_cf = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- gv_cphs_cf = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_call_forwarding (sim, invocation, SIM_ACCESS_FAILED, 0, gv_cf, gv_cphs_cf);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_set_call_forwarding(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gboolean arg_cphs,
- gint arg_rec_index,
- gint arg_msp_num,
- guchar arg_cfu_status,
- gint arg_ton,
- gint arg_npi,
- const gchar *arg_number,
- gint arg_cc2_id,
- gint arg_ext7_id,
- gboolean arg_cphs_line1,
- gboolean arg_cphs_line2,
- gboolean arg_cphs_fax,
- gboolean arg_cphs_data,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_set_callforwarding req_cf;
-
- if (check_access_control(invocation, AC_SIM, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- memset(&req_cf, 0, sizeof(struct treq_sim_set_callforwarding));
-
- req_cf.b_cphs = arg_cphs;
- dbg("req_cf.b_cphs[%d]", req_cf.b_cphs);
-
- if(req_cf.b_cphs) {
- req_cf.cphs_cf.b_line1 = arg_cphs_line1;
- req_cf.cphs_cf.b_line2 = arg_cphs_line2;
- req_cf.cphs_cf.b_fax = arg_cphs_fax;
- req_cf.cphs_cf.b_data = arg_cphs_data;
- dbg("req_cf.cphs_cf.b_line1[%d]", req_cf.cphs_cf.b_line1);
- dbg("req_cf.cphs_cf.b_line2[%d]", req_cf.cphs_cf.b_line2);
- dbg("req_cf.cphs_cf.b_fax[%d]", req_cf.cphs_cf.b_fax);
- dbg("req_cf.cphs_cf.b_data[%d]", req_cf.cphs_cf.b_data);
- } else {
- req_cf.cf.rec_index = arg_rec_index;
- req_cf.cf.msp_num = arg_msp_num;
- req_cf.cf.cfu_status = arg_cfu_status;
- req_cf.cf.ton = arg_ton;
- req_cf.cf.npi = arg_npi;
- memcpy(&req_cf.cf.cfu_num, arg_number, strlen(arg_number));
- req_cf.cf.cc2_id = arg_cc2_id;
- req_cf.cf.ext7_id = arg_ext7_id;
- dbg("req_cf.cf.rec_index[%d]", req_cf.cf.rec_index);
- dbg("req_cf.cf.msp_num[%d]", req_cf.cf.msp_num);
- dbg("req_cf.cf.cfu_status[0x%x]", req_cf.cf.cfu_status);
- dbg("req_cf.cf.ton[%d]", req_cf.cf.ton);
- dbg("req_cf.cf.npi[%d]", req_cf.cf.npi);
- dbg("req_cf.cf.cfu_num[%s]", req_cf.cf.cfu_num);
- dbg("req_cf.cf.cc2_id[%d]", req_cf.cf.cc2_id);
- dbg("req_cf.cf.ext7_id[%d]", req_cf.cf.ext7_id);
- }
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_callforwarding), &req_cf);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_CALLFORWARDING);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_set_call_forwarding (sim, invocation, SIM_ACCESS_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_message_waiting(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_MESSAGEWAITING);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariant *gv_mw = NULL;
- GVariant *gv_cphs_mw = NULL;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv_mw = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- gv_cphs_mw = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_message_waiting(sim, invocation, SIM_ACCESS_FAILED, 0, gv_mw, gv_cphs_mw);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_set_message_waiting(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gboolean arg_cphs,
- gint arg_rec_index,
- guchar arg_indicator_status,
- gint arg_voice_cnt,
- gint arg_fax_cnt,
- gint arg_email_cnt,
- gint arg_other_cnt,
- gint arg_video_cnt,
- gboolean arg_cphs_voice1,
- gboolean arg_cphs_voice2,
- gboolean arg_cphs_fax,
- gboolean arg_cphs_data,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_set_messagewaiting req_mw;
-
- if (check_access_control(invocation, AC_SIM, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- memset(&req_mw, 0, sizeof(struct treq_sim_set_messagewaiting));
-
- req_mw.b_cphs = arg_cphs;
- dbg("req_mw.b_cphs[%d]", req_mw.b_cphs);
-
- if(req_mw.b_cphs) {
- req_mw.cphs_mw.b_voice1 = arg_cphs_voice1;
- req_mw.cphs_mw.b_voice2 = arg_cphs_voice2;
- req_mw.cphs_mw.b_fax = arg_cphs_fax;
- req_mw.cphs_mw.b_data = arg_cphs_data;
- dbg("req_mw.cphs_mw.b_voice1[%d]", req_mw.cphs_mw.b_voice1);
- dbg("req_mw.cphs_mw.b_voice2[%d]", req_mw.cphs_mw.b_voice2);
- dbg("req_mw.cphs_mw.b_fax[%d]", req_mw.cphs_mw.b_fax);
- dbg("req_mw.cphs_mw.b_fax[%d]", req_mw.cphs_mw.b_fax);
- } else {
- req_mw.mw.rec_index = arg_rec_index;
- req_mw.mw.indicator_status = arg_indicator_status;
- req_mw.mw.voice_count = arg_voice_cnt;
- req_mw.mw.fax_count = arg_fax_cnt;
- req_mw.mw.email_count = arg_email_cnt;
- req_mw.mw.other_count = arg_other_cnt;
- req_mw.mw.video_count = arg_video_cnt;
-
- dbg("req_mw.mw.rec_index[%d]", req_mw.mw.rec_index);
- dbg("req_mw.mw.indicator_status[0x%x]", req_mw.mw.indicator_status);
- dbg("req_mw.mw.voice_count[%d]", req_mw.mw.voice_count);
- dbg("req_mw.mw.fax_count[%d]", req_mw.mw.fax_count);
- dbg("req_mw.mw.email_count[%d]", req_mw.mw.email_count);
- dbg("req_mw.mw.other_count[%d]", req_mw.mw.other_count);
- dbg("req_mw.mw.video_count[%d]", req_mw.mw.video_count);
- }
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_messagewaiting), &req_mw);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_MESSAGEWAITING);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_set_message_waiting(sim, invocation, SIM_ACCESS_FAILED);
- tcore_user_request_unref(ur);
- }
- return TRUE;
-}
-
-static gboolean on_sim_get_mailbox(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_MAILBOX);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariant *gv = NULL;
- GVariantBuilder b;
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv = g_variant_builder_end(&b);
- telephony_sim_complete_get_mailbox (sim, invocation, SIM_ACCESS_FAILED, 0, gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_set_mailbox(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gboolean arg_cphs,
- gint arg_type,
- gint arg_rec_index,
- gint arg_profile_number,
- gint arg_alpha_id_max_len,
- const gchar *arg_alpha_id,
- gint arg_ton,
- gint arg_npi,
- const gchar *arg_number,
- gint arg_cc_id,
- gint arg_ext1_id,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_set_mailbox req_mb;
-
- if (check_access_control(invocation, AC_SIM, "w") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- memset(&req_mb, 0, sizeof(struct treq_sim_set_mailbox));
-
- req_mb.b_cphs = arg_cphs;
- dbg("req_mb.b_cphs[%d]", req_mb.b_cphs);
-
- req_mb.mb_info.mb_type = arg_type;
- req_mb.mb_info.rec_index = arg_rec_index;
- req_mb.mb_info.profile_number = arg_profile_number;
- req_mb.mb_info.number_info.alpha_id_max_len = arg_alpha_id_max_len;
- if(strlen(arg_alpha_id))
- memcpy(&req_mb.mb_info.number_info.alpha_id, arg_alpha_id, strlen(arg_alpha_id));
- req_mb.mb_info.number_info.ton = arg_npi;
- req_mb.mb_info.number_info.npi = arg_npi;
- if(strlen(arg_number))
- memcpy(&req_mb.mb_info.number_info.num, arg_number, strlen(arg_number));
- req_mb.mb_info.number_info.cc_id = arg_ext1_id;
- req_mb.mb_info.number_info.ext1_id = arg_ext1_id;
-
- dbg("req_mb.mb_info.mb_type[%d]", req_mb.mb_info.mb_type);
- dbg("req_mb.mb_info.rec_index[%d]", req_mb.mb_info.rec_index);
- dbg("req_mb.mb_info.profile_number[%d]", req_mb.mb_info.profile_number);
- dbg("req_mb.mb_info.number_info.alpha_id_max_len[%d]", req_mb.mb_info.number_info.alpha_id_max_len);
- dbg("req_mb.mb_info.number_info.alpha_id[%s]", req_mb.mb_info.number_info.alpha_id);
- dbg("req_mb.mb_info.number_info.ton[%d]", req_mb.mb_info.number_info.ton);
- dbg("req_mb.mb_info.number_info.npi[%d]", req_mb.mb_info.number_info.npi);
- dbg("req_mb.mb_info.number_info.num[%s]", req_mb.mb_info.number_info.num);
- dbg("req_mb.mb_info.number_info.cc_id[%d]", req_mb.mb_info.number_info.cc_id);
- dbg("req_mb.mb_info.number_info.ext1_id[%d]", req_mb.mb_info.number_info.ext1_id);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_set_mailbox), &req_mb);
- tcore_user_request_set_command(ur, TREQ_SIM_SET_MAILBOX);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_set_mailbox (sim, invocation, SIM_ACCESS_FAILED);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_cphsinfo(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_CPHS_INFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_get_cphsinfo (sim, invocation, SIM_ACCESS_FAILED, 0, 0, 0, 0, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_msisdn(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_MSISDN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariant *gv = NULL;
- GVariantBuilder b;
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv = g_variant_builder_end(&b);
- telephony_sim_complete_get_msisdn (sim, invocation, SIM_ACCESS_FAILED, gv);
- g_variant_unref(gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_oplmnwact(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_OPLMNWACT);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariant *gv = NULL;
- GVariantBuilder b;
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv = g_variant_builder_end(&b);
- telephony_sim_complete_get_oplmnwact (sim, invocation, SIM_ACCESS_FAILED, gv);
- g_variant_unref(gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_spn(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_SPN);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_get_spn (sim, invocation, SIM_ACCESS_FAILED, 0, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_cphs_netname(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_CPHS_NETNAME);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_get_cphs_net_name (sim, invocation, SIM_ACCESS_FAILED, NULL, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_authentication(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- GVariant *arg_rand,
- GVariant *arg_autn,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- GVariantIter *iter = NULL;
- GVariant *rand_gv = NULL;
- GVariant *autn_gv = NULL;
- guchar rt_i;
- int i =0;
- TReturn ret;
- struct treq_sim_req_authentication req_auth;
-
- if (check_access_control(invocation, AC_SIM, "x") == FALSE)
- return FALSE;
-
- memset(&req_auth, 0, sizeof(struct treq_sim_req_authentication));
-
- req_auth.auth_type = arg_type;
-
- rand_gv = g_variant_get_variant(arg_rand);
- g_variant_get(rand_gv, "ay", &iter);
- while ( g_variant_iter_loop (iter, "y", &rt_i)) {
- req_auth.rand_data[i] = rt_i;
- i++;
- }
- req_auth.rand_length = (unsigned int)i;
-
- i = 0;
- autn_gv = g_variant_get_variant(arg_autn);
- g_variant_get(autn_gv, "ay", &iter);
- while ( g_variant_iter_loop (iter, "y", &rt_i)) {
- req_auth.autn_data[i] = rt_i;
- i++;
- }
- req_auth.autn_length = (unsigned int)i;
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_req_authentication), &req_auth);
- tcore_user_request_set_command(ur, TREQ_SIM_REQ_AUTHENTICATION);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariantBuilder *builder = NULL;
- GVariant *ak = NULL;
- GVariant *cp = NULL;
- GVariant *it = NULL;
- GVariant *resp = NULL;
- GVariant *ak_gv = NULL;
- GVariant *cp_gv = NULL;
- GVariant *it_gv = NULL;
- GVariant *resp_gv = NULL;
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- ak = g_variant_builder_end(builder);
- ak_gv = g_variant_new("v", ak);
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- cp = g_variant_builder_end(builder);
- cp_gv = g_variant_new("v", cp);
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- it = g_variant_builder_end(builder);
- it_gv = g_variant_new("v", it);
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- resp = g_variant_builder_end(builder);
- resp_gv = g_variant_new("v", resp);
-
- telephony_sim_complete_authentication (sim, invocation, SIM_ACCESS_FAILED, 0, 0, ak_gv, cp_gv, it_gv, resp_gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_verify_sec(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_password,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_verify_pins verify_pins;
-
- if (check_access_control(invocation, AC_SIM, "x") == FALSE)
- return FALSE;
-
- memset(&verify_pins, 0, sizeof(struct treq_sim_verify_pins));
-
- verify_pins.pin_type = arg_type;
- verify_pins.pin_length = strlen(arg_password);
- memcpy(verify_pins.pin, arg_password, verify_pins.pin_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_verify_pins), &verify_pins);
- tcore_user_request_set_command(ur, TREQ_SIM_VERIFY_PINS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_verify_sec(sim, invocation, SIM_INCOMPATIBLE_PIN_OPERATION, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_verify_puk(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_puk,
- const gchar *arg_new_pin,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_verify_puks verify_puks;
-
- if (check_access_control(invocation, AC_SIM, "x") == FALSE)
- return FALSE;
-
- memset(&verify_puks, 0, sizeof(struct treq_sim_verify_puks));
-
- verify_puks.puk_type = arg_type;
- verify_puks.puk_length = strlen(arg_puk);
- memcpy(verify_puks.puk, arg_puk, verify_puks.puk_length);
- verify_puks.pin_length = strlen(arg_new_pin);
- memcpy(verify_puks.pin, arg_new_pin, verify_puks.pin_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_verify_puks), &verify_puks);
- tcore_user_request_set_command(ur, TREQ_SIM_VERIFY_PUKS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_verify_puk(sim, invocation, SIM_INCOMPATIBLE_PIN_OPERATION, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_change_pin(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_old_password,
- const gchar *arg_new_password,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_change_pins change_pins;
-
- if (check_access_control(invocation, AC_SIM, "x") == FALSE)
- return FALSE;
-
- memset(&change_pins, 0, sizeof(struct treq_sim_change_pins));
-
- change_pins.type = arg_type;
- change_pins.old_pin_length = strlen(arg_old_password);
- memcpy(change_pins.old_pin, arg_old_password, change_pins.old_pin_length);
- change_pins.new_pin_length = strlen(arg_new_password);
- memcpy(change_pins.new_pin, arg_new_password, change_pins.new_pin_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_change_pins), &change_pins);
- tcore_user_request_set_command(ur, TREQ_SIM_CHANGE_PINS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_change_pin(sim, invocation, SIM_INCOMPATIBLE_PIN_OPERATION, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_disable_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_password,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_disable_facility dis_facility;
-
- if (check_access_control(invocation, AC_SIM, "x") == FALSE)
- return FALSE;
-
- memset(&dis_facility, 0, sizeof(struct treq_sim_disable_facility));
-
- dbg("arg_type[%d]", arg_type);
- switch (arg_type) {
- case 1:
- dis_facility.type = SIM_FACILITY_PS;
- break;
- case 3:
- dis_facility.type = SIM_FACILITY_SC;
- break;
- case 4:
- dis_facility.type = SIM_FACILITY_FD;
- break;
- case 5:
- dis_facility.type = SIM_FACILITY_PN;
- break;
- case 6:
- dis_facility.type = SIM_FACILITY_PU;
- break;
- case 7:
- dis_facility.type = SIM_FACILITY_PP;
- break;
- case 8:
- dis_facility.type = SIM_FACILITY_PC;
- break;
- default:
- dbg("error - not handled type[%d]", arg_type);
- break;
- }
- dis_facility.password_length = strlen(arg_password);
- memcpy(dis_facility.password, arg_password, dis_facility.password_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_disable_facility), &dis_facility);
- tcore_user_request_set_command(ur, TREQ_SIM_DISABLE_FACILITY);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_disable_facility(sim, invocation, SIM_INCOMPATIBLE_PIN_OPERATION, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_enable_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- const gchar *arg_password,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_enable_facility en_facility;
-
- if (check_access_control(invocation, AC_SIM, "x") == FALSE)
- return FALSE;
-
- memset(&en_facility, 0, sizeof(struct treq_sim_enable_facility));
-
- dbg("arg_type[%d]", arg_type);
- switch (arg_type) {
- case 1:
- en_facility.type = SIM_FACILITY_PS;
- break;
- case 3:
- en_facility.type = SIM_FACILITY_SC;
- break;
- case 4:
- en_facility.type = SIM_FACILITY_FD;
- break;
- case 5:
- en_facility.type = SIM_FACILITY_PN;
- break;
- case 6:
- en_facility.type = SIM_FACILITY_PU;
- break;
- case 7:
- en_facility.type = SIM_FACILITY_PP;
- break;
- case 8:
- en_facility.type = SIM_FACILITY_PC;
- break;
- default:
- dbg("error - not handled type[%d]", arg_type);
- break;
- }
- en_facility.password_length = strlen(arg_password);
- memcpy(en_facility.password, arg_password, en_facility.password_length);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_enable_facility), &en_facility);
- tcore_user_request_set_command(ur, TREQ_SIM_ENABLE_FACILITY);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_enable_facility(sim, invocation, SIM_INCOMPATIBLE_PIN_OPERATION, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_facility(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_get_facility_status facility;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- memset(&facility, 0, sizeof(struct treq_sim_get_facility_status));
-
- dbg("arg_type[%d]", arg_type);
- switch (arg_type) {
- case 1:
- facility.type = SIM_FACILITY_PS;
- break;
- case 3:
- facility.type = SIM_FACILITY_SC;
- break;
- case 4:
- facility.type = SIM_FACILITY_FD;
- break;
- case 5:
- facility.type = SIM_FACILITY_PN;
- break;
- case 6:
- facility.type = SIM_FACILITY_PU;
- break;
- case 7:
- facility.type = SIM_FACILITY_PP;
- break;
- case 8:
- facility.type = SIM_FACILITY_PC;
- break;
- default:
- dbg("error - not handled type[%d]", arg_type);
- break;
- }
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_facility_status), &facility);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_FACILITY_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_get_facility(sim, invocation, SIM_INCOMPATIBLE_PIN_OPERATION, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_lock_info(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gint arg_type,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
- struct treq_sim_get_lock_info lock_info;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- memset(&lock_info, 0, sizeof(struct treq_sim_get_lock_info));
-
- dbg("arg_type[%d]", arg_type);
- switch (arg_type) {
- case 1:
- lock_info.type = SIM_FACILITY_PS;
- break;
- case 3:
- lock_info.type = SIM_FACILITY_SC;
- break;
- case 4:
- lock_info.type = SIM_FACILITY_FD;
- break;
- case 5:
- lock_info.type = SIM_FACILITY_PN;
- break;
- case 6:
- lock_info.type = SIM_FACILITY_PU;
- break;
- case 7:
- lock_info.type = SIM_FACILITY_PP;
- break;
- case 8:
- lock_info.type = SIM_FACILITY_PC;
- break;
- default:
- dbg("error - not handled type[%d]", arg_type);
- break;
- }
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_get_lock_info), &lock_info);
- tcore_user_request_set_command(ur, TREQ_SIM_GET_LOCK_INFO);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- telephony_sim_complete_get_lock_info(sim, invocation, SIM_INCOMPATIBLE_PIN_OPERATION, 0, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_transfer_apdu(TelephonySim *sim, GDBusMethodInvocation *invocation,
- GVariant *arg_apdu,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- struct treq_sim_transmit_apdu send_apdu;
- GVariantIter *iter = NULL;
- GVariant *inner_gv = NULL;
- guchar rt_i;
- int i =0;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "x") == FALSE)
- return FALSE;
-
- dbg("Func Entrance");
- memset(&send_apdu, 0, sizeof(struct treq_sim_transmit_apdu));
-
- inner_gv = g_variant_get_variant(arg_apdu);
-
- g_variant_get(inner_gv, "ay", &iter);
- while ( g_variant_iter_loop (iter, "y", &rt_i)) {
- send_apdu.apdu[i] = rt_i;
- i++;
- }
- send_apdu.apdu_length = (unsigned int)i;
- g_variant_iter_free(iter);
- g_variant_unref(inner_gv);
- g_variant_unref(arg_apdu);
-
- for(i=0; i < (int)send_apdu.apdu_length; i++)
- dbg("apdu[%d][0x%02x]",i, send_apdu.apdu[i]);
-
- ur = MAKE_UR(ctx, sim, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sim_transmit_apdu), &send_apdu);
- tcore_user_request_set_command(ur, TREQ_SIM_TRANSMIT_APDU);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariantBuilder *builder = NULL;
- GVariant * apdu_gv = NULL;
- GVariant *inner_gv = NULL;
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- inner_gv = g_variant_builder_end(builder);
- apdu_gv = g_variant_new("v", inner_gv);
- telephony_sim_complete_transfer_apdu(sim, invocation, SIM_ACCESS_FAILED, apdu_gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean on_sim_get_atr(TelephonySim *sim, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- TReturn ret;
-
- if (check_access_control(invocation, AC_SIM, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sim, invocation);
-
- tcore_user_request_set_command(ur, TREQ_SIM_GET_ATR);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if(ret != TCORE_RETURN_SUCCESS) {
- GVariantBuilder *builder = NULL;
- GVariant * atr_gv = NULL;
- GVariant *inner_gv = NULL;
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- inner_gv = g_variant_builder_end(builder);
- atr_gv = g_variant_new("v", inner_gv);
-
- telephony_sim_complete_get_atr(sim, invocation, SIM_ACCESS_FAILED, atr_gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_sim_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySim *sim;
-
- sim = telephony_sim_skeleton_new();
- telephony_object_skeleton_set_sim(object, sim);
- g_object_unref(sim);
-
- dbg("sim = %p", sim);
-
- g_signal_connect (sim,
- "handle-get-init-status",
- G_CALLBACK (on_sim_get_init_status),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-card-type",
- G_CALLBACK (on_sim_get_card_type),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-imsi",
- G_CALLBACK (on_sim_get_imsi),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-ecc",
- G_CALLBACK (on_sim_get_ecc),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-iccid",
- G_CALLBACK (on_sim_get_iccid),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-language",
- G_CALLBACK (on_sim_get_language),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-language",
- G_CALLBACK (on_sim_set_language),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-call-forwarding",
- G_CALLBACK (on_sim_get_call_forwarding),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-call-forwarding",
- G_CALLBACK (on_sim_set_call_forwarding),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-message-waiting",
- G_CALLBACK (on_sim_get_message_waiting),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-message-waiting",
- G_CALLBACK (on_sim_set_message_waiting),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-mailbox",
- G_CALLBACK (on_sim_get_mailbox),
- ctx);
-
- g_signal_connect (sim,
- "handle-set-mailbox",
- G_CALLBACK (on_sim_set_mailbox),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-cphsinfo",
- G_CALLBACK (on_sim_get_cphsinfo),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-msisdn",
- G_CALLBACK (on_sim_get_msisdn),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-oplmnwact",
- G_CALLBACK (on_sim_get_oplmnwact),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-spn",
- G_CALLBACK (on_sim_get_spn),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-cphs-net-name",
- G_CALLBACK (on_sim_get_cphs_netname),
- ctx);
-
- g_signal_connect (sim,
- "handle-authentication",
- G_CALLBACK (on_sim_authentication),
- ctx);
-
- g_signal_connect (sim,
- "handle-verify-sec",
- G_CALLBACK (on_sim_verify_sec),
- ctx);
-
- g_signal_connect (sim,
- "handle-verify-puk",
- G_CALLBACK (on_sim_verify_puk),
- ctx);
-
- g_signal_connect (sim,
- "handle-change-pin",
- G_CALLBACK (on_sim_change_pin),
- ctx);
-
- g_signal_connect (sim,
- "handle-disable-facility",
- G_CALLBACK (on_sim_disable_facility),
- ctx);
-
- g_signal_connect (sim,
- "handle-enable-facility",
- G_CALLBACK (on_sim_enable_facility),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-facility",
- G_CALLBACK (on_sim_get_facility),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-lock-info",
- G_CALLBACK (on_sim_get_lock_info),
- ctx);
-
- g_signal_connect (sim,
- "handle-transfer-apdu",
- G_CALLBACK (on_sim_transfer_apdu),
- ctx);
-
- g_signal_connect (sim,
- "handle-get-atr",
- G_CALLBACK (on_sim_get_atr),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sim_response(struct custom_data *ctx, UserRequest *ur,
- struct dbus_request_info *dbus_info, enum tcore_response_command command,
- unsigned int data_len, const void *data)
-{
- const struct tresp_sim_verify_pins *resp_verify_pins = data;
- const struct tresp_sim_verify_puks *resp_verify_puks = data;
- const struct tresp_sim_change_pins *resp_change_pins = data;
- const struct tresp_sim_get_facility_status *resp_get_facility = data;
- const struct tresp_sim_disable_facility *resp_dis_facility = data;
- const struct tresp_sim_enable_facility *resp_en_facility = data;
- const struct tresp_sim_transmit_apdu *resp_apdu = data;
- const struct tresp_sim_get_atr *resp_get_atr = data;
- const struct tresp_sim_read *resp_read = data;
- const struct tresp_sim_req_authentication *resp_auth = data;
- const struct tresp_sim_set_data *resp_set_data = data;
- const struct tresp_sim_get_lock_info *resp_lock = data;
- gint f_type =0;
- int i =0;
- dbg("Command = [0x%x], data_len = %d", command, data_len);
-
- switch (command) {
- case TRESP_SIM_GET_ECC:
- dbg("resp comm - TRESP_SIM_GET_ECC");
- memcpy((void*)&ctx->cached_sim_ecc, (const void*)&resp_read->data.ecc, sizeof(struct tel_sim_ecc_list));
- break;
-
- case TRESP_SIM_GET_ICCID:
- dbg("resp comm - TRESP_SIM_GET_ICCID");
- dbg("dbus_info->interface_object[%p], dbus_info->invocation[%p],dbus_info->interface_object, dbus_info->invocation");
- dbg("result[%d], iccid[%s]", resp_read->result, resp_read->data.iccid.iccid);
- telephony_sim_complete_get_iccid(dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.iccid.iccid);
- break;
-
- case TRESP_SIM_GET_LANGUAGE:
- dbg("resp comm - TRESP_SIM_GET_LANGUAGE");
- telephony_sim_complete_get_language(dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.language.language[0]);
- break;
-
- case TRESP_SIM_SET_LANGUAGE:
- dbg("resp comm - TRESP_SIM_SET_LANGUAGE");
- telephony_sim_complete_set_language(dbus_info->interface_object, dbus_info->invocation,
- resp_set_data->result);
- break;
-
- case TRESP_SIM_GET_CALLFORWARDING:{
- GVariant *gv_cf = NULL;
- GVariant *gv_cphs_cf = NULL;
- GVariantBuilder b;
- dbg("resp comm - TRESP_SIM_GET_CALLFORWARDING");
- dbg("resp_read->result[%d]", resp_read->result);
- dbg("resp_read->data.cf.b_cphs[%d]", resp_read->data.cf.b_cphs);
-
- if(resp_read->data.cf.b_cphs){
- dbg("resp_read->data.cf.cphs_cf.b_line1[%d]",resp_read->data.cf.cphs_cf.b_line1);
- dbg("resp_read->data.cf.cphs_cf.b_line2[%d]",resp_read->data.cf.cphs_cf.b_line2);
- dbg("resp_read->data.cf.cphs_cf.b_fax[%d]",resp_read->data.cf.cphs_cf.b_fax);
- dbg("resp_read->data.cf.cphs_cf.b_data[%d]",resp_read->data.cf.cphs_cf.b_data);
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "b_line1", g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_line1));
- g_variant_builder_add(&b, "{sv}", "b_line2", g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_line2));
- g_variant_builder_add(&b, "{sv}", "b_fax", g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_fax));
- g_variant_builder_add(&b, "{sv}", "b_data", g_variant_new_boolean(resp_read->data.cf.cphs_cf.b_data));
- gv_cphs_cf = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv_cf = g_variant_builder_end(&b);
-
- } else {
- dbg("resp_read->data.cf.cf_list.profile_count[%d]",resp_read->data.cf.cf_list.profile_count);
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for(i=0; i < resp_read->data.cf.cf_list.profile_count; i++) {
- dbg("resp_read->data.cf_list.cf[%d].rec_index[0x%x]", i, resp_read->data.cf.cf_list.cf[i].rec_index);
- dbg("resp_read->data.cf_list.cf[%d].msp_num[0x%x]", i, resp_read->data.cf.cf_list.cf[i].msp_num);
- dbg("resp_read->data.cf_list.cf[%d].cfu_status[0x%x]", i, resp_read->data.cf.cf_list.cf[i].cfu_status);
- dbg("resp_read->data.cf_list.cf[%d].cfu_num[%s]", i, resp_read->data.cf.cf_list.cf[i].cfu_num);
- dbg("resp_read->data.cf_list.cf[%d].ton[0x%x]", i, resp_read->data.cf.cf_list.cf[i].ton);
- dbg("resp_read->data.cf_list.cf[%d].npi[0x%x]", i, resp_read->data.cf.cf_list.cf[i].npi);
- dbg("resp_read->data.cf_list.cf[%d].cc2_id[0x%x]", i, resp_read->data.cf.cf_list.cf[i].cc2_id);
- dbg("resp_read->data.cf_list.cf[%d].ext7_id[0x%x]", i, resp_read->data.cf.cf_list.cf[i].ext7_id);
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "rec_index", g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].rec_index));
- g_variant_builder_add(&b, "{sv}", "msp_num", g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].msp_num));
- g_variant_builder_add(&b, "{sv}", "cfu_status", g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].cfu_status));
- g_variant_builder_add(&b, "{sv}", "cfu_num", g_variant_new_string(resp_read->data.cf.cf_list.cf[i].cfu_num));
- g_variant_builder_add(&b, "{sv}", "ton", g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].ton));
- g_variant_builder_add(&b, "{sv}", "npi", g_variant_new_int32(resp_read->data.cf.cf_list.cf[i].npi));
- g_variant_builder_add(&b, "{sv}", "cc2_id", g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].cc2_id));
- g_variant_builder_add(&b, "{sv}", "ext7_id", g_variant_new_byte(resp_read->data.cf.cf_list.cf[i].ext7_id));
- g_variant_builder_close(&b);
- }
- gv_cf = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- gv_cphs_cf = g_variant_builder_end(&b);
- }
-
- telephony_sim_complete_get_call_forwarding (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.cf.b_cphs,
- gv_cf,
- gv_cphs_cf);
- }
- break;
-
- case TRESP_SIM_SET_CALLFORWARDING:
- dbg("resp comm - TRESP_SIM_SET_CALLFORWARDING");
- telephony_sim_complete_set_call_forwarding(dbus_info->interface_object, dbus_info->invocation,
- resp_set_data->result);
- break;
-
- case TRESP_SIM_GET_MESSAGEWAITING:{
- GVariant *gv_mw = NULL;
- GVariant *gv_cphs_mw = NULL;
- GVariantBuilder b;
- dbg("resp comm - TRESP_SIM_GET_MESSAGEWAITING");
- dbg("resp_read->result[%d]", resp_read->result);
- dbg("resp_read->data.mw.b_cphs[%d]", resp_read->data.mw.b_cphs);
-
- if(resp_read->data.mw.b_cphs) {
- dbg("resp_read->data.mw.cphs_mw.b_voice1[%d]", resp_read->data.mw.cphs_mw.b_voice1 );
- dbg("resp_read->data.mw.cphs_mw.b_voice2[%d]", resp_read->data.mw.cphs_mw.b_voice2 );
- dbg("resp_read->data.mw.cphs_mw.b_fax[%d]", resp_read->data.mw.cphs_mw.b_fax );
- dbg("resp_read->data.mw.cphs_mw.b_data[%d]", resp_read->data.mw.cphs_mw.b_data );
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "b_voice1", g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_voice1));
- g_variant_builder_add(&b, "{sv}", "b_voice2", g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_voice2));
- g_variant_builder_add(&b, "{sv}", "b_fax", g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_fax));
- g_variant_builder_add(&b, "{sv}", "b_data", g_variant_new_boolean(resp_read->data.mw.cphs_mw.b_data));
- gv_cphs_mw = g_variant_builder_end(&b);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv_mw = g_variant_builder_end(&b);
-
- } else {
- dbg("resp_read->data.mw.mw_list.profile_count[%d]", resp_read->data.mw.mw_list.profile_count);
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- for(i=0; i <resp_read->data.mw.mw_list.profile_count; i++){
- dbg("resp_read->data.mw.mw_list.mw[%d].rec_index[0x%x]", i, resp_read->data.mw.mw_list.mw[i].rec_index );
- dbg("resp_read->data.mw.mw_list.mw[%d].indicator_status[0x%x]", i, resp_read->data.mw.mw_list.mw[i].indicator_status );
- dbg("resp_read->data.mw.mw_list.mw[%d].voice_count[0x%x]", i, resp_read->data.mw.mw_list.mw[i].voice_count );
- dbg("resp_read->data.mw.mw_list.mw[%d].fax_count[0x%x]", i, resp_read->data.mw.mw_list.mw[i].fax_count );
- dbg("resp_read->data.mw.mw_list.mw[%d].email_count[0x%x]", i, resp_read->data.mw.mw_list.mw[i].email_count );
- dbg("resp_read->data.mw.mw_list.mw[%d].other_count[0x%x]", i, resp_read->data.mw.mw_list.mw[i].other_count );
- dbg("resp_read->data.mw.mw_list.mw[%d].video_count[0x%x]", i, resp_read->data.mw.mw_list.mw[i].video_count );
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b,"{sv}", "rec_index", g_variant_new_int32( resp_read->data.mw.mw_list.mw[i].rec_index));
- g_variant_builder_add(&b, "{sv}", "indicator_status", g_variant_new_byte(resp_read->data.mw.mw_list.mw[i].indicator_status));
- g_variant_builder_add(&b,"{sv}", "voice_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].voice_count));
- g_variant_builder_add(&b,"{sv}", "fax_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].fax_count));
- g_variant_builder_add(&b, "{sv}", "email_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].email_count));
- g_variant_builder_add(&b, "{sv}", "other_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].other_count));
- g_variant_builder_add(&b, "{sv}", "video_count", g_variant_new_int32(resp_read->data.mw.mw_list.mw[i].video_count));
- g_variant_builder_close(&b);
- }
- gv_mw = g_variant_builder_end(&b);
- g_variant_builder_init(&b, G_VARIANT_TYPE("a{sv}"));
- gv_cphs_mw = g_variant_builder_end(&b);
- }
-
- telephony_sim_complete_get_message_waiting(dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.mw.b_cphs,
- gv_mw,
- gv_cphs_mw);
- }
- break;
-
- case TRESP_SIM_SET_MESSAGEWAITING:
- dbg("resp comm - TRESP_SIM_SET_MESSAGEWAITING");
- telephony_sim_complete_set_message_waiting(dbus_info->interface_object, dbus_info->invocation,
- resp_set_data->result);
- break;
-
- case TRESP_SIM_GET_MAILBOX: {
- GVariant *gv = NULL;
- GVariantBuilder b;
- dbg("resp comm - TRESP_SIM_GET_MAILBOX");
- dbg("resp_read->data.mb.b_cphs[%d]", resp_read->data.mb.b_cphs);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for(i =0; i < resp_read->data.mb.count; i++){
- dbg("resp_read->data.mb.mb[%d].rec_index[%d]", i, resp_read->data.mb.mb[i].rec_index);
- dbg("resp_read->data.mb.mb[%d].profile_number[%d]", i, resp_read->data.mb.mb[i].profile_number);
- dbg("resp_read->data.mb.mb[%d].mb_type[%d]", i, resp_read->data.mb.mb[i].mb_type);
- dbg("resp_read->data.mb.mb[%d].number_info.alpha_id_max_len[%d]", i, resp_read->data.mb.mb[i].number_info.alpha_id_max_len);
- dbg("resp_read->data.mb.mb[%d].number_info.alpha_id[%s]", i, resp_read->data.mb.mb[i].number_info.alpha_id);
- dbg("resp_read->data.mb.mb[%d].number_info.ton[%d]", i, resp_read->data.mb.mb[i].number_info.ton);
- dbg("resp_read->data.mb.mb[%d].number_info.npi[%d]", i, resp_read->data.mb.mb[i].number_info.npi);
- dbg("resp_read->data.mb.mb[%d].number_info.num[%s]", i, resp_read->data.mb.mb[i].number_info.num);
- dbg("resp_read->data.mb.mb[%d].number_info.cc_id[%d]", i, resp_read->data.mb.mb[i].number_info.cc_id);
- dbg("resp_read->data.mb.mb[%d].number_info.ext1_id[%d]", i, resp_read->data.mb.mb[i].number_info.ext1_id);
-
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "rec_index", g_variant_new_int32(resp_read->data.mb.mb[i].rec_index));
- g_variant_builder_add(&b, "{sv}", "profile_num", g_variant_new_int32(resp_read->data.mb.mb[i].profile_number));
- g_variant_builder_add(&b, "{sv}", "mb_type", g_variant_new_int32(resp_read->data.mb.mb[i].mb_type));
- g_variant_builder_add(&b, "{sv}", "alpha_id_max_len", g_variant_new_int32(resp_read->data.mb.mb[i].number_info.alpha_id_max_len));
- g_variant_builder_add(&b, "{sv}", "alpha_id", g_variant_new_string(resp_read->data.mb.mb[i].number_info.alpha_id));
- g_variant_builder_add(&b, "{sv}", "ton", g_variant_new_int32(resp_read->data.mb.mb[i].number_info.ton));
- g_variant_builder_add(&b, "{sv}", "npi", g_variant_new_int32(resp_read->data.mb.mb[i].number_info.npi));
- g_variant_builder_add(&b, "{sv}", "num", g_variant_new_string(resp_read->data.mb.mb[i].number_info.num));
- g_variant_builder_add(&b, "{sv}", "cc_id", g_variant_new_byte(resp_read->data.mb.mb[i].number_info.cc_id));
- g_variant_builder_add(&b, "{sv}", "ext1_id", g_variant_new_byte(resp_read->data.mb.mb[i].number_info.ext1_id));
- g_variant_builder_close(&b);
- }
-
- gv = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_mailbox (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.mb.b_cphs,
- gv);
- g_variant_unref(gv);
- }
- break;
-
- case TRESP_SIM_SET_MAILBOX:
- dbg("resp comm - TRESP_SIM_SET_MAILBOX");
- telephony_sim_complete_set_mailbox(dbus_info->interface_object, dbus_info->invocation,
- resp_set_data->result);
- break;
-
- case TRESP_SIM_GET_CPHS_INFO:
- dbg("resp comm - TRESP_SIM_GET_CPHS_INFO");
- telephony_sim_complete_get_cphsinfo (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.cphs.CphsPhase,
- resp_read->data.cphs.CphsServiceTable.bOperatorNameShortForm,
- resp_read->data.cphs.CphsServiceTable.bMailBoxNumbers,
- resp_read->data.cphs.CphsServiceTable.bServiceStringTable,
- resp_read->data.cphs.CphsServiceTable.bCustomerServiceProfile,
- resp_read->data.cphs.CphsServiceTable.bInformationNumbers);
- break;
-
- case TRESP_SIM_GET_SPN:
- dbg("resp comm - TRESP_SIM_GET_SPN");
- telephony_sim_complete_get_spn (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- resp_read->data.spn.display_condition, (const gchar *)resp_read->data.spn.spn);
- break;
-
- case TRESP_SIM_GET_CPHS_NETNAME:
- dbg("resp comm - TRESP_SIM_GET_CPHS_NETNAME");
- telephony_sim_complete_get_cphs_net_name (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- (const gchar *)resp_read->data.cphs_net.full_name, (const gchar *)resp_read->data.cphs_net.short_name);
- break;
-
- case TRESP_SIM_GET_MSISDN:{
- GVariant *gv = NULL;
- GVariantBuilder b;
- dbg("resp comm - TRESP_SIM_GET_MSISDN");
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for(i=0;i < resp_read->data.msisdn_list.count; i++){
- g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "name", g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].name));
- g_variant_builder_add(&b, "{sv}", "number", g_variant_new_string((const gchar *)resp_read->data.msisdn_list.msisdn[i].num));
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_msisdn (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- gv);
- g_variant_unref(gv);
- }
- break;
-
- case TRESP_SIM_GET_OPLMNWACT:{
- GVariant *gv = NULL;
- GVariantBuilder b;
- dbg("resp comm - TRESP_SIM_GET_OPLMNWACT");
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for(i=0;i < resp_read->data.opwa.opwa_count; i++){
- g_variant_builder_open(&b,G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "plmn", g_variant_new_string((const gchar *)resp_read->data.opwa.opwa[i].plmn));
- g_variant_builder_add(&b, "{sv}", "b_umts", g_variant_new_boolean(resp_read->data.opwa.opwa[i].b_umts));
- g_variant_builder_add(&b, "{sv}", "b_gsm", g_variant_new_boolean(resp_read->data.opwa.opwa[i].b_gsm));
- g_variant_builder_close(&b);
- }
- gv = g_variant_builder_end(&b);
-
- telephony_sim_complete_get_oplmnwact (dbus_info->interface_object, dbus_info->invocation,
- resp_read->result,
- gv);
- g_variant_unref(gv);
- }
- break;
-
- case TRESP_SIM_REQ_AUTHENTICATION: {
- GVariantBuilder *builder = NULL;
- GVariant *ak = NULL;
- GVariant *cp = NULL;
- GVariant *it = NULL;
- GVariant *resp = NULL;
- GVariant *ak_gv = NULL;
- GVariant *cp_gv = NULL;
- GVariant *it_gv = NULL;
- GVariant *resp_gv = NULL;
- int i =0;
-
- dbg("resp comm - TRESP_SIM_REQ_AUTHENTICATION");
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)resp_auth->authentication_key_length; i++) {
- dbg("resp_auth->authentication_key[%d][0x%02x]", i,resp_auth->authentication_key[i]);
- g_variant_builder_add (builder, "y", resp_auth->authentication_key[i]);
- }
- ak = g_variant_builder_end(builder);
- ak_gv = g_variant_new("v", ak);
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)resp_auth->cipher_length; i++) {
- dbg("resp_auth->cipher_data[%d][0x%02x]", i,resp_auth->cipher_data[i]);
- g_variant_builder_add (builder, "y", resp_auth->cipher_data[i]);
- }
- cp = g_variant_builder_end(builder);
- cp_gv = g_variant_new("v", cp);
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)resp_auth->integrity_length; i++) {
- dbg("resp_auth->integrity_data[%d][0x%02x]", i,resp_auth->integrity_data[i]);
- g_variant_builder_add (builder, "y", resp_auth->integrity_data[i]);
- }
- it = g_variant_builder_end(builder);
- it_gv = g_variant_new("v", it);
-
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)resp_auth->resp_length; i++) {
- dbg("resp_auth->resp_data[%d][0x%02x]", i,resp_auth->resp_data[i]);
- g_variant_builder_add (builder, "y", resp_auth->resp_data[i]);
- }
- resp = g_variant_builder_end(builder);
- resp_gv = g_variant_new("v", resp);
-
- telephony_sim_complete_authentication (dbus_info->interface_object, dbus_info->invocation,
- resp_auth->result,
- resp_auth->auth_type,
- resp_auth->auth_result,
- ak_gv,
- cp_gv,
- it_gv,
- resp_gv);
- }
- break;
-
- case TRESP_SIM_VERIFY_PINS:
- dbg("resp comm - TRESP_SIM_VERIFY_PINS");
- telephony_sim_complete_verify_sec(dbus_info->interface_object, dbus_info->invocation,
- resp_verify_pins->result,
- resp_verify_pins->pin_type,
- resp_verify_pins->retry_count);
- break;
-
- case TRESP_SIM_VERIFY_PUKS:
- dbg("resp comm - TRESP_SIM_VERIFY_PUKS");
- telephony_sim_complete_verify_puk (dbus_info->interface_object, dbus_info->invocation,
- resp_verify_puks->result,
- resp_verify_puks->pin_type,
- resp_verify_puks->retry_count);
- break;
-
- case TRESP_SIM_CHANGE_PINS:
- dbg("resp comm - TRESP_SIM_CHANGE_PINS");
- telephony_sim_complete_change_pin(dbus_info->interface_object, dbus_info->invocation,
- resp_change_pins->result,
- resp_change_pins->pin_type,
- resp_change_pins->retry_count);
- break;
-
- case TRESP_SIM_DISABLE_FACILITY:
- dbg("resp comm - TRESP_SIM_DISABLE_FACILITY");
- dbg("resp_dis_facility->type[%d]", resp_dis_facility->type);
- switch (resp_dis_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
- default:
- dbg("error - not handled type[%d]", resp_dis_facility->type);
- break;
- }
- telephony_sim_complete_disable_facility(dbus_info->interface_object, dbus_info->invocation,
- resp_dis_facility->result,
- f_type,
- resp_dis_facility->retry_count);
- break;
-
- case TRESP_SIM_ENABLE_FACILITY:
- dbg("resp comm - TRESP_SIM_ENABLE_FACILITY");
- dbg("resp_en_facility->type[%d]", resp_en_facility->type);
- switch (resp_en_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
- default:
- dbg("error - not handled type[%d]", resp_en_facility->type);
- break;
- }
- telephony_sim_complete_enable_facility(dbus_info->interface_object, dbus_info->invocation,
- resp_en_facility->result,
- f_type,
- resp_en_facility->retry_count);
- break;
-
- case TRESP_SIM_GET_FACILITY_STATUS:
- dbg("resp comm - TRESP_SIM_GET_FACILITY_STATUS");
- dbg("resp_get_facility->type[%d]", resp_get_facility->type);
- switch (resp_get_facility->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
- default:
- dbg("error - not handled type[%d]", resp_get_facility->type);
- break;
- }
- telephony_sim_complete_get_facility(dbus_info->interface_object, dbus_info->invocation,
- resp_get_facility->result,
- f_type,
- resp_get_facility->b_enable);
- break;
-
- case TRESP_SIM_GET_LOCK_INFO:
- dbg("resp comm - TRESP_SIM_GET_LOCK_INFO");
- dbg("resp_lock->type[%d]", resp_lock->type);
- switch (resp_lock->type) {
- case SIM_FACILITY_PS:
- f_type = 1;
- break;
- case SIM_FACILITY_SC:
- f_type = 3;
- break;
- case SIM_FACILITY_FD:
- f_type = 4;
- break;
- case SIM_FACILITY_PN:
- f_type = 5;
- break;
- case SIM_FACILITY_PU:
- f_type = 6;
- break;
- case SIM_FACILITY_PP:
- f_type = 7;
- break;
- case SIM_FACILITY_PC:
- f_type = 8;
- break;
- default:
- dbg("error - not handled type[%d]", resp_lock->type);
- break;
- }
- telephony_sim_complete_get_lock_info(dbus_info->interface_object, dbus_info->invocation,
- resp_lock->result,
- f_type,
- resp_lock->lock_status,
- resp_lock->retry_count);
- break;
-
- case TRESP_SIM_TRANSMIT_APDU: {
- GVariantBuilder *builder = NULL;
- GVariant * apdu_gv = NULL;
- GVariant *inner_gv = NULL;
- int i =0;
-
- dbg("resp comm - TRESP_SIM_TRANSMIT_APDU");
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)resp_apdu->apdu_resp_length; i++) {
- dbg("resp_apdu->apdu_resp[%d][0x%02x]", i,resp_apdu->apdu_resp[i]);
- g_variant_builder_add (builder, "y", resp_apdu->apdu_resp[i]);
- }
- inner_gv = g_variant_builder_end(builder);
-/* g_variant_builder_unref (builder);*/
- apdu_gv = g_variant_new("v", inner_gv);
-
- telephony_sim_complete_transfer_apdu(dbus_info->interface_object, dbus_info->invocation,
- resp_apdu->result,
- apdu_gv);
- }
- break;
-
- case TRESP_SIM_GET_ATR:{
- GVariantBuilder *builder = NULL;
- GVariant * atr_gv = NULL;
- GVariant *inner_gv = NULL;
- int i =0;
-
- dbg("resp comm - TRESP_SIM_GET_ATR");
- builder = g_variant_builder_new (G_VARIANT_TYPE ("ay"));
- for(i = 0; i < (int)resp_get_atr->atr_length; i++) {
- dbg("resp_apdu->apdu_resp[%d][0x%02x]", i,resp_get_atr->atr[i]);
- g_variant_builder_add (builder, "y", resp_get_atr->atr[i]);
- }
- inner_gv = g_variant_builder_end(builder);
-/* g_variant_builder_unref (builder);*/
- atr_gv = g_variant_new("v", inner_gv);
-
- telephony_sim_complete_get_atr(dbus_info->interface_object, dbus_info->invocation,
- resp_get_atr->result,
- atr_gv);
- }
- break;
-
- default:
- dbg("not handled TRESP type[%d]", command);
- break;
- }
- return TRUE;
-}
-
-gboolean dbus_plugin_sim_notification(struct custom_data *ctx, const char *plugin_name,
- TelephonyObjectSkeleton *object, enum tcore_notification_command command,
- unsigned int data_len, const void *data)
-{
- TelephonySim *sim;
- const struct tnoti_sim_status *n_sim_status = data;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
-
- sim = telephony_object_peek_sim(TELEPHONY_OBJECT(object));
- dbg("sim = %p", sim);
-
- dbg("notification !!! (command = 0x%x, data_len = %d)", command, data_len);
-
- switch (command) {
- case TNOTI_SIM_STATUS:
- dbg("notified sim_status[%d]", n_sim_status->sim_status);
- dbus_sim_data_request(ctx, n_sim_status->sim_status, plugin_name);
- telephony_sim_emit_status (sim, n_sim_status->sim_status);
- break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_sms.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-TReturn ret = TCORE_RETURN_SUCCESS;
-
-static gboolean
-on_sms_send_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- const gchar *sca,
- gint tpdu_length,
- const gchar *tpdu_data,
- gint moreMsg,
- gpointer user_data)
-{
- struct treq_sms_send_umts_msg sendUmtsMsg;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- gsize length;
- guchar *decoded_buff = NULL;
-
- if (check_access_control(invocation, AC_SMS, "x") == FALSE)
- return FALSE;
-
- memset(&sendUmtsMsg, 0 , sizeof(struct treq_sms_send_umts_msg));
-
- decoded_buff = g_base64_decode(sca, &length);
- if ((length > SMS_ENCODED_SCA_LEN_MAX)
- || (decoded_buff[0] > SMS_SMSP_ADDRESS_LEN))
- goto invalid_param;
-
- memcpy(&(sendUmtsMsg.msgDataPackage.sca[0]), decoded_buff, length);
- g_free(decoded_buff);
-
- sendUmtsMsg.msgDataPackage.msgLength = tpdu_length;
- dbg("tpdu_length = 0x%x", tpdu_length);
-
- decoded_buff = g_base64_decode(tpdu_data, &length);
- if (length > SMS_SMDATA_SIZE_MAX + 1 || ((gsize)tpdu_length != length))
- goto invalid_param;
-
- memcpy(&(sendUmtsMsg.msgDataPackage.tpduData[0]), decoded_buff, length);
- g_free(decoded_buff);
-
- sendUmtsMsg.more = moreMsg;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_send_umts_msg), &sendUmtsMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_SEND_UMTS_MSG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_send_msg(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-
-invalid_param:
- g_free(decoded_buff);
-
- telephony_sms_complete_send_msg(sms, invocation, SMS_INVALID_PARAMETER);
- tcore_user_request_unref(ur);
-
- return TRUE;
-}
-
-static gboolean
-on_sms_read_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gpointer user_data)
-{
- struct treq_sms_read_msg readMsg = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "r") == FALSE)
- return FALSE;
-
- readMsg.index = arg_index;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_read_msg), &readMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_READ_MSG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_read_msg(sms, invocation, SMS_DEVICE_FAILURE, -1, -1, NULL, 0, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_save_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_msg_status,
- const gchar * arg_sca,
- gint arg_tpdu_length,
- const gchar * arg_tpdu_data,
- gpointer user_data)
-{
- struct treq_sms_save_msg saveMsg = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- gsize length;
- guchar *decoded_buff = NULL;
-
- if (check_access_control(invocation, AC_SMS, "w") == FALSE)
- return FALSE;
-
- saveMsg.simIndex = 0xffff;
- saveMsg.msgStatus = arg_msg_status;
-
- decoded_buff = g_base64_decode(arg_sca, &length);
- if (length > SMS_ENCODED_SCA_LEN_MAX)
- goto invalid_param;
- memcpy(&(saveMsg.msgDataPackage.sca[0]), decoded_buff, length);
- g_free(decoded_buff);
-
- saveMsg.msgDataPackage.msgLength = arg_tpdu_length;
-
- decoded_buff = g_base64_decode(arg_tpdu_data, &length);
- if (length > SMS_SMDATA_SIZE_MAX + 1)
- goto invalid_param;
- memcpy(&(saveMsg.msgDataPackage.tpduData[0]), decoded_buff, length);
- g_free(decoded_buff);
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_save_msg), &saveMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_SAVE_MSG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_save_msg(sms, invocation, SMS_DEVICE_FAILURE, -1);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-
-invalid_param:
- g_free(decoded_buff);
-
- telephony_sms_complete_save_msg(sms, invocation,
- SMS_INVALID_PARAMETER, -1);
- tcore_user_request_unref(ur);
-
- return TRUE;
-}
-
-static gboolean
-on_sms_delete_msg(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gpointer user_data)
-{
- struct treq_sms_delete_msg deleteMsg = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "x") == FALSE)
- return FALSE;
-
- deleteMsg.index = arg_index;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_delete_msg), &deleteMsg);
- tcore_user_request_set_command(ur, TREQ_SMS_DELETE_MSG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_delete_msg(sms, invocation, SMS_DEVICE_FAILURE, -1);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_msg_count(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct treq_sms_get_msg_count getMsgCnt;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_msg_count), &getMsgCnt);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_COUNT);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_get_msg_count(sms, invocation, SMS_DEVICE_FAILURE, 0, -1, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_sca(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gpointer user_data)
-{
- struct treq_sms_get_sca getSca = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "r") == FALSE)
- return FALSE;
-
- getSca.index = arg_index;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_sca), &getSca);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_SCA);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_get_sca(sms, invocation, SMS_DEVICE_FAILURE, -1, -1, 0, NULL);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_sca(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gint arg_ton,
- gint arg_npi,
- gint arg_dialNumberLength,
- const gchar *arg_dialNumber,
- gpointer user_data)
-{
- struct treq_sms_set_sca setSca;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- guchar *decoded_sca = NULL;
-
- if (check_access_control(invocation, AC_SMS, "w") == FALSE)
- return FALSE;
-
- memset(&setSca, 0, sizeof(struct treq_sms_set_sca));
-
- setSca.index = arg_index;
- setSca.scaInfo.dialNumLen = arg_dialNumberLength;
- setSca.scaInfo.typeOfNum = arg_ton;
- setSca.scaInfo.numPlanId = arg_npi;
-
- if ((setSca.scaInfo.dialNumLen <= 0)
- || (setSca.scaInfo.dialNumLen > SMS_SMSP_ADDRESS_LEN)) {
- err("[tcore_SMS] TAPI_API_INVALID_INPUT !!!");
- return FALSE;
- }
- else if(setSca.index != 0) {
- err("[tcore_SMS] Index except 0 is supported");
- // api_err = TAPI_API_NOT_SUPPORTED;
- return FALSE;
- } else {
- gsize length;
-
- decoded_sca = g_base64_decode(arg_dialNumber, &length);
- if (length > SMS_SMSP_ADDRESS_LEN)
- goto invalid_param;
- memcpy(&(setSca.scaInfo.diallingNum[0]), decoded_sca, length);
- g_free(decoded_sca);
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_sca), &setSca);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_SCA);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_set_sca(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
- }
-
- return TRUE;
-
-invalid_param:
- g_free(decoded_sca);
-
- telephony_sms_complete_set_sca(sms, invocation, SMS_INVALID_PARAMETER);
- tcore_user_request_unref(ur);
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct treq_sms_get_cb_config getCbConfig;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_cb_config), &getCbConfig);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_CB_CONFIG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- GVariant *gv = NULL;
- GVariantBuilder b;
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- gv = g_variant_builder_end(&b);
- telephony_sms_complete_get_cb_config(sms, invocation, SMS_DEVICE_FAILURE, -1, -1, 0, 0, gv);
- g_variant_unref(gv);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_cb_config(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_net3gppType,
- gboolean arg_cbEnable,
- gint arg_msgIdMaxCount,
- gint arg_msgIdRangeCount,
- const gchar *arg_msgId,
- gpointer user_data)
-{
- struct treq_sms_set_cb_config setCbConfig = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- gsize length;
- guchar *decoded_msgId = NULL;
-
- if (check_access_control(invocation, AC_SMS, "w") == FALSE)
- return FALSE;
-
- setCbConfig.net3gppType = arg_net3gppType;
- setCbConfig.cbEnabled = arg_cbEnable;
- setCbConfig.msgIdMaxCount = arg_msgIdMaxCount;
- setCbConfig.msgIdRangeCount = arg_msgIdRangeCount;
-
- decoded_msgId = g_base64_decode(arg_msgId, &length);
- if (length > SMS_GSM_SMS_CBMI_LIST_SIZE_MAX * 5)
- goto invalid_param;
- memcpy(&(setCbConfig.msgIDs[0]), decoded_msgId, length);
- g_free(decoded_msgId);
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_cb_config), &setCbConfig);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_CB_CONFIG);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_set_cb_config(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-
-invalid_param:
- g_free(decoded_msgId);
-
- telephony_sms_complete_set_cb_config(sms, invocation,
- SMS_INVALID_PARAMETER);
- tcore_user_request_unref(ur);
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_mem_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_memoryStatus,
- gpointer user_data)
-{
- struct treq_sms_set_mem_status memStatus = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "w") == FALSE)
- return FALSE;
-
- memStatus.memory_status = arg_memoryStatus;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_mem_status), &memStatus);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_MEM_STATUS);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_set_mem_status(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_pref_bearer(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct treq_sms_get_pref_bearer getPrefBearer;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_pref_bearer), &getPrefBearer);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_PREF_BEARER);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_get_pref_bearer(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_pref_bearer(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_bearerType,
- gpointer user_data)
-{
- struct treq_sms_set_pref_bearer setPrefBearer = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "w") == FALSE)
- return FALSE;
-
- setPrefBearer.svc = arg_bearerType;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_pref_bearer), &setPrefBearer);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_PREF_BEARER);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_set_pref_bearer(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_delivery_report(TelephonySms *sms, GDBusMethodInvocation *invocation,
- const gchar *arg_sca,
- gint arg_tpdu_length,
- const gchar *arg_tpdu_data,
- gint arg_rpCause,
- gpointer user_data)
-{
- struct treq_sms_set_delivery_report deliveryReport;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- gsize length;
- guchar *decoded_buff = NULL;
-
- if (check_access_control(invocation, AC_SMS, "w") == FALSE)
- return FALSE;
-
- memset(&deliveryReport, 0, sizeof(struct treq_sms_set_delivery_report));
-
- decoded_buff = g_base64_decode(arg_sca, &length);
- if (length > SMS_ENCODED_SCA_LEN_MAX)
- goto invalid_param;
- memcpy(&(deliveryReport.dataInfo.sca[0]), decoded_buff, length);
- g_free(decoded_buff);
-
- deliveryReport.dataInfo.msgLength = arg_tpdu_length;
-
- decoded_buff = g_base64_decode(arg_tpdu_data, &length);
- if (length > SMS_SMDATA_SIZE_MAX + 1)
- goto invalid_param;
- memcpy(&(deliveryReport.dataInfo.tpduData[0]), decoded_buff, length);
- g_free(decoded_buff);
-
- deliveryReport.rspType = arg_rpCause;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_delivery_report), &deliveryReport);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_DELIVERY_REPORT);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_set_delivery_report(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-
-invalid_param:
- g_free(decoded_buff);
-
- telephony_sms_complete_set_delivery_report(sms, invocation,
- SMS_INVALID_PARAMETER);
- tcore_user_request_unref(ur);
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_msg_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gint arg_msgStatus,
- gpointer user_data)
-{
- struct treq_sms_set_msg_status msgStatus = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "w") == FALSE)
- return FALSE;
-
- msgStatus.index = arg_index;
- msgStatus.msgStatus = arg_msgStatus;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_msg_status), &msgStatus);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_MSG_STATUS);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_set_msg_status(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_sms_params(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_index,
- gpointer user_data)
-{
- struct treq_sms_get_params getParams = {0,};
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "r") == FALSE)
- return FALSE;
-
- getParams.index = arg_index;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_params), &getParams);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_PARAMS);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_get_sms_params(sms, invocation, SMS_DEVICE_FAILURE,
- 0, 0, 0, NULL, 0, 0, -1, -1, NULL, 0, -1, -1, NULL, 0, 0, 0);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_set_sms_params(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gint arg_recordIndex,
- gint arg_recordLen,
- gint arg_alphaIdLen,
- const gchar *arg_alphaId,
- gint arg_paramIndicator,
- gint arg_destAddr_DialNumLen,
- gint arg_destAddr_Ton,
- gint arg_destAddr_Npi,
- const gchar *arg_destAddr_DiallingNum,
- gint arg_svcCntrAddr_DialNumLen,
- gint arg_SvcCntrAddr_Ton,
- gint arg_svcCntrAddr_Npi,
- const gchar *arg_svcCntrAddr_DialNum,
- gint arg_protocolId,
- gint arg_dataCodingScheme,
- gint arg_validityPeriod,
- gpointer user_data)
-{
- struct treq_sms_set_params setParams;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- gsize length;
- guchar *decoded_buff = NULL;
-
- if (check_access_control(invocation, AC_SMS, "w") == FALSE)
- return FALSE;
-
- memset(&setParams, 0, sizeof(struct treq_sms_set_params));
-
- setParams.params.recordIndex = arg_recordIndex;
- setParams.params.recordLen = arg_recordLen;
- setParams.params.alphaIdLen = arg_alphaIdLen;
-
- decoded_buff = g_base64_decode(arg_alphaId, &length);
- if (length > SMS_SMSP_ALPHA_ID_LEN_MAX + 1)
- goto invalid_param;
- memcpy(&(setParams.params.szAlphaId[0]), decoded_buff, length);
- g_free(decoded_buff);
-
- setParams.params.paramIndicator = arg_paramIndicator;
- setParams.params.tpDestAddr.dialNumLen = arg_destAddr_DialNumLen;
- setParams.params.tpDestAddr.typeOfNum = arg_destAddr_Ton;
- setParams.params.tpDestAddr.numPlanId = arg_destAddr_Npi;
-
- decoded_buff = g_base64_decode(arg_destAddr_DiallingNum, &length);
- if (length > SMS_SMSP_ADDRESS_LEN + 1)
- goto invalid_param;
- memcpy(&(setParams.params.tpDestAddr.diallingNum[0]),
- decoded_buff, length);
- g_free(decoded_buff);
-
- setParams.params.tpSvcCntrAddr.dialNumLen = arg_svcCntrAddr_DialNumLen;
- setParams.params.tpSvcCntrAddr.typeOfNum = arg_SvcCntrAddr_Ton;
- setParams.params.tpSvcCntrAddr.numPlanId = arg_svcCntrAddr_Npi;
-
- decoded_buff = g_base64_decode(arg_svcCntrAddr_DialNum, &length);
- if (length > SMS_SMSP_ADDRESS_LEN + 1)
- goto invalid_param;
- memcpy(&(setParams.params.tpSvcCntrAddr.diallingNum[0]),
- decoded_buff, length);
- g_free(decoded_buff);
-
- setParams.params.tpProtocolId = arg_protocolId;
- setParams.params.tpDataCodingScheme = arg_dataCodingScheme;
- setParams.params.tpValidityPeriod = arg_validityPeriod;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_set_params), &setParams);
- tcore_user_request_set_command(ur, TREQ_SMS_SET_PARAMS);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_set_sms_params(sms, invocation, SMS_DEVICE_FAILURE);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-
-invalid_param:
- g_free(decoded_buff);
-
- telephony_sms_complete_set_sms_params(sms, invocation,
- SMS_INVALID_PARAMETER);
- tcore_user_request_unref(ur);
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_sms_param_cnt(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct treq_sms_get_paramcnt getParamCnt;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
-
- if (check_access_control(invocation, AC_SMS, "r") == FALSE)
- return FALSE;
-
- ur = MAKE_UR(ctx, sms, invocation);
- tcore_user_request_set_data(ur, sizeof(struct treq_sms_get_paramcnt), &getParamCnt);
- tcore_user_request_set_command(ur, TREQ_SMS_GET_PARAMCNT);
-
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS) {
- telephony_sms_complete_get_sms_param_cnt(sms, invocation, SMS_DEVICE_FAILURE, -1);
- tcore_user_request_unref(ur);
- }
-
- return TRUE;
-}
-
-static gboolean
-on_sms_get_sms_ready_status(TelephonySms *sms, GDBusMethodInvocation *invocation,
- gpointer user_data)
-{
- struct custom_data *ctx = user_data;
- CoreObject *co_sms = NULL;
- TcorePlugin *plugin = NULL;
- char *cp_name = GET_PLUGIN_NAME(invocation);
-
- dbg("Func Entrance");
-
- plugin = tcore_server_find_plugin(ctx->server, cp_name);
- co_sms = tcore_plugin_ref_core_object(plugin, CORE_OBJECT_TYPE_SMS);
- if (!co_sms) {
- dbg("error- co_sms is NULL");
- return FALSE;
- }
-
- telephony_sms_complete_get_sms_ready_status(sms, invocation, tcore_sms_get_ready_status(co_sms));
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_sms_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySms *sms;
-
- sms = telephony_sms_skeleton_new();
- telephony_object_skeleton_set_sms(object, sms);
- g_object_unref(sms);
-
- dbg("sms = %p", sms);
-
- g_signal_connect(sms, "handle-send-msg", G_CALLBACK (on_sms_send_msg), ctx);
- g_signal_connect(sms, "handle-read-msg", G_CALLBACK (on_sms_read_msg), ctx);
- g_signal_connect(sms, "handle-save-msg", G_CALLBACK (on_sms_save_msg), ctx);
- g_signal_connect(sms, "handle-delete-msg", G_CALLBACK (on_sms_delete_msg), ctx);
- g_signal_connect(sms, "handle-get-msg-count", G_CALLBACK (on_sms_get_msg_count), ctx);
- g_signal_connect(sms, "handle-get-sca", G_CALLBACK (on_sms_get_sca), ctx);
- g_signal_connect(sms, "handle-set-sca", G_CALLBACK (on_sms_set_sca), ctx);
- g_signal_connect(sms, "handle-get-cb-config", G_CALLBACK (on_sms_get_cb_config), ctx);
- g_signal_connect(sms, "handle-set-cb-config", G_CALLBACK (on_sms_set_cb_config), ctx);
- g_signal_connect(sms, "handle-set-mem-status", G_CALLBACK (on_sms_set_mem_status), ctx);
- g_signal_connect(sms, "handle-get-pref-bearer", G_CALLBACK (on_sms_get_pref_bearer), ctx);
- g_signal_connect(sms, "handle-set-pref-bearer", G_CALLBACK (on_sms_set_pref_bearer), ctx);
- g_signal_connect(sms, "handle-set-delivery-report", G_CALLBACK (on_sms_set_delivery_report), ctx);
- g_signal_connect(sms, "handle-set-msg-status", G_CALLBACK (on_sms_set_msg_status), ctx);
- g_signal_connect(sms, "handle-get-sms-params", G_CALLBACK (on_sms_get_sms_params), ctx);
- g_signal_connect(sms, "handle-set-sms-params", G_CALLBACK (on_sms_set_sms_params), ctx);
- g_signal_connect(sms, "handle-get-sms-param-cnt", G_CALLBACK (on_sms_get_sms_param_cnt), ctx);
- g_signal_connect(sms, "handle-get-sms-ready-status", G_CALLBACK (on_sms_get_sms_ready_status), ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sms_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- CoreObject *co_sms;
- char *modem_name = NULL;
- TcorePlugin *p = NULL;
- int i;
-
- modem_name = tcore_user_request_get_modem_name(ur);
- if (!modem_name)
- return FALSE;
-
- p = tcore_server_find_plugin(ctx->server, modem_name);
- free(modem_name);
- if (!p)
- return FALSE;
-
- co_sms = tcore_plugin_ref_core_object(p, CORE_OBJECT_TYPE_SMS);
- if (!co_sms)
- return FALSE;
-
- switch (command) {
- case TRESP_SMS_SEND_UMTS_MSG: {
- const struct tresp_sms_send_umts_msg *resp = data;
-
-
- dbg("receive TRESP_SMS_SEND_UMTS_MSG");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_send_msg(dbus_info->interface_object, dbus_info->invocation, resp->result);
-
- }
- break;
-
- case TRESP_SMS_READ_MSG: {
- const struct tresp_sms_read_msg *resp = data;
- gchar *sca = NULL;
- gchar *tpdu = NULL;
-
- dbg("receive TRESP_SMS_READ_MSG");
- dbg("resp->result = 0x%x", resp->result);
-
- sca = g_base64_encode((const guchar *)&(resp->dataInfo.smsData.sca[0]), SMS_ENCODED_SCA_LEN_MAX);
- if (sca == NULL) {
- dbg("g_base64_encode: Failed to Enocde the SCA.");
- sca = g_strdup("");
- }
-
- tpdu = g_base64_encode((const guchar *)&(resp->dataInfo.smsData.tpduData[0]), SMS_SMDATA_SIZE_MAX + 1);
- if (tpdu == NULL) {
- dbg("g_base64_encode: Failed to Enocde the TPDU.");
- tpdu = g_strdup("");
- }
-
- telephony_sms_complete_read_msg(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->dataInfo.simIndex,
- resp->dataInfo.msgStatus,
- sca,
- resp->dataInfo.smsData.msgLength,
- tpdu);
-
- if (sca)
- g_free(sca);
-
- if (tpdu)
- g_free(tpdu);
-
- }
- break;
-
- case TRESP_SMS_SAVE_MSG: {
- const struct tresp_sms_save_msg *resp = data;
-
- dbg("receive TRESP_SMS_SAVE_MSG");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_save_msg (dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->index);
- }
- break;
-
- case TRESP_SMS_DELETE_MSG: {
- const struct tresp_sms_delete_msg *resp = data;
-
- dbg("receive TRESP_SMS_DELETE_MSG");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_delete_msg(dbus_info->interface_object, dbus_info->invocation,
- resp->result, resp->index);
-
- }
- break;
-
- case TRESP_SMS_GET_STORED_MSG_COUNT: {
- const struct tresp_sms_get_storedMsgCnt *resp = data;
- gchar *msgCnt = NULL;
-
- dbg("receive TRESP_SMS_GET_STORED_MSG_COUNT");
- dbg("resp->result = 0x%x", resp->result);
-
- msgCnt = g_base64_encode((const guchar *)&(resp->storedMsgCnt.indexList[0]), SMS_GSM_SMS_MSG_NUM_MAX + 1);
- if (msgCnt == NULL) {
- dbg("g_base64_encode: Failed to Enocde storedMsgCnt.indexList");
- msgCnt = g_strdup("");
- }
-
- telephony_sms_complete_get_msg_count(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->storedMsgCnt.totalCount,
- resp->storedMsgCnt.usedCount,
- msgCnt);
-
- if (msgCnt)
- g_free(msgCnt);
- }
-
- break;
-
- case TRESP_SMS_GET_SCA: {
- const struct tresp_sms_get_sca *resp = data;
- gchar *sca = NULL;
-
- dbg("receive TRESP_SMS_GET_SCA");
- dbg("resp->result = 0x%x", resp->result);
-
- sca = g_base64_encode((const guchar *)&(resp->scaAddress.diallingNum[0]), SMS_SMSP_ADDRESS_LEN + 1);
- if (sca == NULL) {
- dbg("g_base64_encode: Failed to Enocde scaAddress.diallingNum");
- sca = g_strdup("");
- }
-
- telephony_sms_complete_get_sca(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->scaAddress.typeOfNum,
- resp->scaAddress.numPlanId,
- resp->scaAddress.dialNumLen,
- sca);
-
- if (sca)
- g_free(sca);
-
- }
- break;
-
- case TRESP_SMS_SET_SCA: {
- const struct tresp_sms_set_sca *resp = data;
-
- dbg("receive TRESP_SMS_SET_SCA");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_set_sca(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_GET_CB_CONFIG: {
- const struct tresp_sms_get_cb_config *resp = data;
- GVariant *result = NULL;
- GVariantBuilder b;
-
- dbg("receive TRESP_SMS_GET_CB_CONFIG");
- dbg("resp->result = 0x%x", resp->result);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i = 0; i < resp->cbConfig.msgIdRangeCount; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
-
- if( resp->cbConfig.net3gppType == SMS_NETTYPE_3GPP ) {
- g_variant_builder_add(&b, "{sv}", "FromMsgId", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp.fromMsgId));
- g_variant_builder_add(&b, "{sv}", "ToMsgId", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp.toMsgId));
- } else if( resp->cbConfig.net3gppType == SMS_NETTYPE_3GPP2) {
- g_variant_builder_add(&b, "{sv}", "CBCategory", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp2.cbCategory));
- g_variant_builder_add(&b, "{sv}", "CBLanguage", g_variant_new_uint16(resp->cbConfig.msgIDs[i].net3gpp2.cbLanguage));
- } else {
- dbg("Unknown 3gpp type");
- return FALSE;
- }
-
- g_variant_builder_add(&b, "{sv}", "Selected", g_variant_new_byte(resp->cbConfig.msgIDs[i].net3gpp.selected));
-
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_sms_complete_get_cb_config(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->cbConfig.net3gppType,
- resp->cbConfig.cbEnabled,
- resp->cbConfig.msgIdMaxCount,
- resp->cbConfig.msgIdRangeCount,
- result);
- }
- break;
-
- case TRESP_SMS_SET_CB_CONFIG: {
- const struct tresp_sms_set_cb_config *resp = data;
-
- dbg("receive TRESP_SMS_SET_CB_CONFIG");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_set_cb_config(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_SET_MEM_STATUS: {
- const struct tresp_sms_set_mem_status *resp = data;
-
- dbg("receive TRESP_SMS_SET_MEM_STATUS");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_set_mem_status(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
- case TRESP_SMS_GET_PREF_BEARER: {
- const struct tresp_sms_get_pref_bearer *resp = data;
-
- dbg("receive TRESP_SMS_GET_PREF_BEARER");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_get_pref_bearer(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_SET_PREF_BEARER: {
- const struct tresp_sms_set_pref_bearer *resp = data;
-
- dbg("receive TRESP_SMS_SET_PREF_BEARER");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_set_pref_bearer(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_SET_DELIVERY_REPORT: {
- const struct tresp_sms_set_delivery_report *resp = data;
-
- dbg("receive TRESP_SMS_SET_DELIVERY_REPORT");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_set_delivery_report(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_SET_MSG_STATUS: {
- const struct tresp_sms_set_mem_status *resp = data;
-
- dbg("receive TRESP_SMS_SET_MSG_STATUS");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_set_msg_status(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_GET_PARAMS: {
- const struct tresp_sms_get_params *resp = data;
- gchar *alphaId = NULL;
- gchar *destDialNum = NULL;
- gchar *scaDialNum = NULL;
-
- dbg("receive TRESP_SMS_GET_PARAMS");
- dbg("resp->result = 0x%x", resp->result);
-
- alphaId = g_base64_encode((const guchar *)&(resp->paramsInfo.szAlphaId[0]), SMS_SMSP_ALPHA_ID_LEN_MAX + 1);
- if (alphaId == NULL) {
- dbg("g_base64_encode: Failed to Enocde paramsInfo.szAlphaId");
- alphaId = g_strdup("");
- }
-
- destDialNum = g_base64_encode((const guchar *)&(resp->paramsInfo.tpDestAddr.diallingNum[0]), SMS_SMSP_ADDRESS_LEN + 1);
- if (destDialNum == NULL) {
- dbg("g_base64_encode: Failed to Enocde paramsInfo.tpDestAddr.diallingNum");
- destDialNum = g_strdup("");
- }
-
- scaDialNum = g_base64_encode((const guchar *)&(resp->paramsInfo.tpSvcCntrAddr.diallingNum[0]), SMS_SMSP_ADDRESS_LEN + 1);
- if (scaDialNum == NULL) {
- dbg("g_base64_encode: Failed to Enocde paramsInfo.tpSvcCntrAddr.diallingNum");
- scaDialNum = g_strdup("");
- }
-
- telephony_sms_complete_get_sms_params(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->paramsInfo.recordIndex,
- resp->paramsInfo.recordLen,
- resp->paramsInfo.alphaIdLen,
- alphaId,
- resp->paramsInfo.paramIndicator,
- resp->paramsInfo.tpDestAddr.dialNumLen,
- resp->paramsInfo.tpDestAddr.typeOfNum,
- resp->paramsInfo.tpDestAddr.numPlanId,
- destDialNum,
- resp->paramsInfo.tpSvcCntrAddr.dialNumLen,
- resp->paramsInfo.tpSvcCntrAddr.typeOfNum,
- resp->paramsInfo.tpSvcCntrAddr.numPlanId,
- scaDialNum,
- resp->paramsInfo.tpProtocolId,
- resp->paramsInfo.tpDataCodingScheme,
- resp->paramsInfo.tpValidityPeriod);
-
- if(alphaId)
- g_free(alphaId);
-
- if(destDialNum)
- g_free(destDialNum);
-
- if(scaDialNum)
- g_free(scaDialNum);
-
- }
- break;
-
- case TRESP_SMS_SET_PARAMS:{
- const struct tresp_sms_set_params *resp = data;
-
- dbg("receive TRESP_SMS_SET_PARAMS");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_set_sms_params(dbus_info->interface_object, dbus_info->invocation,
- resp->result);
-
- }
- break;
-
- case TRESP_SMS_GET_PARAMCNT: {
- const struct tresp_sms_get_paramcnt *resp = data;
-
- dbg("receive TRESP_SMS_GET_PARAMCNT");
- dbg("resp->result = 0x%x", resp->result);
-
- telephony_sms_complete_get_sms_param_cnt(dbus_info->interface_object, dbus_info->invocation,
- resp->result,
- resp->recordCount);
-
- }
- break;
-
- default:
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_sms_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonySms *sms;
-
- if (!object)
- {
- dbg("object is NULL");
- return FALSE;
- }
-
- sms = telephony_object_peek_sms(TELEPHONY_OBJECT(object));
- dbg("sms = %p", sms);
-
- dbg("[tcore_SMS]notification !!! (command = 0x%x, data_len = %d)", command, data_len);
-
- switch (command) {
- case TNOTI_SMS_INCOM_MSG: {
- const struct tnoti_sms_umts_msg *noti = data;
-
- gchar *sca = NULL;
- gchar *tpdu = NULL;
-
- sca = g_base64_encode((const guchar *)&(noti->msgInfo.sca[0]), SMS_ENCODED_SCA_LEN_MAX);
- if (sca == NULL) {
- dbg("g_base64_encode: Failed to Enocde msgInfo.sca");
- sca = g_strdup("");
- }
-
- tpdu = g_base64_encode((const guchar *)&(noti->msgInfo.tpduData[0]), SMS_SMDATA_SIZE_MAX + 1);
- if (tpdu == NULL) {
- dbg("g_base64_encode: Failed to Enocde msgInfo.tpduData");
- tpdu = g_strdup("");
- }
-
- telephony_sms_emit_incomming_msg(sms,
- sca,
- noti->msgInfo.msgLength,
- tpdu);
-
- if(sca)
- g_free(sca);
-
- if(tpdu)
- g_free(tpdu);
-
- }
- break;
-
- case TNOTI_SMS_CB_INCOM_MSG: {
- const struct tnoti_sms_cellBroadcast_msg *noti = data;
- gchar *msgData = NULL;
-
- msgData = g_base64_encode((const guchar *)&(noti->cbMsg.msgData[0]), SMS_CB_SIZE_MAX + 1);
- if (msgData == NULL) {
- dbg("g_base64_encode: Failed to Enocde cbMsg.msgData");
- msgData = g_strdup("");
- }
-
- telephony_sms_emit_incomming_cb_msg(sms,
- noti->cbMsg.cbMsgType,
- noti->cbMsg.length,
- msgData);
-
- if(msgData)
- g_free(msgData);
-
- }
- break;
-
- case TNOTI_SMS_ETWS_INCOM_MSG: {
- const struct tnoti_sms_etws_msg *noti = data;
- gchar *msgData = NULL;
-
- msgData = g_base64_encode((const guchar *)&(noti->etwsMsg.msgData[0]), SMS_ETWS_SIZE_MAX + 1);
- if (msgData == NULL) {
- dbg("g_base64_encode: Failed to Enocde etwsMsg.msgData");
- msgData = g_strdup("");
- }
-
- telephony_sms_emit_incomming_etws_msg(sms,
- noti->etwsMsg.etwsMsgType,
- noti->etwsMsg.length,
- msgData);
-
- if(msgData)
- g_free(msgData);
- }
- break;
-
- case TNOTI_SMS_INCOM_EX_MSG:
- break;
-
- case TNOTI_SMS_CB_INCOM_EX_MSG:
- break;
-
- case TNOTI_SMS_MEMORY_STATUS: {
- const struct tnoti_sms_memory_status *noti = data;
-
- telephony_sms_emit_memory_status(sms, noti->status);
-
- }
- break;
-
- case TNOTI_SMS_DEVICE_READY: {
- const struct tnoti_sms_ready_status *noti = data;
-
- dbg("SMS Device Ready: [%s]", (noti->status ? "YES" : "NO"));
-
- telephony_sms_emit_sms_ready(sms, noti->status);
-
- }
- break;
-
- default:
- dbg("unknown notification");
- return FALSE;
- break;
- }
-
- return TRUE;
-}
+++ /dev/null
-/*
- * tel-plugin-dbus_tapi
- *
- * Copyright (c) 2013 Samsung Electronics Co. Ltd. All rights reserved.
- * Copyright (c) 2013 Intel Corporation. All rights reserved.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <stdio.h>
-#include <string.h>
-#include <pthread.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <time.h>
-#include <glib.h>
-#include <glib-object.h>
-#include <gio/gio.h>
-
-#include <appsvc.h>
-#include <bundle.h>
-
-#include <tcore.h>
-#include <server.h>
-#include <plugin.h>
-#include <hal.h>
-#include <communicator.h>
-#include <storage.h>
-#include <queue.h>
-#include <user_request.h>
-#include <co_ss.h>
-#include <co_sim.h>
-#include <co_ps.h>
-
-#include "generated-code.h"
-#include "common.h"
-
-struct ciss_data_type {
- int status;
- int length;
- char data[MAX_SS_USSD_LEN];
-};
-
-static void _launch_ciss(const struct tnoti_ss_ussd *ussd)
-{
- gchar *encoded_data;
- struct ciss_data_type ciss_data;
-
- bundle *kb = NULL;
-
- memset(&ciss_data, 0, sizeof(struct ciss_data_type));
- ciss_data.status = ussd->status;
- ciss_data.length = strlen(ussd->str);
- memcpy(ciss_data.data, ussd->str, ciss_data.length);
-
- dbg("launch ciss application by appsvc");
-
- kb = bundle_create();
- if (!kb) {
- warn("bundle_create() failed");
- return;
- }
-
- appsvc_set_operation(kb, "http://tizen.org/appcontrol/operation/ciss");
- appsvc_set_pkgname(kb, "com.samsung.ciss");
-
- encoded_data = g_base64_encode((guchar *)&ciss_data, sizeof(struct ciss_data_type));
-
- appsvc_add_data(kb, "CISS_LAUNCHING_MODE", "RESP");
- appsvc_add_data(kb, "KEY_EVENT_TYPE", "100");
- appsvc_add_data(kb, "KEY_ENCODED_DATA", encoded_data);
-
- dbg("ciss appsvc run");
- appsvc_run_service(kb, 0, NULL, NULL);
-
- bundle_free(kb);
- g_free(encoded_data);
-
- return;
-}
-
-static gboolean
-on_ss_activate_barring (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint barring_mode,
- const gchar *barring_password,
- gpointer user_data)
-{
- char buf[5];
- struct treq_ss_barring req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_barring));
-
- req.class = ss_class;
- req.mode = barring_mode;
-
- memcpy(req.password, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
- memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
-
- buf[4] = 0;
- dbg("req.password = [%s]", buf);
-
- dbg("class = %d, mode = %d", req.class, req.mode);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
- tcore_user_request_set_command(ur, TREQ_SS_BARRING_ACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_barring(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_deactivate_barring (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint barring_mode,
- const gchar *barring_password,
- gpointer user_data)
-{
- char buf[5];
- struct treq_ss_barring req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_barring));
-
- req.class = ss_class;
- req.mode = barring_mode;
-
- memcpy(req.password, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
- memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
-
- buf[4] = 0;
- dbg("req.password = [%s]", buf);
- dbg("class = %d, mode = %d", req.class, req.mode);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
- tcore_user_request_set_command(ur, TREQ_SS_BARRING_DEACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_barring(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_change_barring_password (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- const gchar *barring_password,
- const gchar *barring_password_new,
- const gchar *barring_password_confirm,
- gpointer user_data)
-{
- char buf[5];
- struct treq_ss_barring_change_password req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_barring_change_password));
-
- memcpy(req.password_old, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
- memcpy(req.password_new, barring_password_new, MAX_SS_BARRING_PASSWORD_LEN);
- memcpy(req.password_confirm, barring_password_confirm, MAX_SS_BARRING_PASSWORD_LEN);
-
- memcpy(buf, barring_password, MAX_SS_BARRING_PASSWORD_LEN);
- buf[4] = 0;
- dbg("req.password_old = [%s]", buf);
-
- memcpy(buf, barring_password_new, MAX_SS_BARRING_PASSWORD_LEN);
- dbg("req.password_new = [%s]", buf);
-
-
- memcpy(buf, barring_password_confirm, MAX_SS_BARRING_PASSWORD_LEN);
- dbg("req.password_confirm = [%s]", buf);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring_change_password), &req);
- tcore_user_request_set_command(ur, TREQ_SS_BARRING_CHANGE_PASSWORD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- telephony_ss_complete_change_barring_password(ss, invocation, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_get_barring_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint barring_mode,
- gpointer user_data)
-{
- struct treq_ss_barring req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_barring));
-
- req.class = ss_class;
- req.mode = barring_mode;
-
- dbg("class = %d, mode = %d", req.class, req.mode);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_barring), &req);
- tcore_user_request_set_command(ur, TREQ_SS_BARRING_GET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_barring_status(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_register_forwarding (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gint forward_no_reply_time,
- const gchar *forward_number,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (check_access_control(invocation, AC_SS, "w") == FALSE) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(ss, invocation,
- result, ret);
-
- g_variant_unref(result);
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
- req.time = forward_no_reply_time;
- snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_REGISTER);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_deregister_forwarding (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gint forward_no_reply_time,
- const gchar *forward_number,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (check_access_control(invocation, AC_SS, "w") == FALSE) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(ss, invocation,
- result, ret);
-
- dbg("[error]tcore_communicator_dispatch_request() : (0x%x)",
- ret);
-
- g_variant_unref(result);
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
- req.time = forward_no_reply_time;
- snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_DEREGISTER);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deregister_forwarding(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_activate_forwarding (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gint forward_no_reply_time,
- const gchar *forward_number,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (check_access_control(invocation, AC_SS, "w") == FALSE) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(ss, invocation,
- result, ret);
-
- dbg("[error]tcore_communicator_dispatch_request() : (0x%x)",
- ret);
-
- g_variant_unref(result);
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
- req.time = forward_no_reply_time;
- snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_ACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_forwarding(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_deactivate_forwarding (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gint forward_no_reply_time,
- const gchar *forward_number,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (check_access_control(invocation, AC_SS, "w") == FALSE) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(ss, invocation,
- result, ret);
-
- dbg("[error]tcore_communicator_dispatch_request() : (0x%x)",
- ret);
-
- g_variant_unref(result);
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
- req.time = forward_no_reply_time;
- snprintf(req.number, MAX_SS_FORWARDING_NUMBER_LEN, "%s", forward_number);
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_DEACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_forwarding(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_get_forwarding_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gint forward_mode,
- gpointer user_data)
-{
- struct treq_ss_forwarding req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- if (check_access_control(invocation, AC_SS, "w") == FALSE) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(ss, invocation,
- result, ret);
-
- dbg("[error]tcore_communicator_dispatch_request() : (0x%x)",
- ret);
-
- g_variant_unref(result);
- return TRUE;
- }
-
- memset(&req, 0, sizeof(struct treq_ss_forwarding));
-
- req.class = ss_class;
- req.mode = forward_mode;
-
- dbg("class = %d, mode = %d, time = %d, number = %s",
- req.class, req.mode, req.time, req.number);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_forwarding), &req);
- tcore_user_request_set_command(ur, TREQ_SS_FORWARDING_GET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_forwarding_status(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_activate_waiting (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gpointer user_data)
-{
- struct treq_ss_waiting req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_waiting));
-
- req.class = ss_class;
-
- dbg("class = %d", req.class);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
- tcore_user_request_set_command(ur, TREQ_SS_WAITING_ACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_waiting(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_deactivate_waiting (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gpointer user_data)
-{
- struct treq_ss_waiting req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_waiting));
-
- req.class = ss_class;
-
- dbg("class = %d", req.class);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
- tcore_user_request_set_command(ur, TREQ_SS_WAITING_DEACTIVATE);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_waiting(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_get_waiting_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ss_class,
- gpointer user_data)
-{
- struct treq_ss_waiting req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_waiting));
-
- req.class = ss_class;
-
- dbg("class = %d", req.class);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_waiting), &req);
- tcore_user_request_set_command(ur, TREQ_SS_WAITING_GET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- GVariant *result = 0;
- GVariantBuilder b;
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_waiting_status(ss, invocation, result, ret);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- g_variant_unref( result );
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_get_cli_status (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint cli_type,
- gpointer user_data)
-{
- struct treq_ss_cli req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_cli));
-
- req.type = cli_type;
-
- dbg("type = %d", req.type);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_cli), &req);
- tcore_user_request_set_command(ur, TREQ_SS_CLI_GET_STATUS);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- telephony_ss_complete_get_clistatus(ss, invocation, ret, -1, -1);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-static gboolean
-on_ss_send_ussd (TelephonySs *ss,
- GDBusMethodInvocation *invocation,
- gint ussd_type,
- gint ussd_len,
- const gchar *ussd_string,
- gpointer user_data)
-{
- struct treq_ss_ussd req;
- struct custom_data *ctx = user_data;
- UserRequest *ur = NULL;
- int ret = 0;
-
- memset(&req, 0, sizeof(struct treq_ss_ussd));
-
- req.type = ussd_type;
- snprintf(req.str, MAX_SS_USSD_LEN, "%s", ussd_string);
-
- dbg("type = %d, string = %s", req.type, req.str);
-
- ur = MAKE_UR(ctx, ss, invocation);
-
- tcore_user_request_set_data(ur, sizeof(struct treq_ss_ussd), &req);
- tcore_user_request_set_command(ur, TREQ_SS_SEND_USSD);
- ret = tcore_communicator_dispatch_request(ctx->comm, ur);
- if (ret != TCORE_RETURN_SUCCESS ) {
- telephony_ss_complete_send_ussd(ss, invocation, ret, -1, -1, -1, 0);
- dbg("[ error ] tcore_communicator_dispatch_request() : (0x%x)", ret);
-
- tcore_user_request_unref(ur);
- return FALSE;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_setup_ss_interface(TelephonyObjectSkeleton *object, struct custom_data *ctx)
-{
- TelephonySs *ss;
-
- ss = telephony_ss_skeleton_new();
- telephony_object_skeleton_set_ss(object, ss);
- g_object_unref(ss);
-
- dbg("ss = %p", ss);
-
- g_signal_connect (ss,
- "handle-activate-barring",
- G_CALLBACK (on_ss_activate_barring),
- ctx);
-
- g_signal_connect (ss,
- "handle-deactivate-barring",
- G_CALLBACK (on_ss_deactivate_barring),
- ctx);
-
- g_signal_connect (ss,
- "handle-change-barring-password",
- G_CALLBACK (on_ss_change_barring_password),
- ctx);
-
- g_signal_connect (ss,
- "handle-get-barring-status",
- G_CALLBACK (on_ss_get_barring_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-register-forwarding",
- G_CALLBACK (on_ss_register_forwarding),
- ctx);
-
- g_signal_connect (ss,
- "handle-deregister-forwarding",
- G_CALLBACK (on_ss_deregister_forwarding),
- ctx);
-
- g_signal_connect (ss,
- "handle-activate-forwarding",
- G_CALLBACK (on_ss_activate_forwarding),
- ctx);
-
- g_signal_connect (ss,
- "handle-deactivate-forwarding",
- G_CALLBACK (on_ss_deactivate_forwarding),
- ctx);
-
- g_signal_connect (ss,
- "handle-get-forwarding-status",
- G_CALLBACK (on_ss_get_forwarding_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-activate-waiting",
- G_CALLBACK (on_ss_activate_waiting),
- ctx);
-
- g_signal_connect (ss,
- "handle-deactivate-waiting",
- G_CALLBACK (on_ss_deactivate_waiting),
- ctx);
-
- g_signal_connect (ss,
- "handle-get-waiting-status",
- G_CALLBACK (on_ss_get_waiting_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-get-clistatus",
- G_CALLBACK (on_ss_get_cli_status),
- ctx);
-
- g_signal_connect (ss,
- "handle-send-ussd",
- G_CALLBACK (on_ss_send_ussd),
- ctx);
-
- return TRUE;
-}
-
-gboolean dbus_plugin_ss_response(struct custom_data *ctx, UserRequest *ur, struct dbus_request_info *dbus_info, enum tcore_response_command command, unsigned int data_len, const void *data)
-{
- GVariant *result = 0;
- GVariantBuilder b;
- int i = 0;
-
- switch (command) {
- case TRESP_SS_BARRING_ACTIVATE: {
-
- const struct tresp_ss_barring *resp = data;
-
- dbg("receive TRESP_SS_BARRING_ACTIVATE");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_barring(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_BARRING_DEACTIVATE: {
-
- const struct tresp_ss_barring *resp = data;
-
- dbg("receive TRESP_SS_BARRING_DEACTIVATE");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_barring(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_BARRING_CHANGE_PASSWORD: {
-
- const struct tresp_ss_general *resp = data;
-
- dbg("receive TRESP_SS_BARRING_CHANGE_PASSWORD");
- dbg("resp->err = 0x%x", resp->err);
-
- telephony_ss_complete_change_barring_password(dbus_info->interface_object, dbus_info->invocation, resp->err);
-
- } break;
-
- case TRESP_SS_BARRING_GET_STATUS: {
-
- const struct tresp_ss_barring *resp = data;
-
- dbg("receive TRESP_SS_BARRING_GET_STATUS");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "barring_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_barring_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_FORWARDING_ACTIVATE: {
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_ACTIVATE");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_FORWARDING_DEACTIVATE: {
-
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_DEACTIVATE");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_FORWARDING_REGISTER: {
-
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_REGISTER");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_register_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_FORWARDING_DEREGISTER: {
-
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_DEREGISTER");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deregister_forwarding(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_FORWARDING_GET_STATUS: {
-
- const struct tresp_ss_forwarding *resp = data;
-
- dbg("receive TRESP_SS_FORWARDING_GET_STATUS");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_add(&b, "{sv}", "forwarding_mode", g_variant_new_int32( resp->record[i].mode ));
- g_variant_builder_add(&b, "{sv}", "no_reply_time", g_variant_new_int32( resp->record[i].time ));
- g_variant_builder_add(&b, "{sv}", "number_present", g_variant_new_int32( resp->record[i].number_present ));
- g_variant_builder_add(&b, "{sv}", "forwarding_number", g_variant_new_string( resp->record[i].number ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_forwarding_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_WAITING_ACTIVATE: {
-
- const struct tresp_ss_waiting *resp = data;
-
- dbg("receive TRESP_SS_WAITING_ACTIVATE");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_activate_waiting(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_WAITING_DEACTIVATE: {
-
- const struct tresp_ss_waiting *resp = data;
-
- dbg("receive TRESP_SS_WAITING_DEACTIVATE");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_deactivate_waiting(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_WAITING_GET_STATUS: {
-
- const struct tresp_ss_waiting *resp = data;
-
- dbg("receive TRESP_SS_WAITING_GET_STATUS");
- dbg("resp->err = 0x%x", resp->err);
-
- g_variant_builder_init(&b, G_VARIANT_TYPE("aa{sv}"));
-
- for (i=0; i<resp->record_num; i++) {
- g_variant_builder_open(&b, G_VARIANT_TYPE("a{sv}"));
- g_variant_builder_add(&b, "{sv}", "ss_class", g_variant_new_int32( resp->record[i].class ));
- g_variant_builder_add(&b, "{sv}", "ss_status", g_variant_new_int32( resp->record[i].status ));
- g_variant_builder_close(&b);
- }
-
- result = g_variant_builder_end(&b);
-
- telephony_ss_complete_get_waiting_status(dbus_info->interface_object, dbus_info->invocation, result, resp->err);
-
- g_variant_unref(result);
-
- } break;
-
- case TRESP_SS_CLI_GET_STATUS: {
-
- const struct tresp_ss_cli *resp = data;
-
- dbg("receive TRESP_SS_CLI_GET_STATUS");
- dbg("resp->err = 0x%x", resp->err);
-
- telephony_ss_complete_get_clistatus(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->type, resp->status);
-
- } break;
-
- case TRESP_SS_SEND_USSD: {
-
- const struct tresp_ss_ussd *resp = data;
-
- dbg("receive TRESP_SS_SEND_USSD");
- dbg("resp->err = 0x%x", resp->err);
-
- if ( resp->err ) {
- dbg("USSD Request is failed");
- telephony_ss_complete_send_ussd(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->type, resp->status, -1, 0);
-
- } else {
- int ussd_len = strlen(resp->str);
- dbg("USSD Request is Success");
- dbg("USSD : %s (%d)", resp->str, ussd_len);
- telephony_ss_complete_send_ussd(dbus_info->interface_object, dbus_info->invocation, resp->err, resp->type, resp->status, ussd_len, resp->str);
-
- }
-
- } break;
-
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
-
-gboolean dbus_plugin_ss_notification(struct custom_data *ctx, const char *plugin_name, TelephonyObjectSkeleton *object, enum tcore_notification_command command, unsigned int data_len, const void *data)
-{
- TelephonySs *ss;
-
- if (!object) {
- dbg("object is NULL");
- return FALSE;
- }
-
- ss = telephony_object_peek_ss(TELEPHONY_OBJECT(object));
- dbg("ss = %p", ss);
-
- switch (command) {
- case TNOTI_SS_USSD: {
- const struct tnoti_ss_ussd *ussd = data;
- telephony_ss_emit_notify_ussd(ss,
- ussd->status,
- strlen(ussd->str),
- ussd->str);
- _launch_ciss(ussd);
- } break;
- case TNOTI_SS_RELEASE_COMPLETE: {
- int i = 0;
- GVariantBuilder *builder = 0;
- GVariant *msg_data = 0, *packet = 0;
- const struct tnoti_ss_release_complete *msg = data;
-
- builder = g_variant_builder_new(G_VARIANT_TYPE ("ay"));
- for (i = 0; i < msg->data_len; i++) {
- g_variant_builder_add(builder, "y", msg->data[i]);
- }
- msg_data = g_variant_builder_end(builder);
-
- packet = g_variant_new("v", msg_data);
- dbg("type_format(%s)", g_variant_get_type_string(packet));
-
- telephony_ss_emit_release_complete(ss,
- msg->data_len,
- packet );
-
- } break;
- default:
- dbg("not handled command[%d]", command);
- break;
- }
-
- return TRUE;
-}
-