at_modem: Add modem module skeleton
authorCaiwen Zhang <caiwen.zhang@intel.com>
Wed, 19 Dec 2012 09:05:07 +0000 (17:05 +0800)
committerwootak.jung <wootak.jung@samsung.com>
Sun, 24 Mar 2013 06:49:00 +0000 (15:49 +0900)
Change-Id: Ibc1f552a752d221c17e14458b455d5e6196ca7f7

include/at_modem.h
src/at_modem.c

index e69de29..60eeab1 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_MODEM_H__
+#define __AT_MODEM_H__
+
+gboolean at_modem_init(TcorePlugin *p);
+void at_modem_exit(TcorePlugin *p);
+
+#endif
index e69de29..d78ceb3 100644 (file)
@@ -0,0 +1,83 @@
+/*
+ * 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 <core_object.h>
+#include <plugin.h>
+#include <co_modem.h>
+
+#include "user_request.h"
+
+#include "at_modem.h"
+
+static TReturn get_imei(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static TReturn get_version(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static TReturn set_flight_mode(CoreObject *co, UserRequest *ur)
+{
+       return TCORE_RETURN_ENOSYS;
+}
+
+static struct tcore_modem_operations modem_ops = {
+       .power_on = NULL,
+       .power_off = NULL,
+       .power_reset = NULL,
+       .set_flight_mode = set_flight_mode,
+       .get_imei = get_imei,
+       .get_version = get_version,
+       .get_sn = NULL,
+       .dun_pin_ctrl = NULL,
+       .get_flight_mode = NULL,
+};
+
+gboolean at_modem_init(TcorePlugin *p)
+{
+       CoreObject *co;
+
+       co = tcore_modem_new(p, "modem", &modem_ops, NULL);
+       if (NULL == co)
+               return FALSE;
+
+       return TRUE;
+}
+
+void at_modem_exit(TcorePlugin *p)
+{
+       CoreObject *co;
+
+       if (NULL == p)
+               return;
+
+       co = tcore_plugin_ref_core_object(p, "modem");
+       if (NULL == co)
+               return;
+
+       tcore_modem_free(co);
+}