#include <core_object.h>
#include <hal.h>
#include <at.h>
-#include <util.h>
#include <co_ps.h>
#include <co_context.h>
dbg("Exit");
}
-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,
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,
+ if (tcore_hal_setup_netif(h, co_ps, NULL, ps_context, cid,
FALSE) != TCORE_RETURN_SUCCESS)
err("Failed to disable network interface");
dbg("Exit");
}
-static void on_mount_netif(CoreObject *co_ps, const char *netif_name,
+static void on_setup_pdp(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));
tcore_context_set_ipv4_dns(ps_context, "8.8.8.8", "8.8.4.4");
- if (tcore_hal_setup_netif(h, co_ps, on_mount_netif, ps_context, cid,
+ if (tcore_hal_setup_netif(h, co_ps, on_setup_pdp, ps_context, cid,
TRUE) == TCORE_RETURN_SUCCESS)
goto out;
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);