Online Development Notebook > Index > Programming Overview > DLL Commands > DeviceMfr

DeviceMfr - Return the manufacturer string of the device


Description:

This is a USBm.dll function that returns the Manufacturer string from a USB device.

Command Syntax:

true⁄false USBm_DeviceMfr( device, string )

The USBm_DeviceMfr function syntax has these parts:

Part Description
device Valid device from 0 to the maximum number of devices found (minus 1) . Any other number results in a FALSE return.
string Any valid string expression.

Remarks:

In VB the string passed as an argument must be large enough to hold all the characters that the function places in the string. The best way to acheive this is to set the string to a large size with the String function as in this code:

strStrng = String(250, " ")

Note: USBm_DeviceMfr returns TRUE for a valid device.

VB Declaration (USBmAPI.bas)

Public Declare Function USBm_DeviceMfr _
    Lib "USBm.dll" _
        (ByVal device As Byte, _
        ByVal manufacturer As String) _
    As Integer

VB Example

Dim strng As String * 255

    USBm_DeviceMfr 3, strng
    frmStatus.lstDevices.AddItem "Manuf: " & strng

This code fragment shows that strng is loaded with the "manufacturer" text of device three. Assuming that the form called "Main" exists with a text box called "Info", the "manufacturer " information will be made visible to the user.

C Prototype

int USBm_DeviceMfr( unsigned char device, char *manuf );

C Example

RobotBASIC

DID, PID, VID, Mfr, Prod, Serial Number, and Firmware Version are all handled by the RobotBASIC function usbm_DeviceSpecs(ne_DeviceNumber).

usbm_DeviceSpecs(ne_DeviceNumber)

Returns a string that contains information about the device. There are 7 sections seperated by the | character. You can use the Extract() function to extract each section seperately if desired. The sections are:

DID

PID

VID

Mfr

Prod

Serial Number

Firmware Version


Hardware:  U401 USB Interface    U421 USB Interface   U451 USB Interface

Programming:  USBm DLL Programming    Download Files

Application Notes:  U4x1 Application Notes    Misc Applications and Information    FAQ

While every effort has been made to make sure that the information posted on this site is correct, the author can not be held liable for any damages whatsoever for losses as a result of the application of this information. Use this information at your own risk.

USBmicro can design your custom and semi-custom USB product. Email about USB design can be directed to " Robert " at usbmicro.com.

Copyright © USBmicro, L.L.C., 2002-2010

Previous  |  Next ]     [ Up  |  First  |  Last ]     (Article 39 of 126)

This page is created with TreePad