From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH v2 7/7] tests: Remove test-thermometer
Date: Thu, 2 Nov 2017 16:43:52 +0200 [thread overview]
Message-ID: <20171102144352.32353-7-luiz.dentz@gmail.com> (raw)
In-Reply-To: <20171102144352.32353-1-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
Thermomether interfaces no longer exists.
---
test/test-thermometer | 99 ---------------------------------------------------
1 file changed, 99 deletions(-)
delete mode 100755 test/test-thermometer
diff --git a/test/test-thermometer b/test/test-thermometer
deleted file mode 100755
index 7e67c234d..000000000
--- a/test/test-thermometer
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/usr/bin/python
-
-from __future__ import absolute_import, print_function, unicode_literals
-
-'''
-Thermometer test script
-'''
-
-from optparse import OptionParser, make_option
-import sys
-import dbus
-import dbus.service
-import dbus.mainloop.glib
-try:
- from gi.repository import GObject
-except ImportError:
- import gobject as GObject
-import bluezutils
-
-BUS_NAME = 'org.bluez'
-THERMOMETER_MANAGER_INTERFACE = 'org.bluez.ThermometerManager1'
-THERMOMETER_WATCHER_INTERFACE = 'org.bluez.ThermometerWatcher1'
-THERMOMETER_INTERFACE = 'org.bluez.Thermometer1'
-
-class Watcher(dbus.service.Object):
- @dbus.service.method(THERMOMETER_WATCHER_INTERFACE,
- in_signature="oa{sv}", out_signature="")
- def MeasurementReceived(self, device, measure):
- print("%s measurement received from %s" % (measure["Measurement"], device))
- print("Exponent: ", measure["Exponent"])
- print("Mantissa: ", measure["Mantissa"])
- print("Unit: ", measure["Unit"])
-
- if "Time" in measure:
- print("Time: ", measure["Time"])
-
- if "Type" in measure:
- print("Type: ", measure["Type"])
-
-def properties_changed(interface, changed, invalidated):
- if interface != THERMOMETER_INTERFACE:
- return
- for name, value in changed.iteritems():
- print("Property %s changed: %s" % (name, str(value)))
-
-if __name__ == "__main__":
- dbus.mainloop.glib.DBusGMainLoop(set_as_default=True)
-
- bus = dbus.SystemBus()
-
- option_list = [
- make_option("-i", "--adapter", action="store",
- type="string", dest="adapter"),
- make_option("-b", "--device", action="store",
- type="string", dest="address"),
- ]
-
- parser = OptionParser(option_list=option_list)
-
- (options, args) = parser.parse_args()
-
- if not options.address:
- print("Usage: %s [-i <adapter>] -b <bdaddr> [command]" % (sys.argv[0]))
- print("Possible commands:")
- print("\tEnableIntermediateMeasurement")
- sys.exit(1)
-
- managed_objects = bluezutils.get_managed_objects()
- adapter = bluezutils.find_adapter_in_objects(managed_objects,
- options.adapter)
- adapter_path = adapter.object_path
-
- thermometer_manager = dbus.Interface(bus.get_object(BUS_NAME,
- adapter_path), THERMOMETER_MANAGER_INTERFACE)
-
- device = bluezutils.find_device_in_objects(managed_objects,
- options.address,
- options.adapter)
- device_path = device.object_path
-
- bus.add_signal_receiver(properties_changed, bus_name=BUS_NAME,
- path=device_path,
- dbus_interface="org.freedesktop.DBus.Properties",
- signal_name="PropertiesChanged")
-
- path = "/test/watcher"
- watcher = Watcher(bus, path)
-
- thermometer_manager.RegisterWatcher(path)
-
- if len(args) > 0:
- if args[0] == "EnableIntermediateMeasurement":
- thermometer_manager.EnableIntermediateMeasurement(path)
- else:
- print("unknown command")
- sys.exit(1)
-
- mainloop = GObject.MainLoop()
- mainloop.run()
--
2.13.6
next prev parent reply other threads:[~2017-11-02 14:43 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-02 14:43 [PATCH v2 1/7] doc/advertising-api: Add Duration and Timeout Luiz Augusto von Dentz
2017-11-02 14:43 ` [PATCH v2 2/7] advertising: Add implementation of " Luiz Augusto von Dentz
2017-11-02 14:43 ` [PATCH v2 3/7] client: Add set-advertise-{duration, timeout} Luiz Augusto von Dentz
2017-11-10 6:40 ` ERAMOTO Masaya
2017-11-10 12:06 ` Luiz Augusto von Dentz
2017-11-13 5:15 ` ERAMOTO Masaya
2017-11-02 14:43 ` [PATCH v2 4/7] advertising: Use client proxy to release Luiz Augusto von Dentz
2017-11-02 14:43 ` [PATCH v2 5/7] core: Add LEAdvertisement1 to bluetooth.conf Luiz Augusto von Dentz
2017-11-02 14:43 ` [PATCH v2 6/7] core: Cleanup bluetooth.conf Luiz Augusto von Dentz
2017-11-02 14:43 ` Luiz Augusto von Dentz [this message]
2017-11-03 11:21 ` [PATCH v2 1/7] doc/advertising-api: Add Duration and Timeout Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171102144352.32353-7-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).