serialportlist is not working

16 次查看(过去 30 天)
hello when i enter the command serialportlist i get the message ans=1x0 empty string error. can you please let me know how to fix it. thanks a lot.
  2 个评论
Walter Roberson
Walter Roberson 2023-8-12
That is the output I would expect if you do not have any serial port devices connected to your computer.
If you are using Windows, then does Device Manager show any serial USB devices? Or any bluetooth ?
sddfds sddfds
sddfds sddfds 2023-8-12
移动:Walter Roberson 2023-8-12
i have a usb mouse connected to my laptop. i tried serialportlist("all") and serialportlist("available") and i got the same message. i have attached an image of device manager.

请先登录,再进行评论。

采纳的回答

Walter Roberson
Walter Roberson 2023-8-12
USB mice are not serialports.
Each USB physical device has one or more "endpoints" associated with it. For example a webcam might have a video data and an audio data endpoint associated with the same physical device, and quite possibly a video control endpoint as well.
Serial (COM) over USB data is associated with USB class 0x0A (CDC-DATA)
Mice on the other hand are USB class 0x03 (HID) -- Human Interface Device
Mice use a different packet protocol than serial ports do. it is sort of like how network PING packets have a different packet protocol than TCP packets. They are not intended to do the same thing, and they talk different ways.

更多回答(0 个)

产品


版本

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by