src/at_ps.c
src/at_sms.c
src/at_ss.c
+ src/at_sat.c
+ src/at_sap.c
+ src/at_gps.c
)
# library build
#ifndef __AT_CALL_H__
#define __AT_CALL_H__
-gboolean at_call_init(TcorePlugin *p);
-void at_call_exit(TcorePlugin *p);
+gboolean at_call_init(TcorePlugin *cp);
+void at_call_exit(TcorePlugin *cp);
#endif
--- /dev/null
+/*
+ * 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_GPS_H__
+#define __AT_GPS_H__
+
+gboolean at_gps_init(TcorePlugin *cp);
+void at_gps_exit(TcorePlugin *cp);
+
+#endif
\ No newline at end of file
#ifndef __AT_MODEM_H__
#define __AT_MODEM_H__
-gboolean at_modem_init(TcorePlugin *p);
-void at_modem_exit(TcorePlugin *p);
+gboolean at_modem_init(TcorePlugin *cp);
+void at_modem_exit(TcorePlugin *cp);
#endif
#ifndef __AT_NETWORK_H__
#define __AT_NETWORK_H__
-gboolean at_network_init(TcorePlugin *p);
-void at_network_exit(TcorePlugin *p);
+gboolean at_network_init(TcorePlugin *cp);
+void at_network_exit(TcorePlugin *cp);
#endif
#ifndef __AT_PS_H__
#define __AT_PS_H__
-gboolean at_ps_init(TcorePlugin *p);
-void at_ps_exit(TcorePlugin *p);
+gboolean at_ps_init(TcorePlugin *cp);
+void at_ps_exit(TcorePlugin *cp);
#endif
--- /dev/null
+/*
+ * 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_SAP_H__
+#define __AT_SAP_H__
+
+gboolean at_sap_init(TcorePlugin *cp);
+void at_sap_exit(TcorePlugin *cp);
+
+#endif
\ No newline at end of file
--- /dev/null
+/*
+ * 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_SAT_H__
+#define __AT_SAT_H__
+
+gboolean at_sat_init(TcorePlugin *cp);
+void at_sat_exit(TcorePlugin *cp);
+
+#endif
\ No newline at end of file
+/*
+ * 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_SIM_H__
+#define __AT_SIM_H__
+
+gboolean at_sim_init(TcorePlugin *cp);
+void at_sim_exit(TcorePlugin *cp);
+
+#endif
\ No newline at end of file
#ifndef __AT_SMS_H__
#define __AT_SMS_H__
-gboolean at_sms_init(TcorePlugin *p);
-void at_sms_exit(TcorePlugin *p);
+gboolean at_sms_init(TcorePlugin *cp);
+void at_sms_exit(TcorePlugin *cp);
#endif
+/*
+ * 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_SS_H__
+#define __AT_SS_H__
+
+gboolean at_ss_init(TcorePlugin *cp);
+void at_ss_exit(TcorePlugin *cp);
+
+#endif
\ No newline at end of file
#include <glib.h>
#include <tcore.h>
-#include <hal.h>
-#include <core_object.h>
-#include <plugin.h>
-#include <queue.h>
#include <server.h>
+#include <plugin.h>
+#include <core_object.h>
#include <co_call.h>
#include "at_call.h"
.set_sound_noise_reduction = NULL,
};
-gboolean at_call_init(TcorePlugin *p)
+gboolean at_call_init(TcorePlugin *cp)
{
- CoreObject *co = NULL;
+ CoreObject *co;
+ Server *server;
- co = tcore_call_new(p, "call", &call_ops, NULL);
- if (NULL == co)
+ co = tcore_call_new(cp, &call_ops, NULL);
+ if (co == NULL)
return FALSE;
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
return TRUE;
}
-void at_call_exit(TcorePlugin *p)
+void at_call_exit(TcorePlugin *cp)
{
CoreObject *co;
- if (NULL == p)
+ if (cp == NULL)
return;
- co = tcore_plugin_ref_core_object(p, "call");
- if (NULL == co)
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_CALL);
+ if (co == NULL)
return;
- tcore_call_free(co);
+ tcore_object_free(co);
}
--- /dev/null
+/*
+ * 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 <server.h>
+#include <plugin.h>
+#include <core_object.h>
+#include <co_gps.h>
+
+#include "at_gps.h"
+
+gboolean at_gps_init(TcorePlugin *cp)
+{
+ CoreObject *co;
+ Server *server;
+
+ co = tcore_gps_new(cp, NULL, NULL);
+ if (co == NULL)
+ return FALSE;
+
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
+ return TRUE;
+}
+
+void at_gps_exit(TcorePlugin *cp)
+{
+ CoreObject *co;
+
+ if (cp == NULL)
+ return;
+
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_GPS);
+ if (co == NULL)
+ return;
+
+ tcore_object_free(co);
+}
#include <glib.h>
#include <tcore.h>
-#include <core_object.h>
+#include <server.h>
#include <plugin.h>
+#include <core_object.h>
#include <co_modem.h>
#include "user_request.h"
.get_flight_mode = NULL,
};
-gboolean at_modem_init(TcorePlugin *p)
+gboolean at_modem_init(TcorePlugin *cp)
{
CoreObject *co;
+ Server *server;
- co = tcore_modem_new(p, "modem", &modem_ops, NULL);
- if (NULL == co)
+ co = tcore_modem_new(cp, &modem_ops, NULL);
+ if (co == NULL)
return FALSE;
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
return TRUE;
}
-void at_modem_exit(TcorePlugin *p)
+void at_modem_exit(TcorePlugin *cp)
{
CoreObject *co;
- if (NULL == p)
+ if (cp == NULL)
return;
- co = tcore_plugin_ref_core_object(p, "modem");
- if (NULL == co)
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_MODEM);
+ if (co == NULL)
return;
- tcore_modem_free(co);
+ tcore_object_free(co);
}
#include <glib.h>
#include <tcore.h>
-#include <hal.h>
-#include <core_object.h>
+#include <server.h>
#include <plugin.h>
-#include <queue.h>
+#include <core_object.h>
#include <co_network.h>
-#include <server.h>
-
-#include "at.h"
-#include "user_request.h"
#include "at_network.h"
.get_mode = NULL,
};
-gboolean at_network_init(TcorePlugin *plugin)
+gboolean at_network_init(TcorePlugin *cp)
{
CoreObject *co;
+ Server *server;
- co = tcore_network_new(plugin, "umts_network", &network_ops, NULL);
- if (NULL == co)
+ co = tcore_network_new(cp, &network_ops, NULL);
+ if (co == NULL)
return FALSE;
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
return TRUE;
}
-void at_network_exit(TcorePlugin *plugin)
+void at_network_exit(TcorePlugin *cp)
{
CoreObject *co;
- if (NULL == plugin)
+ if (cp == NULL)
return;
- co = tcore_plugin_ref_core_object(plugin, "umts_network");
- if (NULL == co)
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_NETWORK);
+ if (co == NULL)
return;
- tcore_network_free(co);
+ tcore_object_free(co);
}
#include <glib.h>
#include <tcore.h>
-#include <core_object.h>
+#include <server.h>
#include <plugin.h>
+#include <core_object.h>
#include <co_phonebook.h>
#include "at_phonebook.h"
gboolean at_phonebook_init(TcorePlugin *cp)
{
CoreObject *co;
+ Server *server;
- co = tcore_phonebook_new(cp, "phonebook", &phonebook_ops, NULL);
+ co = tcore_phonebook_new(cp, &phonebook_ops, NULL);
if (co == NULL)
return FALSE;
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
return TRUE;
}
{
CoreObject *co;
- co = tcore_plugin_ref_core_object(cp, "phonebook");
+ if (cp == NULL)
+ return;
+
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_PHONEBOOK);
if (co == NULL)
return;
- tcore_phonebook_free(co);
+ tcore_object_free(co);
}
dbg("Sending %s", (result == TRUE) ? "OK" : "FAIL");
}
-static void notify_context_deactivated(CoreObject *co_ps, unsigned int cid)
+static void notify_context_status_changed(CoreObject *co_ps, unsigned int cid,
+ enum ps_data_call_status status)
{
struct tnoti_ps_call_status data_resp = {0};
TcorePlugin *p = tcore_object_ref_plugin(co_ps);
dbg("Enter");
data_resp.context_id = cid;
- data_resp.state = PS_DATA_CALL_NOT_CONNECTED;
+ data_resp.state = status;
tcore_server_send_notification(server, co_ps, TNOTI_PS_CALL_STATUS,
sizeof(struct tnoti_ps_call_status),
dbg("Exit");
}
-static void on_setup_netif(CoreObject *co_ps, const char *netif_name,
+static void on_unmount_netif(CoreObject *co_ps, const char *netif_name,
+ void *user_data)
+{
+ CoreObject *ps_context = user_data;
+ char *ifname;
+
+ dbg("Enter");
+
+ ifname = tcore_context_get_ipv4_devname(ps_context);
+
+ if (tcore_util_netif(ifname, FALSE) != TCORE_RETURN_SUCCESS)
+ dbg("disabling network interface failed");
+
+ dbg("Exit");
+}
+
+static void on_response_set_pdp_context_deactivate(TcorePending *p,
+ int data_len,
+ const void *data,
+ void *user_data)
+{
+ CoreObject *co_ps = tcore_pending_ref_core_object(p);
+ TcoreHal *h = tcore_object_get_hal(co_ps);
+ const TcoreATResponse *resp = data;
+ CoreObject *ps_context = user_data;
+ unsigned int cid = tcore_context_get_id(ps_context);
+
+ dbg("Enter");
+
+ /*
+ * AT+CGACT = 0 is returning NO CARRIER or an error. Just test if the
+ * response contains NO CARRIER else decode CME error.
+ */
+ if (resp->lines != NULL) {
+ const char *line;
+
+ line = (const char *)resp->lines->data;
+ if (g_strcmp0(line, "NO CARRIER") != 0) {
+ /* TODO: Decode CME error */
+ err("%s", line);
+ err("Context %d has not been deactivated", cid);
+
+ goto out;
+ }
+
+ }
+
+ notify_context_status_changed(co_ps, cid, PS_DATA_CALL_NOT_CONNECTED);
+
+ if (tcore_hal_setup_netif(h, co_ps, on_unmount_netif, ps_context, cid,
+ FALSE) != TCORE_RETURN_SUCCESS)
+ err("Failed to disable network interface");
+
+out:
+ dbg("Exit");
+}
+
+static void on_mount_netif(CoreObject *co_ps, const char *netif_name,
void *user_data)
{
CoreObject *ps_context = user_data;
dbg("devname = [%s]", netif_name);
tcore_context_set_ipv4_devname(ps_context, netif_name);
+ if (tcore_util_netif(netif_name, TRUE) != TCORE_RETURN_SUCCESS)
+ dbg("disabling network interface failed");
server = tcore_plugin_ref_server(tcore_object_ref_plugin(co_ps));
dbg("Enter");
- if (NULL == resp->final_response) {
+ if (resp->final_response == NULL) {
err("Response NOK");
goto error;
}
dbg("Response OK");
- if (NULL == resp->lines) {
+ if (resp->lines == NULL) {
err("Invalid response line");
goto error;
}
tcore_context_set_ipv4_dns(ps_context, "8.8.8.8", "8.8.4.4");
- if (tcore_hal_setup_netif(h, co_ps, on_setup_netif, ps_context, cid)
- == TCORE_RETURN_SUCCESS)
+ if (tcore_hal_setup_netif(h, co_ps, on_mount_netif, ps_context, cid,
+ TRUE) == TCORE_RETURN_SUCCESS)
goto out;
error:
out:
tcore_at_tok_free(tokens);
-
dbg("Exit");
}
dbg("Exit");
}
-static void on_response_set_pdp_context_deactivate(TcorePending *p,
- int data_len,
- const void *data,
- void *user_data)
-{
- CoreObject *co_ps = tcore_pending_ref_core_object(p);
- const TcoreATResponse *resp = data;
- CoreObject *ps_context = user_data;
- unsigned int cid = tcore_context_get_id(ps_context);
-
- dbg("Enter");
-
- /*
- * AT+CGACT = 0 is returning NO CARRIER or an error. Just test if the
- * response contains NO CARRIER else decode CME error.
- */
- if (resp->lines != NULL) {
- const char *line;
-
- line = (const char *)resp->lines->data;
- if (g_strcmp0(line, "NO CARRIER") != 0) {
- /* TODO: Decode CME error */
- err("%s", line);
- err("Context %d has not been deactivated", cid);
-
- goto out;
- }
-
- }
-
- notify_context_deactivated(co_ps, cid);
-
-out:
- dbg("Exit");
-}
-
static void on_response_set_pdp_context_activate(TcorePending *p, int data_len,
const void *data,
void *user_data)
/* TODO: Manage CME errors */
err("Response NOK");
- notify_context_deactivated(co_ps, cid);
+ notify_context_status_changed(co_ps, cid, PS_DATA_CALL_NOT_CONNECTED);
}
dbg("Exit");
on_confirmation_ps_message_send, NULL)
!= TCORE_RETURN_SUCCESS) {
err("Failed to prepare and send AT request");
- notify_context_deactivated(co_ps, cid);
+ notify_context_status_changed(co_ps, cid, PS_DATA_CALL_NOT_CONNECTED);
ret = TCORE_RETURN_FAILURE;
}
{
const TcoreATResponse *resp = data;
CoreObject *ps_context = user_data;
+ unsigned int cid = tcore_context_get_id(ps_context);
CoreObject *co_ps = tcore_pending_ref_core_object(p);
dbg("Enter");
if (resp->success) {
dbg("Response OK");
- set_pdp_context(co_ps, ps_context, ACTIVATE);
+ notify_context_status_changed(co_ps, cid, PS_DATA_CALL_CTX_DEFINED);
} else {
- unsigned int cid = tcore_context_get_id(ps_context);
err("Response NOK");
- notify_context_deactivated(co_ps, cid);
+ notify_context_status_changed(co_ps, cid, PS_DATA_CALL_NOT_CONNECTED);
}
dbg("Exit");
}
-static TReturn define_pdp_context(CoreObject *co_ps, CoreObject *ps_context)
+static TReturn define_pdp_context(CoreObject *co_ps, CoreObject *ps_context,
+ void *user_data)
{
char *apn = NULL;
char *cmd_str = NULL;
err("Failed to prepare and send AT request");
error:
- notify_context_deactivated(co_ps, cid);
+ notify_context_status_changed(co_ps, cid, PS_DATA_CALL_NOT_CONNECTED);
out:
-
dbg("Exit");
return ret;
dbg("Enter");
- if (NULL == line)
+ if (line == NULL)
goto out;
dbg("Lines->data :%s", line);
cid = (unsigned int)atoi(noti_data);
dbg("Context %d deactivated", cid);
- notify_context_deactivated(co_ps, cid);
+ notify_context_status_changed(co_ps, cid, PS_DATA_CALL_NOT_CONNECTED);
+
+ /*
+ * TODO Implement core object PS API to retreive context by ID to get
+ * network interface name and disable it.
+ */
out:
tcore_at_tok_free(tokens);
static TReturn activate_ps_context(CoreObject *co_ps, CoreObject *ps_context,
void *user_data)
{
- return define_pdp_context(co_ps, ps_context);
+ return set_pdp_context(co_ps, ps_context, ACTIVATE);
}
static TReturn deactivate_ps_context(CoreObject *co_ps, CoreObject *ps_context,
}
static struct tcore_ps_operations ps_ops = {
+ .define_context = define_pdp_context,
.activate_context = activate_ps_context,
.deactivate_context = deactivate_ps_context
};
-gboolean at_ps_init(TcorePlugin *p)
+gboolean at_ps_init(TcorePlugin *cp)
{
- CoreObject *co_ps;
+ CoreObject *co = NULL;
Server *server;
- co_ps = tcore_ps_new(p, "umts_ps", &ps_ops, NULL);
- if (NULL == co_ps)
+ co = tcore_ps_new(cp, &ps_ops, NULL);
+ if (co == NULL)
return FALSE;
- tcore_object_add_callback(co_ps, "+CGEV", on_cgev_notification, NULL);
+ tcore_object_add_callback(co, "+CGEV", on_cgev_notification, NULL);
- server = tcore_plugin_ref_server(p);
- tcore_server_add_template_object(server, co_ps);
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
return TRUE;
}
-void at_ps_exit(TcorePlugin *p)
+void at_ps_exit(TcorePlugin *cp)
{
- CoreObject *co_ps;
+ CoreObject *co;
+
+ if (cp == NULL)
+ return;
- co_ps = tcore_plugin_ref_core_object(p, "umts_ps");
- if (NULL == co_ps)
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_PS);
+ if (co == NULL)
return;
- tcore_ps_free(co_ps);
+ tcore_object_free(co);
}
--- /dev/null
+/*
+ * 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 <server.h>
+#include <plugin.h>
+#include <core_object.h>
+#include <co_sap.h>
+
+#include "at_sap.h"
+
+gboolean at_sap_init(TcorePlugin *cp)
+{
+ CoreObject *co;
+ Server *server;
+
+ co = tcore_sap_new(cp, NULL, NULL);
+ if (co == NULL)
+ return FALSE;
+
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
+ return TRUE;
+}
+
+void at_sap_exit(TcorePlugin *cp)
+{
+ CoreObject *co;
+
+ if (cp == NULL)
+ return;
+
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_SAP);
+ if (co == NULL)
+ return;
+
+ tcore_object_free(co);
+}
--- /dev/null
+/*
+ * 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 <server.h>
+#include <plugin.h>
+#include <core_object.h>
+#include <co_sat.h>
+
+#include "at_sat.h"
+
+gboolean at_sat_init(TcorePlugin *cp)
+{
+ CoreObject *co;
+ Server *server;
+
+ co = tcore_sat_new(cp, NULL, NULL);
+ if (co == NULL)
+ return FALSE;
+
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
+ return TRUE;
+}
+
+void at_sat_exit(TcorePlugin *cp)
+{
+ CoreObject *co;
+
+ if (cp == NULL)
+ return;
+
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_SAT);
+ if (co == NULL)
+ return;
+
+ tcore_object_free(co);
+}
+/*
+ * 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 <server.h>
+#include <plugin.h>
+#include <core_object.h>
+#include <co_sim.h>
+
+#include "at_sim.h"
+
+gboolean at_sim_init(TcorePlugin *cp)
+{
+ CoreObject *co;
+ Server *server;
+
+ co = tcore_sim_new(cp, NULL, NULL);
+ if (co == NULL)
+ return FALSE;
+
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
+ return TRUE;
+}
+
+void at_sim_exit(TcorePlugin *cp)
+{
+ CoreObject *co;
+
+ if (cp == NULL)
+ return;
+
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_SIM);
+ if (co == NULL)
+ return;
+
+ tcore_object_free(co);
+}
#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);
}
+/*
+ * 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 <server.h>
+#include <plugin.h>
+#include <core_object.h>
+#include <co_ss.h>
+
+#include "at_ss.h"
+
+gboolean at_ss_init(TcorePlugin *cp)
+{
+ CoreObject *co;
+ Server *server;
+
+ co = tcore_ss_new(cp, NULL, NULL);
+ if (co == NULL)
+ return FALSE;
+
+ server = tcore_plugin_ref_server(cp);
+ tcore_server_add_template_object(server, co);
+
+ return TRUE;
+}
+
+void at_ss_exit(TcorePlugin *cp)
+{
+ CoreObject *co;
+
+ if (cp == NULL)
+ return;
+
+ co = tcore_plugin_ref_core_object(cp, CORE_OBJECT_TYPE_SS);
+ if (co == NULL)
+ return;
+
+ tcore_object_free(co);
+}
+