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
- The function first checks if the operating system is Mac/OSX using the
ismac
function.
- 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.*')
.
- 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