5 * Copyright (C) 2012 BMW Car IT GmbH. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
28 #define CONNMAN_API_SUBJECT_TO_CHANGE
29 #include <connman/plugin.h>
30 #include <connman/device.h>
31 #include <connman/network.h>
32 #include <connman/dbus.h>
34 static DBusConnection *connection;
36 static int network_probe(struct connman_network *network)
38 DBG("network %p", network);
43 static void network_remove(struct connman_network *network)
45 DBG("network %p", network);
48 static int network_connect(struct connman_network *network)
50 DBG("network %p", network);
55 static int network_disconnect(struct connman_network *network)
57 DBG("network %p", network);
62 static struct connman_network_driver network_driver = {
64 .type = CONNMAN_NETWORK_TYPE_BLUETOOTH_DUN,
65 .probe = network_probe,
66 .remove = network_remove,
67 .connect = network_connect,
68 .disconnect = network_disconnect,
71 static int dundee_probe(struct connman_device *device)
73 DBG("device %p", device);
78 static void dundee_remove(struct connman_device *device)
80 DBG("device %p", device);
83 static int dundee_enable(struct connman_device *device)
85 DBG("device %p", device);
90 static int dundee_disable(struct connman_device *device)
92 DBG("device %p", device);
97 static struct connman_device_driver dundee_driver = {
99 .type = CONNMAN_DEVICE_TYPE_BLUETOOTH,
100 .probe = dundee_probe,
101 .remove = dundee_remove,
102 .enable = dundee_enable,
103 .disable = dundee_disable,
106 static int dundee_init(void)
110 connection = connman_dbus_get_connection();
111 if (connection == NULL)
114 err = connman_network_driver_register(&network_driver);
118 err = connman_device_driver_register(&dundee_driver);
120 connman_network_driver_unregister(&network_driver);
127 dbus_connection_unref(connection);
132 static void dundee_exit(void)
134 connman_device_driver_unregister(&dundee_driver);
135 connman_network_driver_unregister(&network_driver);
137 dbus_connection_unref(connection);
140 CONNMAN_PLUGIN_DEFINE(dundee, "Dundee plugin", VERSION,
141 CONNMAN_PLUGIN_PRIORITY_DEFAULT, dundee_init, dundee_exit)