at_ps: Add PS module skeleton
authorGuillaume Zajac <guillaume.zajac@linux.intel.com>
Tue, 27 Nov 2012 15:55:41 +0000 (16:55 +0100)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 06:48:39 +0000 (15:48 +0900)
Change-Id: Ic565a01c2bcd2a10d3eff7de10d62f9aaa774a6a

include/at_ps.h
src/at_ps.c

index e69de29..13f2487 100644 (file)
@@ -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_PS_H__
+#define __AT_PS_H__
+
+gboolean at_ps_init(TcorePlugin *p);
+void at_ps_exit(TcorePlugin *p);
+
+#endif
index e69de29..8a87384 100644 (file)
@@ -0,0 +1,71 @@
+/*
+ * 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 <hal.h>
+#include <core_object.h>
+#include <plugin.h>
+#include <co_ps.h>
+
+#include "at_ps.h"
+
+static TReturn activate_ps_context(CoreObject *co_ps, CoreObject *ps_context,
+                                       void *user_data)
+{
+       return TCORE_RETURN_SUCCESS;
+}
+
+static TReturn deactivate_ps_context(CoreObject *co_ps, CoreObject *ps_context,
+                                       void *user_data)
+{
+       return TCORE_RETURN_SUCCESS;
+}
+
+static struct tcore_ps_operations ps_ops = {
+       .activate_context = activate_ps_context,
+       .deactivate_context = deactivate_ps_context
+};
+
+gboolean at_ps_init(TcorePlugin *p)
+{
+       CoreObject *co_ps;
+
+       co_ps = tcore_ps_new(p, "umts_ps", &ps_ops, NULL);
+       if (NULL == co_ps)
+               return FALSE;
+
+       return TRUE;
+}
+
+void at_ps_exit(TcorePlugin *p)
+{
+       CoreObject *co_ps;
+
+       co_ps = tcore_plugin_ref_core_object(p, "umts_ps");
+       if (NULL == co_ps)
+               return;
+
+       tcore_ps_free(co_ps);
+}