• AVR Freaks

Hot!Multiple HID Device With One Host

Author
kittu
Starting Member
  • Total Posts : 37
  • Reward points : 0
  • Joined: 2009/11/24 02:14:32
  • Location: INDIA
  • Status: offline
2011/04/04 23:08:30 (permalink)
0

Multiple HID Device With One Host

Hello

I am working with PIC18f14k50

I am using the tools are 
1.low pin count board(DVK),
2.application library 2009-Microchip Solutions\USB Device - HID - Custom Demos\Generic HID - Firmware\USB Device - HID - Simple Custom Demo - C18 - Low Pin Count USB Development Kit(firmware
3.Microchip Solutions\USB Device - HID - Custom Demos\Generic HID - Simple Demo - PC Software-(host application)

i am Successfully  implemented the sample code at both end (device & host)


now i want to work with multiple hid devices  with one host





Problem

as we can find hid keyboard & hid mouse on one system & it can also work simultaneousness without any problem 
Bcoz they have the different VID &PID so they suppose to be differentiated on this base. 


i am working with multiple hid devices which have same VID PID ,unique Serial no & different handles  
i want to communicate with devices simultaneousnessly but i can't
i can only communicate with first enumerated device with my system 
as i got the handles of all the enumerated device & i can store it in one structure but i am not able to use this information

i want to know is there any change in USB discripters in firmware 

or

is there any change in application code.

please help me

thanks 
#1

15 Replies Related Threads

    Hartwig
    Starting Member
    • Total Posts : 53
    • Reward points : 0
    • Joined: 2010/05/19 03:57:54
    • Location: 0
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/05 13:54:45 (permalink)
    0
    kittu

    Hello

    I am working with PIC18f14k50

    I am using the tools are 
    1.low pin count board(DVK),
    2.application library 2009-Microchip Solutions\USB Device - HID - Custom Demos\Generic HID - Firmware\USB Device - HID - Simple Custom Demo - C18 - Low Pin Count USB Development Kit(firmware
    3.Microchip Solutions\USB Device - HID - Custom Demos\Generic HID - Simple Demo - PC Software-(host application)

    i am Successfully  implemented the sample code at both end (device & host)


    now i want to work with multiple hid devices  with one host





    Problem

    as we can find hid keyboard & hid mouse on one system & it can also work simultaneousness without any problem 
    Bcoz they have the different VID &PID so they suppose to be differentiated on this base. 


    i am working with multiple hid devices which have same VID PID ,unique Serial no & different handles  
    i want to communicate with devices simultaneousnessly but i can't
    i can only communicate with first enumerated device with my system 
    as i got the handles of all the enumerated device & i can store it in one structure but i am not able to use this information

    i want to know is there any change in USB discripters in firmware 

    or

    is there any change in application code.

    please help me

    thanks 


    During enumeration a USB device gets an address assigned, that will be to address communication between the Host and the device. Each USB device gets its own address assigned. For example the device that gets enumerated first, gets address=0 assigned, the next enumerated device gets address=1, the next gets address=2, etc...
    If you have a handle on the addresses, you should be able to tell your PC app how to address and talk to each device. VID/PID might be used to determine which driver to use for communication. So if you have a bunch of identical devices, they all will use the same driver, of course.
    That's just a very general explanatory approach, I know, but the address might be what you need to look for.
    Cheers,
    Hartwig
    #2
    Hartwig
    Starting Member
    • Total Posts : 53
    • Reward points : 0
    • Joined: 2010/05/19 03:57:54
    • Location: 0
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/05 13:59:02 (permalink)
    0
    ps: the Host (PC in your case) assigns the address to the device during enumeration. Therefore it's your PC application which needs to be modified to get a grip on the address of each device.
    #3
    yts
    Super Member
    • Total Posts : 583
    • Reward points : 0
    • Joined: 2005/09/06 17:45:30
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/05 19:24:33 (permalink)
    0
    Hellow kittu;

    I am very interested in writing an application program for PC.

    I have just learned that there are two types in case of 2(or more)-HID device. Which device do you use?

    1.    Multiple top-level collection device:  2 report IDs and 1 interface.
    Within my knowledge, you can use the application software that Michrochip distributes by reading /writing 65 (not 64) Bytes. The first Byte is for the Reoprt ID (you can set 1 or 2) by which you can distinguish 2 HID data.

    2.    Composite device: no report ID and 2 interfaces
    The interface number (0 or 1) should be obtained in this case, I guess. However, I do not know how we can get the number in the application program. I hope that someone teaches us how.

    post edited by yts - 2011/04/05 20:45:35
    #4
    kittu
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2009/11/24 02:14:32
    • Location: INDIA
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/06 04:51:32 (permalink)
    0
    pink
    #5
    chinzei
    Super Member
    • Total Posts : 2250
    • Reward points : 0
    • Joined: 2003/11/07 12:39:02
    • Location: Tokyo, Japan
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/06 10:57:28 (permalink)
    0
    kittu:

    i am working with multiple hid devices which have same VID PID ,unique Serial no & different handles
    ...
    i can only communicate with first enumerated device with my system

    Sound like you got different handles which point the same device.
    To get all devices, modify the PC app code as follows.

     
    C:\Microchip Solutions v2010-10-19\USB Device - HID - Custom Demos\Generic HID - Simple Demo - PC Software\Microsoft Visual C++ 2005 Express\Form1.h

        #define HID_MAXHANDLE  2

        DWORD HidNumHandles = 0;
        HANDLE WriteHandle[ HID_MAXHANDLE ];  //Need to get a write "handle" to our device before we can write to it.
        HANDLE ReadHandle[ HID_MAXHANDLE ];   //Need to get a read "handle" to our device before we can read from it.



        private: System::Void Connect_btn_Click(System::Object^  sender, System::EventArgs^  e) {
    //-------------------------------------------------------------------------------------------------------------------------------------------------------------------
    //-------------------------------------------------------BEGIN CUT AND PASTE BLOCK-----------------------------------------------------------------------------------


            //Globally Unique Identifier (GUID) for HID class devices.  Windows uses GUIDs to identify things.
            GUID InterfaceClassGuid = {0x4d1e55b2, 0xf16f, 0x11cf, 0x88, 0xcb, 0x00, 0x11, 0x11, 0x00, 0x00, 0x30};

            HDEVINFO DeviceInfoTable = INVALID_HANDLE_VALUE;
            PSP_DEVICE_INTERFACE_DATA InterfaceDataStructure = new SP_DEVICE_INTERFACE_DATA;
            PSP_DEVICE_INTERFACE_DETAIL_DATA DetailedInterfaceDataStructure = new SP_DEVICE_INTERFACE_DETAIL_DATA;
            SP_DEVINFO_DATA DevInfoData;

            DWORD InterfaceIndex = 0;
            DWORD StatusLastError = 0;
            DWORD dwRegType;
            DWORD dwRegSize;
            DWORD StructureSize = 0;
            PBYTE PropertyValueBuffer;
            bool MatchFound = false;
            DWORD ErrorStatus;

            String^ DeviceIDToFind = MY_DEVICE_ID;

    // <-------------------  add these lines, from here
            HidNumHandles = 0;

            for (int i = 0; i < HID_MAXHANDLE; i++)
            {
                WriteHandle[i] = ReadHandle[i] = INVALID_HANDLE_VALUE;
            }
    // <-------------------  to here

            //First populate a list of plugged in devices (by specifying "DIGCF_PRESENT"), which are of the specified class GUID.
            DeviceInfoTable = SetupDiGetClassDevsUM(&InterfaceClassGuid, NULL, NULL, DIGCF_PRESENT | DIGCF_DEVICEINTERFACE);

            //Now look through the list we just populated.  We are trying to see if any of them match our device.
            while(true)
            {
                InterfaceDataStructure->cbSize = sizeof(SP_DEVICE_INTERFACE_DATA);
                if(SetupDiEnumDeviceInterfacesUM(DeviceInfoTable, NULL, &InterfaceClassGuid, InterfaceIndex, InterfaceDataStructure))
                {
                    ErrorStatus = GetLastError();
                    if(ERROR_NO_MORE_ITEMS == ErrorStatus)  //Did we reach the end of the list of matching devices in the DeviceInfoTable?
                    {   //Cound not find the device.  Must not have been attached.
                        SetupDiDestroyDeviceInfoListUM(DeviceInfoTable);    //Clean up the old structure we no longer need.
                        return;
                    }
                }
                else    //Else some other kind of unknown error ocurred...
                {
                    ErrorStatus = GetLastError();
                    SetupDiDestroyDeviceInfoListUM(DeviceInfoTable);    //Clean up the old structure we no longer need.
                    return;
                }

                //Now retrieve the hardware ID from the registry.  The hardware ID contains the VID and PID, which we will then
                //check to see if it is the correct device or not.

                //Initialize an appropriate SP_DEVINFO_DATA structure.  We need this structure for SetupDiGetDeviceRegistryProperty().
                DevInfoData.cbSize = sizeof(SP_DEVINFO_DATA);
                SetupDiEnumDeviceInfoUM(DeviceInfoTable, InterfaceIndex, &DevInfoData);

                //First query for the size of the hardware ID, so we can know how big a buffer to allocate for the data.
                SetupDiGetDeviceRegistryPropertyUM(DeviceInfoTable, &DevInfoData, SPDRP_HARDWAREID, &dwRegType, NULL, 0, &dwRegSize);

                //Allocate a buffer for the hardware ID.
                PropertyValueBuffer = (BYTE *) malloc (dwRegSize);
                if(PropertyValueBuffer == NULL) //if null, error, couldn't allocate enough memory
                {   //Can't really recover from this situation, just exit instead.
                    SetupDiDestroyDeviceInfoListUM(DeviceInfoTable);    //Clean up the old structure we no longer need.
                    return;
                }

                //Retrieve the hardware IDs for the current device we are looking at.  PropertyValueBuffer gets filled with a
                //REG_MULTI_SZ (array of null terminated strings).  To find a device, we only care about the very first string in the
                //buffer, which will be the "device ID".  The device ID is a string which contains the VID and PID, in the example
                //format "Vid_04d8&Pid_003f".
                SetupDiGetDeviceRegistryPropertyUM(DeviceInfoTable, &DevInfoData, SPDRP_HARDWAREID, &dwRegType, PropertyValueBuffer, dwRegSize, NULL);

                //Now check if the first string in the hardware ID matches the device ID of my USB device.
                #ifdef UNICODE
                String^ DeviceIDFromRegistry = gcnew String((wchar_t *)PropertyValueBuffer);
                #else
                String^ DeviceIDFromRegistry = gcnew String((char *)PropertyValueBuffer);
                #endif

                free(PropertyValueBuffer);      //No longer need the PropertyValueBuffer, free the memory to prevent potential memory leaks

                //Convert both strings to lower case.  This makes the code more robust/portable accross OS Versions
                DeviceIDFromRegistry = DeviceIDFromRegistry->ToLowerInvariant();
                DeviceIDToFind = DeviceIDToFind->ToLowerInvariant();
                //Now check if the hardware ID we are looking at contains the correct VID/PID
                MatchFound = DeviceIDFromRegistry->Contains(DeviceIDToFind);
                if(MatchFound == true)
                {
                    //Device must have been found.  Open read and write handles.  In order to do this, we will need the actual device path first.
                    //We can get the path by calling SetupDiGetDeviceInterfaceDetail(), however, we have to call this function twice:  The first
                    //time to get the size of the required structure/buffer to hold the detailed interface data, then a second time to actually
                    //get the structure (after we have allocated enough memory for the structure.)
                    DetailedInterfaceDataStructure->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
                    //First call populates "StructureSize" with the correct value
                    SetupDiGetDeviceInterfaceDetailUM(DeviceInfoTable, InterfaceDataStructure, NULL, NULL, &StructureSize, NULL);
                    DetailedInterfaceDataStructure = (PSP_DEVICE_INTERFACE_DETAIL_DATA)(malloc(StructureSize));     //Allocate enough memory
                    if(DetailedInterfaceDataStructure == NULL)  //if null, error, couldn't allocate enough memory
                    {   //Can't really recover from this situation, just exit instead.
                        SetupDiDestroyDeviceInfoListUM(DeviceInfoTable);    //Clean up the old structure we no longer need.
                        return;
                    }
                    DetailedInterfaceDataStructure->cbSize = sizeof(SP_DEVICE_INTERFACE_DETAIL_DATA);
                     //Now call SetupDiGetDeviceInterfaceDetail() a second time to receive the goods.
                    SetupDiGetDeviceInterfaceDetailUM(DeviceInfoTable, InterfaceDataStructure, DetailedInterfaceDataStructure, StructureSize, NULL, NULL);

                    //We now have the proper device path, and we can finally open read and write handles to the device.
                    //We store the handles in the global variables "WriteHandle" and "ReadHandle", which we will use later to actually communicate.

    // <-------------------  modify this line
    //              WriteHandle = CreateFile((DetailedInterfaceDataStructure->DevicePath), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
                    WriteHandle[ HidNumHandles ] = CreateFile((DetailedInterfaceDataStructure->DevicePath), GENERIC_WRITE, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);

                    ErrorStatus = GetLastError();
                    if(ErrorStatus == ERROR_SUCCESS)
                        ToggleLED_btn->Enabled = true;              //Make button no longer greyed out

    // <-------------------  modify this line
    //              ReadHandle = CreateFile((DetailedInterfaceDataStructure->DevicePath), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);
                    ReadHandle[ HidNumHandles ] = CreateFile((DetailedInterfaceDataStructure->DevicePath), GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0, 0);

                    ErrorStatus = GetLastError();
                    if(ErrorStatus == ERROR_SUCCESS)
                    {
                        GetPushbuttonState_btn->Enabled = true;     //Make button no longer greyed out
                        StateLabel->Enabled = true;                 //Make label no longer greyed out
                    }

    // <-------------------  add these lines, from here
                    if ( ++HidNumHandles >= HID_MAXHANDLE )
                    {
    // <-------------------  to here

                        SetupDiDestroyDeviceInfoListUM(DeviceInfoTable);    //Clean up the old structure we no longer need.
                        return;

    // <-------------------  add this lines
                    }

                }

                InterfaceIndex++;
                //Keep looping until we either find a device with matching VID and PID, or until we run out of items.
            }//end of while(true)
    //-------------------------------------------------------END CUT AND PASTE BLOCK-------------------------------------------------------------------------------------
    //-------------------------------------------------------------------------------------------------------------------------------------------------------------------
                 }


    Tsuneo
    post edited by chinzei - 2011/04/06 19:26:35
    #6
    chinzei
    Super Member
    • Total Posts : 2250
    • Reward points : 0
    • Joined: 2003/11/07 12:39:02
    • Location: Tokyo, Japan
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/06 11:16:51 (permalink)
    0
    yts:

    1.    Multiple top-level collection device:  2 report IDs and 1 interface.
    Within my knowledge, you can use the application software that Michrochip distributes by reading /writing 65 (not 64) Bytes. The first Byte is for the Reoprt ID (you can set 1 or 2) by which you can distinguish 2 HID data.

    2.    Composite device: no report ID and 2 interfaces
    The interface number (0 or 1) should be obtained in this case, I guess. However, I do not know how we can get the number in the application program. I hope that someone teaches us how.

    For multiple Top-Level Collection (TLC),
    HID class driver assigns a separate HID device to each TLC.
    PC app sees as many numbers of HID device as the number of TLCs.

    For Composite device,
    Composite parent driver assigns separate device to each interface.
    PC app sees as many numbers of HID device as the number of HID interfaces on the device.

    This MSDN page describes the Hardware ID for these cases.

    HIDClass Hardware IDs for Top-Level Collections
    http://msdn.microsoft.com...8842%28v=VS.85%29.aspx

    Modification of above post catches all devices in both cases, too.

    Tsuneo
    #7
    yts
    Super Member
    • Total Posts : 583
    • Reward points : 0
    • Joined: 2005/09/06 17:45:30
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/06 17:39:59 (permalink)
    0
    Thank you very much for your explanations, Tsuneo.

    The devises with a specific PID/VID are scanned to get their read/write handles.
    Does the first handle always correspond to “interfece #0” or “report ID #1”?

    YTS
    #8
    yts
    Super Member
    • Total Posts : 583
    • Reward points : 0
    • Joined: 2005/09/06 17:45:30
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/06 18:13:52 (permalink)
    0
    I can confirm that DetailedInterfaceDataStructure has an interface number in case of HID composite devise (at least).

    Thank you again, Tsuneo.

    #9
    chinzei
    Super Member
    • Total Posts : 2250
    • Reward points : 0
    • Joined: 2003/11/07 12:39:02
    • Location: Tokyo, Japan
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/07 02:57:05 (permalink)
    0
    Identification of HID device

    To identify a HID device/interface/TLC on Windows application, these methods are available.

    a) VID/PID
    When multiple HID devices on the bus have different VID/PID each other, the devices are identified by VID/PID.
    - When the PC application knows the target VID/PID, SetupDiGetClassDevs() is called specifying this VID/PID.

    - When the app lists up all HID devices,
    HidD_GetAttributes() returns HIDD_ATTRIBUTES structure, which holds VID/PID.
    HidD_GetManufacturerString() and HidD_GetProductString() may also be useful.


    b) Serial number
    HidD_GetSerialNumberString() returns serial number, if the device has serial number. This API returns port location ID, for a HID device of no serial number.

    - Unique serial number
    When multiple HID devices of the same VID/PID are attached on the bus, serial number identifies the HID device. On the device firmware, serial number is given by the index of string descriptor assigned on the device descriptor. To identify each device, serial number (ie. the contents of the string descriptor) should be unique for each device.

    /* Device Descriptor */  
    ROM USB_DEVICE_DESCRIPTOR device_dsc=
    {
        0x12,    // Size of this descriptor in bytes
        USB_DESCRIPTOR_DEVICE,                // DEVICE descriptor type
        0x0200,                 // USB Spec Release Number in BCD format
        0x00,                   // Class Code
        0x00,                   // Subclass code
        0x00,                   // Protocol code
        USB_EP0_BUFF_SIZE,          // Max packet size for EP0, see usb_config.h
        0x04D8,                 // Vendor ID
        0x003F,                 // Product ID: Custom HID demo
        0x0002,                 // Device release number in BCD format
        0x01,                   // Manufacturer string index
        0x02,                   // Product string index
        0x03,                   // Device serial number string index   <--------
        0x01                    // Number of possible configurations
    };

    //Serial number string descriptor
    ROM struct{BYTE bLength;BYTE bDscType;WORD string[4];}sd003={
    sizeof(sd003),USB_DESCRIPTOR_STRING,
    {'0','0','0','1'
    }};

    //Array of string descriptors
    ROM BYTE *ROM USB_SD_Ptr[]=
    {
        (ROM BYTE *ROM)&sd000,
        (ROM BYTE *ROM)&sd001,
        (ROM BYTE *ROM)&sd002,
        (ROM BYTE *ROM)&sd003
    };


    - No serial number
    When any of the device of the same VID/PID doesn't have serial number (ie. the index is 0 on the device descriptor), port location ID identifies the device. Unique port location ID is assigned by Windows to each USB port, including those on hubs.


    c) Hardware ID
    To identify the interface and/or TLC corresponding to a HID device, hardware ID is available.

    This MSDN page describes the format of hardware ID of cases.
    "HIDClass Hardware IDs for Top-Level Collections"
    http://msdn.microsoft.com...y/ff538842(VS.85).aspx

    multiple TLCs
    - HID\Vid_v(4)&Pid_d(4)&Colb(2)

    Composite device
    - HID\Vid_v(4)&Pid_d(4)&MI_z(2)

    Mixture of composite + multi-TLC
    - HID\Vid_v(4)&Pid_d(4)&MI_z(2)&Colb(2)

    Each field on the hardware ID is defined in this MSDN page
    "Hardware ID Field Definitions for Top-Level Collections"
    http://msdn.microsoft.com...y/ff538795(VS.85).aspx

    The definitions of collection number and interface number are,

    b(2) - Collection number (The HID class driver assigns a number to each collection, starting with one, in the order in which the collections are specified in a device's report descriptors.)

    z(2) - Interface number (Only used with USB devices that are enumerated as composite USB devices.)


    To get hardware ID of the device, these SetupDi-APIs are available for the items on the list generated by SetupDiGetClassDevs()

    - SetupDiGetDeviceRegistryProperty( SPDRP_HARDWAREID )
    OR
    - SetupDiGetDeviceInstanceId()


    d) HidD_GetProductString() for interface string

    When interface string is assigned on the HID interface descriptor, HidD_GetProductString() returns this string.
      
        /* Interface Descriptor */
        0x09,//sizeof(USB_INTF_DSC),   // Size of this descriptor in bytes
        USB_DESCRIPTOR_INTERFACE,               // INTERFACE descriptor type
        0,                      // Interface Number
        0,                      // Alternate Setting Number
        2,                      // Number of endpoints in this intf
        HID_INTF,               // Class code
        0,     // Subclass code
        0,     // Protocol code
        4,                      // Interface string index    <--------


    Tsuneo
    post edited by chinzei - 2011/04/07 04:45:27
    #10
    kittu
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2009/11/24 02:14:32
    • Location: INDIA
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/07 04:04:25 (permalink)
    0
    grin


    AS I CHANGE MY APPLICATION  AS STATED ABOVE IT IS WORKING .Smile


     IF I INCREASE THE VALUE OF HID_MAXHANDLE I CAN ACCESS THAT MUCH DEVICES


    so it will work as first come firs serve type


    which device  i  plug first that get the first handle & own words


    in this case shall we not close the handles or they are always open


    i can implementing  some code change 

    so what result i get i will tell u after one day.

    thank you very much.

    & please stay in touch with this forum topic &give updates 

    when i complete this one i have to implement connect button in DLL
    & i call this Dll in my application
    so can you help me on this[?]

    thanks again 

    kittu
    #11
    chinzei
    Super Member
    • Total Posts : 2250
    • Reward points : 0
    • Joined: 2003/11/07 12:39:02
    • Location: Tokyo, Japan
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/07 19:15:08 (permalink)
    0

    Unfortunately, Microchip PC examples don't support multiple HID devices on the same bus. (Maybe, they don't want to sell more PICs Smile
    The modification for multi-device support is simple, as described above. But if you would feel difficulty to re-organize the code, I recommend you to look in these existing libraries. These libraries support multi- HID devices.

    HID API (C/C++)
    http://www.signal11.us/oss/hidapi/

    HidLibrary (.Net)
    https://github.com/mikeobrien/HidLibrary

    CSharp USB HID Driver Library
    http://www.florian-leitne...sb-hid-driver-library/

    Tsuneo
    post edited by chinzei - 2011/04/07 19:20:04
    #12
    yts
    Super Member
    • Total Posts : 583
    • Reward points : 0
    • Joined: 2005/09/06 17:45:30
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/09 01:02:47 (permalink)
    0
    Just for the information:
    I made a PC application software for 2 HID composite device (PIC18F4550). I think that this software can be applied to PIC18f14k50.

    I modified the method that Tsuneo showed us in #6 post and made a class named “Interface” by using VC++ Ver. 6. This class can get read- and write-handles for a specific interface number. When “CInterface aaa(0);” is declared, the write-handle for interface #0 is given by aaa.WriteHandle. Similarly, “CInterface bbb(1);” is declared, the write-handle for interface #1 is given by bbb.WriteHandle. Here the name of instance, “aaa” or “bbb”, is arbitrary.

    When you execute the application software on PC, a dialog window appears with two edit boxes and two buttons. If you write some characters in the upper edit box and push one of button, the characters appear in the lower edit box. You would notice that only first character is changed. If you type “123” in the upper box and push the INT0 button, “223” will appear in the lower box. First character of ‘2’ = ‘1’ +1 in ASCII code. If you push the INT1 button, “323” will appear. First character of ‘2’ = ‘1’ +2 in ASCII code.

    Here is the software for PC.

    #13
    yts
    Super Member
    • Total Posts : 583
    • Reward points : 0
    • Joined: 2005/09/06 17:45:30
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/09 01:04:01 (permalink)
    0
    Here is a firmware for PIC18F4550.
    #14
    kittu
    Starting Member
    • Total Posts : 37
    • Reward points : 0
    • Joined: 2009/11/24 02:14:32
    • Location: INDIA
    • Status: offline
    Re:Multiple HID Device With One Host 2011/04/10 21:53:37 (permalink)
    0
    Hello All,

    firstly thank you to all of you for your support

    i worked out as per your sugeation   & its actually works fine

    i made my own PC based application with reference of post no 5 

    now this application works fine.

    now i want to create a DLL  which i can use in any platform like c#.net,vb.net

    in which i put all the code part present under connect button can put into my API called find Hid.

    now i am working on that .

    i will get back to you soon with working dll 

    Thanks again

    kittu




    post edited by kittu - 2011/04/10 22:09:43
    #15
    sswcharlie
    New Member
    • Total Posts : 3
    • Reward points : 0
    • Joined: 2003/11/07 12:47:49
    • Status: offline
    Re:Multiple HID Device With One Host 2018/11/28 15:08:03 (permalink)
    0
    Hi
     
    Is it possible with multiple HID rfid readers that all have same vid pid, and no serial number, to attach the usb port number to each set of  data (each rfid tag read).  Using Win7  Excel 2016
    That is the unique port location ID that shows in device manager for each port.
     
    Quote from above:
    "- No serial number
    When any of the device of the same VID/PID doesn't have serial number (ie. the index is 0 on the device descriptor), port location ID identifies the device. Unique port location ID is assigned by Windows to each USB port, including those on hubs."
     
    eg  Using HID device, if rfid tag read by port #  05  =      1234567 when received by port # 05 is suffixed (or prefix) with port number and data appearing in Excel is  =     123456705
     
    How do I set this up.  No other requirements apart from suffix.
     
    Thankyou
    Charles Harris
    #16
    Jump to:
    © 2019 APG vNext Commercial Version 4.5