Serial_GetUSBInfo |
Get USB information (if available) of the serial port with the specified name.
Syntax
Serial_GetUSBInfo ( switches ; portname )
Parameters
switches | specifies which information you want to get |
portname | the name of the serial port you want to get the USB information of |
Switches
switches can be one of this:
-Verbose | (default) returns a list of USB information about the port |
-USBVendorName | returns the vendor name of the USB port hardware |
-USBProductName | returns the product name of the USB hardware |
-USBSerialNumber | returns the serial number of the USB hardware |
-USBVendorID | returns the vendor ID as a hex number |
-USBProductID | returns the product ID of this hardware product as a hex number |
Returned Result
Data type returned
Text
Result
The requested information.
If an error occurs an error code is returned. Returned error codes can be:
$$-50 | paramErr | parameter error |
Other errors may be returned.
Originated in
Troi Serial Plug-in 8.0
Compatibility
FileMaker Pro 16 to FileMaker Pro 2023
Considerations
A serial port can be implemented as virtual port on top of a USB port. When this is the case this function returns information about the USB (hardware) port, like the USB vendor name, USB Product name and USB Serial number.
If this serial port is not running on a USB port the function returns “<no USB information found>”.
If you specify no portname a list of information of all ports is returned.
Example
Set Field [ result ; Serial_GetUSBInfo ( "-Verbose" ; "usbmodem15501" ) ]
This returns the USB information of the usbmodem15501 serial port, and will be similar to this:
USB Vendor ID: 0x2a03
USB Product ID: 0x1043
USB Vendor Name: Arduino SRL
USB Product Name: US-123AB Serial Adapter
USB Serial Number: 12345678AB5B0
Example 2
Set Variable [ $USBSerialNumber ; Serial_GetUSBInfo ( "-USBSerialNumber" ; "usbmodem42501" ) ]
This returns the USB serial number of this USB port. If you have multiple USB devices attached to a computer you can use the USB serial number to distinguish between these similar USB ports.
Used in example file
Debug.fmp12
Related functions
Serial_GetPortInfo |
Serial_GetPortNames |
Related topics
Troi Serial Plug-in online help (overview)