Bluetooth SPP on Nokia N900 (Maemo 5)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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?

If so, how could the code be rewritten to allow a connection (I have
no prior experience with BT programming, but am comfortable in
Python).

The code at the moment is:

import dbus
import time
import sys
bus = dbus.SystemBus()
bmgr = dbus.Interface(bus.get_object('org.bluez', '/org/bluez'),
'org.bluez.Manager')
bus_id = bmgr.ActivateService('serial')
serial = dbus.Interface(bus.get_object(bus_id, '/org/bluez/serial'),
'org.bluez.serial.Manager')
# Service connection, read the serial API to check the available patterns
if (len(sys.argv) < 2):
        print "Usage: %s <address> [service]" % (sys.argv[0])
        sys.exit(1)
address = sys.argv[1]
if (len(sys.argv) < 3):
        service = "spp"
else:
        service = sys.argv[2]
# Bind to the default local adapter
device = serial.ConnectService(address, service)
print "Connected %s to %s" % (device, address)
print "Press CTRL-C to disconnect"
try:
        time.sleep(1000)
        print "Terminating connection"
except:
        pass
serial.DisconnectService(device)


Regards,
Henry.
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux