#include <server.h>
#include <plugin.h>
#include <core_object.h>
-
#include <co_sms.h>
#include "at_sms.h"
.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);
}