Linux bluetooth development
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Santiago Carot-Nemesio <sancane@gmail.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Add thermometer python script
Date: Tue, 22 Nov 2011 12:22:10 +0200	[thread overview]
Message-ID: <20111122102210.GA3490@fusion.localdomain> (raw)
In-Reply-To: <1321954439-6086-1-git-send-email-sancane@gmail.com>

Hi Santiago,

On Tue, Nov 22, 2011, Santiago Carot-Nemesio wrote:
> --- a/Makefile.tools
> +++ b/Makefile.tools
> @@ -215,8 +215,8 @@ EXTRA_DIST += test/apitest test/sap-client test/hsplay test/hsmicro \
>  		test/test-input test/test-attrib test/test-proximity \
>  		test/test-sap-server test/test-oob test/test-serial-proxy \
>  		test/service-record.dtd test/service-did.xml \
> -		test/service-spp.xml test/service-opp.xml test/service-ftp.xml
> -
> +		test/service-spp.xml test/service-opp.xml test/service-ftp.xml \
> +		test/test-thermometer

The idea is to have these ordered so that the tests come before the xml
files, i.e. add your test after test-serial-proxy.

> +	exit_on_release = True
> +
> +	def set_exit_on_release(self, exit_on_release):
> +		self.exit_on_release = exit_on_release

What's this for? Doesn't seem to be used anywhere.

> +	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 options.adapter:
> +		adapter_path = manager.FindAdapter(options.adapter)
> +	else:
> +		adapter_path = manager.DefaultAdapter()
> +
> +	adapter = dbus.Interface(bus.get_object("org.bluez", adapter_path),
> +							"org.bluez.Adapter")
> +
> +	device_path = adapter.FindDevice(options.address)

I know you've probably just copied the options.address stuff from
test-proximity, but since the remote address is mandatory why not make
it a plain (non-switch) command line parameter. You're in any case
missing the check for whether it was provided or not which would
probably trigger an exception instead of a clean error message.

Johan

  reply	other threads:[~2011-11-22 10:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-22  9:33 [PATCH] Add thermometer python script Santiago Carot-Nemesio
2011-11-22 10:22 ` Johan Hedberg [this message]
  -- strict thread matches above, loose matches on Subject: below --
2011-11-22 12:10 Santiago Carot-Nemesio
2011-11-22 12:30 ` Johan Hedberg
2011-11-21 14:06 Santiago Carot-Nemesio
2011-11-21 15:03 ` Johan Hedberg

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=20111122102210.GA3490@fusion.localdomain \
    --to=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=sancane@gmail.com \
    /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