有命令行com端口查询工具吗?

发布于 2024-08-10 13:59:54 字数 1539 浏览 1 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

栀梦 2024-08-17 13:59:54

这可能不完全是你想要的,但我编写了一个通过 AT 命令进行通信的 python 框架。它支持 Linux 和 Windows 上的数据线、蓝牙(用 Python 2 编写)。

使用该框架构建的示例程序是 RecNPlay。使用 RecNPlay,您可以在手机上记录(保存)和回放击键。

您可以以 RecNPlay 为例,编写自己的工具来进行通信。 RecNPlay 所构建的库称为 PyGSMLib,它为许多 AT 命令提供了 python 包装器,并支持“AT 未经请求的结果”。

监听诺基亚特定 GPRS 事件的示例 python 程序(例如连接、与移动设备断开连接、通过网络断开连接):

device = sys.argv[1]

sconn = None
comm = None
try:
    sconn = Serial(device, 9600, timeout=3)
    print "Initializing V250 connection...",
    comm = V250Communicator(sconn)
    print "ok"
    gsm = NokiaController(comm, True)
    gsm.nokiaEnableGprsEventReporting()
    def listen(msg):
        print "Unknown: %s" % str(msg)

    comm.setUnsolicitedResultListener(listen)
    import os
    os.sys.stdin.readline()
finally:
    if sconn:
        sconn.close()

It's probably not exactly what you want but I wrote a python framework for communicating via AT-commands. It supports data cables, bluetooth on Linux and Windows (written in Python 2).

A sample program built with that framework is RecNPlay. With RecNPlay you are able to record (, save) and playback keystrokes on your mobile phone.

You could take RecNPlay as an example and program your own tool to communicate. The library RecNPlay is built on is called PyGSMLib and provides python-wrappers to a lot of AT-commands and supports 'AT unsolicited results'.

Sample python program which listens to Nokia specific GPRS events (like connect, disconnect from mobile, disconnect by network):

device = sys.argv[1]

sconn = None
comm = None
try:
    sconn = Serial(device, 9600, timeout=3)
    print "Initializing V250 connection...",
    comm = V250Communicator(sconn)
    print "ok"
    gsm = NokiaController(comm, True)
    gsm.nokiaEnableGprsEventReporting()
    def listen(msg):
        print "Unknown: %s" % str(msg)

    comm.setUnsolicitedResultListener(listen)
    import os
    os.sys.stdin.readline()
finally:
    if sconn:
        sconn.close()
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文