×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Mar 2005
    Posts
    24

    can't stop advertising a service?

    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()

  2. #2
    Super Contributor
    Join Date
    Dec 2004
    Posts
    643

    Re: can't stop advertising a service?

    Your code should work. Please file a bug about this.

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    1

    Re: can't stop advertising a service?

    I can confirm this bug for 1.3.13 final.

Similar Threads

  1. Replies: 4
    Last Post: 2006-09-05, 15:15
  2. 6680 and bluetooth service profiles
    By ceruault in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-10-08, 22:24
  3. Service Registration question
    By asmatic in forum Mobile Java Networking & Messaging & Security
    Replies: 1
    Last Post: 2005-07-21, 10:04
  4. Trouble advertising Audio service (A2DP) in SDP
    By dahhorn in forum Bluetooth Technology
    Replies: 0
    Last Post: 2004-12-29, 23:13
  5. Service Discovery
    By jimdeal in forum Bluetooth Technology
    Replies: 1
    Last Post: 2003-09-25, 09:41

Posting Permissions

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