2 * gsm - gsm resource for zavai
4 * Copyright (C) 2009 Enrico Zini <enrico@enricozini.org>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
26 // For a list of dbus services, look in /etc/dbus-1/system.d/
27 public class GPRS: zavai.Service
29 public dynamic DBus.Object device;
35 device = zavai.registry.sbus.get_object(
36 "org.freesmartphone.ogpsd",
37 "/org/freesmartphone/GSM/Device",
38 "org.freesmartphone.GSM.PDP");
41 /// Request GPS resource
42 public override void start()
46 device.ActivateContext(
47 zavai.config.gprs_apn,
48 zavai.config.gprs_user,
49 zavai.config.gprs_pass);
50 zavai.log.info("Started GPRS");
52 } catch (GLib.Error e) {
53 zavai.log.error(e.message);
58 // Release usage of GPS
59 public override void stop()
63 device.DeactivateContext();
64 zavai.log.info("Stopped GPRS");
66 } catch (GLib.Error e) {
67 zavai.log.error(e.message);
73 public zavai.gsm.GPRS gprs = null;
79 zavai.registry.register_service(gprs);