×

Discussion Board

Results 1 to 1 of 1
  1. #1
    Registered User
    Join Date
    Feb 2010
    Posts
    2

    btsocket and AT commands

    Hi everyone!

    I am new in programming in python so I would like to ask you how can I send AT commands using btsocket or which library use to do it.
    I wrote this:
    Code:
    import btsocket
    
    server=btsocket.socket(btsocket.AF_BT, btsocket.SOCK_STREAM)
    channel = btsocket.bt_rfcomm_get_available_server_channel(server)
    server.bind(("", channel))
    server.listen(1)
    btsocket.bt_advertise_service(u"btchat", server, True, btsocket.RFCOMM)
    btsocket.set_security(server, btsocket.AUTH | btsocket.AUTHOR)
    client=btsocket.bt_discover()
    con=server.connect((client[0],channel))
    server.send("AT*\r")
    
    print server.recv(1024)
    server.close()
    but it dose not work. Can you help me?

    Thanks in advance
    Last edited by kuba746; 2010-02-11 at 20:07. Reason: some chaneges in code

Posting Permissions

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