Generate Licence file
[platform/core/telephony/tel-plugin-at_standard.git] / src / at_sms.c
index 2fc2728..e1bcef7 100644 (file)
@@ -27,7 +27,6 @@
 #include <server.h>
 #include <plugin.h>
 #include <core_object.h>
-
 #include <co_sms.h>
 
 #include "at_sms.h"
@@ -143,24 +142,31 @@ static struct tcore_sms_operations sms_ops = {
        .send_cdma_msg = send_cdma_msg,
 };
 
-gboolean at_sms_init(TcorePlugin *p)
+gboolean at_sms_init(TcorePlugin *cp)
 {
-       CoreObject *co_sms;
+       CoreObject *co;
+       Server *server;
 
-       co_sms = tcore_sms_new(p, "umts_sms", &sms_ops, NULL);
-       if (NULL == co_sms)
+       co = tcore_sms_new(cp, &sms_ops, NULL);
+       if (co == NULL)
                return FALSE;
 
+       server = tcore_plugin_ref_server(cp);
+       tcore_server_add_template_object(server, co);
+
        return TRUE;
 }
 
-void at_sms_exit(TcorePlugin *p)
+void at_sms_exit(TcorePlugin *cp)
 {
-       CoreObject *co_sms;
+       CoreObject *co;
+
+       if (cp == NULL)
+               return;
 
-       co_sms = tcore_plugin_ref_core_object(p, "umts_sms");
-       if (NULL == co_sms)
+       co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_SMS);
+       if (co == NULL)
                return;
 
-       tcore_sms_free(co_sms);
+       tcore_object_free(co);
 }