PySerial API认为在write()期间com端口仍处于打开状态,为什么?
|
我正在使用PySerial(用于串行通信的Python API)通过蓝牙将AT命令发送到诺基亚手机。
import serial
com = serial.Serial()
com.port = 19
com.timeout = 0 #also tried a timeout value greater than 0.
try:
com.open()
# at this point I turn off the phone.
com.write(\"AT\\r\\n\")
print com.readlines()
except SerialException, e:
print e
打开()通信后,我就关闭了电话。然后,我写(\“ AT \\ r \\ n \”)。此时,功能块和运行时挂起。
你有什么解决办法吗?
没有找到相关结果
已邀请:
2 个回复
抬澈帅沮
街茬