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:
but it dose not work. Can you help me?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()
Thanks in advance

Reply With Quote

