diff options
author | Mathieu Trudel-Lapierre <mathieu-tl@ubuntu.com> | 2013-12-20 15:35:26 -0500 |
---|---|---|
committer | Guido Günther <agx@sigxcpu.org> | 2014-02-05 08:38:48 +0100 |
commit | 728e8593184b050a9f32bf98a3fce7c2aa321bef (patch) | |
tree | e24fbad7fb39bc941a57ba6f2fdc6474780ff3de /test/location.py | |
parent | ff30c94ae57db55d37453d4dd28d9eef2cfc5685 (diff) | |
parent | afc4b839a31c530d73b91aa2483795f185eb7e52 (diff) |
Imported Debian patch 1.0.0-1debian/1.0.0-1
Diffstat (limited to 'test/location.py')
-rwxr-xr-x | test/location.py | 60 |
1 files changed, 0 insertions, 60 deletions
diff --git a/test/location.py b/test/location.py deleted file mode 100755 index 96cd1e5..0000000 --- a/test/location.py +++ /dev/null @@ -1,60 +0,0 @@ -#!/usr/bin/python -# -*- Mode: python; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details: -# -# Copyright (C) 2009 - 2010 Red Hat, Inc. -# - -import sys, dbus, time - -DBUS_INTERFACE_PROPERTIES='org.freedesktop.DBus.Properties' -MM_DBUS_SERVICE='org.freedesktop.ModemManager' -MM_DBUS_PATH='/org/freedesktop/ModemManager' -MM_DBUS_INTERFACE='org.freedesktop.ModemManager' -MM_DBUS_INTERFACE_MODEM='org.freedesktop.ModemManager.Modem' -MM_DBUS_INTERFACE_MODEM_LOCATION='org.freedesktop.ModemManager.Modem.Location' - -MM_MODEM_LOCATION_CAPABILITY_UNKNOWN = 0x00000000 -MM_MODEM_LOCATION_CAPABILITY_GPS_NMEA = 0x00000001 -MM_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI = 0x00000002 -MM_MODEM_LOCATION_CAPABILITY_GPS_RAW = 0x00000004 - -bus = dbus.SystemBus() -objpath = sys.argv[1] -if objpath[:1] != '/': - objpath = "/org/freedesktop/ModemManager/Modems/" + str(objpath) -proxy = bus.get_object(MM_DBUS_SERVICE, objpath) -modem = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM) - -props = dbus.Interface(proxy, dbus_interface=DBUS_INTERFACE_PROPERTIES) -caps = props.Get(MM_DBUS_INTERFACE_MODEM_LOCATION, "Capabilities") - -print "Location Capabilities:" -if caps & MM_MODEM_LOCATION_CAPABILITY_GPS_NMEA: - print " GPS_NMEA" -if caps & MM_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI: - print " GSM_LAC_CI" -if caps & MM_MODEM_LOCATION_CAPABILITY_GPS_RAW: - print " GPS_RAW" -print "" - -loc = dbus.Interface(proxy, dbus_interface=MM_DBUS_INTERFACE_MODEM_LOCATION) -loc.Enable(True, True) - -for i in range(0, 5): - locations = loc.GetLocation() - if locations.has_key(MM_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI): - print "GSM_LAC_CI: %s" % str(locations[MM_MODEM_LOCATION_CAPABILITY_GSM_LAC_CI]) - time.sleep(1) - -loc.Enable(False, False) - |