summaryrefslogtreecommitdiffstats
path: root/src/network.c
blob: 20f3aae8ecfbbbc91166b3f5265b951aea444067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/*
 * functions and data types for networking calls
 *
 * Copyright (c) 2015 Ultimaker B.V.
 * Author: Olliver Schinagl <o.schinagl@ultimaker.com>
 *
 * SPDX-License-Identifier:	AGPL-3.0+
 */

#include <Eldbus.h>

#include "dbus_common.h"
#include "network.h"

#define _TECH_ETHERNET "ethernet"
#define _TECH_WIFI "wifi"

static Eldbus_Proxy *__proxy;

Eldbus_Pending *network_connect_wifi(const struct network_data *network)
{
	if (!network)
		return NULL;
	if (!network->obj_path)
		return NULL;

	return eldbus_proxy_call(__proxy, "connectWifiNetwork", on_method_generic_bool_ret, "connectWifiNetwork", -1, "o", network->obj_path);
}

void network_init(Eldbus_Proxy *proxy)
{
	__proxy = proxy;
};

void network_shutdown(void)
{
	eldbus_proxy_unref(__proxy);
};