Communicating serial port on windows with php

后端 未结 1 463
轻奢々
轻奢々 2021-02-06 10:13

I\'m working with an application which connects to Huawei 3G Modem using COM ports in php. Here is my code:



        
1条回答
  •  走了就别回头了
    2021-02-06 10:40

    You need to determinate COM port number of your USB device via some external command called trough PHP's shell_exec().

    For Windows you can try this small tool:

    http://todbot.com/blog/2012/03/02/listcomports-windows-command-line-tool-for-usb-to-serial/

    https://github.com/todbot/usbSearch/

    After you call this tool via shell_exec(), you need to parse it's output (RegExp) and look for exact COM port number based on company/device name.

    0 讨论(0)
提交回复
热议问题