0

ハイガイズ、

PythonアプリケーションからBluetooth経由でATコマンドを送信するにはどうすればよいですか?

OS:fedora 8

誰かがコードで私を癒してくれませんか?

どのパッケージをインポートする必要がありますか?

どこからダウンロードできますか?

4

2 に答える 2

1

To get a connection over bluetooth to your IP modem, you want to use the bluetooth rfcomm driver:

michael@challenger:~> cat /etc/bluetooth/rfcomm.conf  
rfcomm0 {
        # Automatically bind the device at startup
        bind yes;
        # Bluetooth address of the device
        device 00:1C:CC:XX:XX:XX;
        # RFCOMM channel for the connection
        channel 1;
        # Description of the connection
        comment "Blackberry";
}

This is the setup I use for mine - YMMV.

michael@challenger:~> cu -l /dev/rfcomm0
Connected.
ATI
Research in Motion BlackBerry IP Modem

OK

Once you have the rfcomm0 port, you treat the port as a standard serial port and you're good to go.

于 2010-01-29T17:45:30.613 に答える
1

これの方がいいと思います……。

import bluetooth 
sockfd = bluetooth.BluetoothSocket(bluetooth.RFCOMM) 
sockfd.connect(('00:24:7E:9E:55:0D', 1)) # BT Address 
sockfd.send('ATZ\r') 
time.sleep(1) 
sockfd.send(chr(26)) 
sockfd.close()
于 2010-03-10T09:51:44.260 に答える