You Are Here:

Community: Developer Discussion Boards

#1 Old can't stop advertising a service? - 2006-03-17, 02:40

Join Date: Mar 2005
Posts: 24
buzz111
Offline
Registered User
Hi,

As far as I can tell, calling bt_advertise_service() with a 'False' flag should stop advertising a service. But if I run the snippet below, it will start advertising the service, but the service does not get removed after the last call to bt_advertise_service(). (So, if I run this code a few times, it advertises duplicate services with the same name and channel.)

Do other people have this problem? I am running PyS60 1.3.1 final. I am not sure whether this is a problem on other versions.

Thanks very much,
B.

===
import socket

SERVICE_NAME = u"My Service"

s = socket.socket(socket.AF_BT, socket.SOCK_STREAM)
p = socket.bt_rfcomm_get_available_server_channel(s)

s.bind(("", p))
socket.set_security(s, socket.AUTH)

print "Advertising service '%s'" % SERVICE_NAME
socket.bt_advertise_service(SERVICE_NAME, s, True, socket.OBEX)

print "Stopping service"
socket.bt_advertise_service(SERVICE_NAME, s, False, socket.OBEX)

print "Closing socket"
s.close()
Reply With Quote

#2 Old Re: can't stop advertising a service? - 2006-03-17, 14:35

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Your code should work. Please file a bug about this.
Reply With Quote

#3 Old Re: can't stop advertising a service? - 2006-11-15, 23:11

Join Date: Nov 2006
Posts: 1
seedslow
Offline
Registered User
I can confirm this bug for 1.3.13 final.
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump
Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with service attribute propagation and service attribute retrieval pfrey Bluetooth Technology 4 2006-09-05 16:15
6680 and bluetooth service profiles ceruault Mobile Java Networking & Messaging & Security 1 2005-10-08 23:24
Service Registration question asmatic Mobile Java Networking & Messaging & Security 1 2005-07-21 11:04
Trouble advertising Audio service (A2DP) in SDP dahhorn Bluetooth Technology 0 2004-12-30 00:13
Service Discovery jimdeal Bluetooth Technology 1 2003-09-25 10:41

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia