at_phonebook: Add Phonebook skeleton
authorRonald Tessier <ronald.tessier@linux.intel.com>
Wed, 19 Dec 2012 10:34:29 +0000 (11:34 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 06:49:16 +0000 (15:49 +0900)
Change-Id: I00f40164234e559a1df09d9dba705da73afef902

CMakeLists.txt
include/at_phonebook.h [new file with mode: 0644]
src/at_phonebook.c [new file with mode: 0644]

index 658a81c166acc8e2702abb716f1fecc7ed56e835..ee2414ed6d8e303aae37f274c3041c952d0a0a9b 100644 (file)
@@ -31,6 +31,7 @@ SET(SRCS
        src/at_network.c
        src/at_sim.c
        src/at_call.c
+       src/at_phonebook.c
        src/at_ps.c
        src/at_sms.c
        src/at_ss.c
diff --git a/include/at_phonebook.h b/include/at_phonebook.h
new file mode 100644 (file)
index 0000000..7a3c483
--- /dev/null
@@ -0,0 +1,25 @@
+/*
+ * 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.
+ */
+
+#ifndef __AT_PHONEBOOK_H__
+#define __AT_PHONEBOOK_H__
+
+gboolean at_phonebook_init(TcorePlugin *cp);
+void at_phonebook_exit(TcorePlugin *cp);
+
+#endif
diff --git a/src/at_phonebook.c b/src/at_phonebook.c
new file mode 100644 (file)
index 0000000..db75680
--- /dev/null
@@ -0,0 +1,88 @@
+/*
+ * 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 <glib.h>
+
+#include <tcore.h>
+#include <core_object.h>
+#include <plugin.h>
+#include <co_phonebook.h>
+
+#include "at_phonebook.h"
+
+static TReturn at_get_count(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static TReturn at_get_info(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static TReturn at_get_usim_info(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static TReturn at_read_record(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static TReturn at_update_record(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static TReturn at_delete_record(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static struct tcore_phonebook_operations phonebook_ops = {
+       .get_count = at_get_count,
+       .get_info = at_get_info,
+       .get_usim_info = at_get_usim_info,
+       .read_record = at_read_record,
+       .update_record = at_update_record,
+       .delete_record = at_delete_record,
+};
+
+gboolean at_phonebook_init(TcorePlugin *cp)
+{
+       CoreObject *co;
+
+       co = tcore_phonebook_new(cp, "phonebook", &phonebook_ops, NULL);
+       if (co == NULL)
+               return FALSE;
+
+       return TRUE;
+}
+
+void at_phonebook_exit(TcorePlugin *cp)
+{
+       CoreObject *co;
+
+       co = tcore_plugin_ref_core_object(cp, "phonebook");
+       if (co == NULL)
+               return;
+
+       tcore_phonebook_free(co);
+}
+