Update plugin
[platform/core/telephony/tel-plugin-at_standard.git] / src / at_sim.c
index e69de29..b6a3f12 100644 (file)
@@ -0,0 +1,61 @@
+/*
+ * tel-plugin-at_standard
+ *
+ * Copyright (c) 2012 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 <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+#include <glib.h>
+
+#include <tcore.h>
+#include <server.h>
+#include <plugin.h>
+#include <core_object.h>
+#include <co_sim.h>
+
+#include "at_sim.h"
+
+gboolean at_sim_init(TcorePlugin *cp)
+{
+       CoreObject *co;
+       Server *server;
+
+       co = tcore_sim_new(cp, NULL, NULL);
+       if (co == NULL)
+               return FALSE;
+
+       server = tcore_plugin_ref_server(cp);
+       tcore_server_add_template_object(server, co);
+
+       return TRUE;
+}
+
+void at_sim_exit(TcorePlugin *cp)
+{
+       CoreObject *co;
+
+       if (cp == NULL)
+               return;
+
+       co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_SIM);
+       if (co == NULL)
+               return;
+
+       tcore_object_free(co);
+}