2
我正在尝试编写一个简单的模块来启用发送短信。从蓝牙设备获取响应
文件:我使用蓝牙使用下面的示例连接到移动bt-sendsms.py
import bluetooth
target = '00:32:AC:32:36:E8' # Mobile address
print "Trying to send SMS on %s" % target
BTSocket = bluetooth.BluetoothSocket(bluetooth.RFCOMM)
BTSocket.connect((target, 2)) # BT Address
BTSocket.send('ATZ\r')
BTSocket.send('AT+CMGF=1\r')
#sockfd.send('AT+CSCA="+972547716507"\r') # This line changes the SMSC address - do not modify unless required
BTSocket.send('AT+CMGS="+972547877763"\r') # TO Phone Number
BTSocket.send('This is a test message - port 2.\n')
BTSocket.send(chr(26)) # CTRL+Z
print "SMS sent"
sockfd.close()
print "Closed"
我的问题是,我无法核实或获取短信的错误代码发送或任何套接字操作。
任何转诊到正确的方向可以理解
一些说明:什么是非移动端的平台/蓝牙堆栈? – 2009-06-01 11:47:58
请让我们也有手机型号。 – 2009-06-01 18:44:18