public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Henry Owens <owens.henry@googlemail.com>
To: Vinicius Gomes <vinicius.gomes@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: Bluetooth SPP on Nokia N900 (Maemo 5)
Date: Fri, 5 Mar 2010 10:52:25 +0000	[thread overview]
Message-ID: <aa6ee971003050252i23709c44l585bd6a9851d0936@mail.gmail.com> (raw)
In-Reply-To: <2a9506371003020914q3786eb70k57f5b1adda62c05@mail.gmail.com>

Vinicius,

Many thanks for your help - I used the example script, and it is now
connecting correctly to my device.

I am having a slight issue, however, with the fact that the
"SetSerialParameters" method is experimental, and thus I can not use
it - could anyone point me to where I can set the parameters correctly
so that it can receive packets from the device?

FYI, the device is simplex - it sends a packet once per second, and
ignores any commands, so I simply want to receive the packets and
parse them.

At present, when I use the code below, I do not get any output, which
I assume is because my serial settings are incorrect.

Many thanks again for your help,
Henry.

test.py:

import sys
import dbus

bus = dbus.SystemBus()

manager = dbus.Interface(bus.get_object("org.bluez", "/"),
						"org.bluez.Manager")

adapter = dbus.Interface(bus.get_object("org.bluez", manager.DefaultAdapter()),
							"org.bluez.Adapter")

address = "00:07:80:88:F4:E9"
service = "spp"

path = adapter.FindDevice(address)

serial = dbus.Interface(bus.get_object("org.bluez", path),
						"org.bluez.Serial")

node = serial.Connect(service)

print "Connected %s to %s" % (node, address)

print "Press CTRL-C to disconnect"

a = open("/dev/rfcomm0","r")

w = a.readline()

print w

serial.Disconnect(node)



On Tue, Mar 2, 2010 at 5:14 PM, Vinicius Gomes
<vinicius.gomes@openbossa.org> wrote:
> Hi Henry,
>
> On Tue, Mar 2, 2010 at 1:26 PM, Henry Owens <owens.henry@googlemail.com> wrote:
>> Hi All,
>>
>> My first mail to this list. I am currently trying to get a bluetooth
>> SPP connection going on my Nokia N900, but I'm having some
>> difficulties using the examples on the HOWTO Wiki.
>>
>> Specifically, I get an error related to the ActivateService call in
>> the example - I have seen reference to this being obselete in Bluez
>> 4.x, is this the problem in the example code?
>>
>
> Yeah, the example code in the wiki is outdated, take a look at the
> example in the sources [1],
> for a working one.
>
> Also, in that same directory there are a few more examples that could be useful.
>
>
> Cheers,
> --
> Vinicius Gomes
> INdT - Instituto Nokia de Tecnologia
>
> [1] http://git.kernel.org/?p=bluetooth/bluez.git;a=blob;f=test/test-serial;hb=HEAD
> --
> To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

      reply	other threads:[~2010-03-05 10:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-02 16:26 Bluetooth SPP on Nokia N900 (Maemo 5) Henry Owens
2010-03-02 17:14 ` Vinicius Gomes
2010-03-05 10:52   ` Henry Owens [this message]

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=aa6ee971003050252i23709c44l585bd6a9851d0936@mail.gmail.com \
    --to=owens.henry@googlemail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    --cc=vinicius.gomes@openbossa.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