USBhelp

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - USB Interface
Introduced first in SolidGeometry 2.8, Creation date: 2015-12-01, Last change: 2025-08-18

Help text for the use of USB serial communication on MAC

Description

Important OSX/Mac Darwin serial communication commands
[~,found]=system('ioreg -p IOUSB') % returns all USB devices attached
ls '/dev/tty*' % shows all existing devices with serial communication

Useful Matlab functions:
instrfindall - finds all registered serial port objects

See Also: USBhelp , USBsearch , USBpololu

Example Illustration

 missing image of USBhelp

Syntax

USBhelp




Copyright 2015-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Algorithm (Workflow)

This function, named USBhelp, is designed to assist with USB serial communication on Mac/OSX systems. It is part of the SolidGeometry library and was introduced in version 2.8. The function primarily provides information about connected USB devices and available serial communication ports on a Mac.

Input Parameters

The function USBhelp does not take any input parameters. It operates based on the system it is executed on, specifically targeting Mac/OSX environments.

Algorithm Steps

  1. The function first checks if the operating system is Mac/OSX using the ismac function.
  2. If the system is Mac/OSX, it executes the following steps:
    • Displays the help text for the USBhelp function using the help command.
    • Executes the system command ioreg -p IOUSB to list all USB devices attached to the system. The output is stored in the variable found, but it is not used further in the function.
    • Prints a debug message indicating that using /dev/tty.* is not recommended for serial port communication.
    • Lists all devices with serial communication capabilities using the directory command dir ('/dev/tty.*').
    • Prints a debug message recommending the use of /dev/cu.* for serial port communication.
    • Lists all devices with serial communication capabilities using the directory command dir ('/dev/cu.*').
  3. If the system is not Mac/OSX, the function outputs a message to the standard error stream indicating that the function is only supported on Mac/OSX.

Output

The function does not return any values. Instead, it provides information through the console about the USB devices and serial communication ports available on a Mac/OSX system.

Additional Information

The function references other related functions such as USBsearch and USBpololu, which may provide additional USB-related functionalities.

Algorithm explaination created using ChatGPT on 2025-08-18 23:25. (Please note: No guarantee for the correctness of this explanation)

Last html export of this page out of FM database by TL: 2025-09-21