<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Kommunikation mit HID über USB]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich arbeite gerade an einer Kommunikation des PCs mit einem USB-tauglichen Mikrocontroller (PIC16C765). Ich suche vergeblich nach einer Kommunikationsmöglichkeit in Visual C++ 6.0 mit sogenannten &quot;Human Interface Devices&quot; (HID), denn der Chip meldet sich so am PC an. Ich habe schon was mit der Datei hid.dll gehört, mehr weiß und finde ich dazu leider auch nicht.</p>
<p>Bitte helft mir weiter!</p>
<p>Betriebssystem: Win2k<br />
USB: 1.1</p>
<p>mfG<br />
Firestormer</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/62399/kommunikation-mit-hid-über-usb</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 00:34:33 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/62399.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 22 Jan 2004 21:00:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Thu, 22 Jan 2004 21:07:23 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich arbeite gerade an einer Kommunikation des PCs mit einem USB-tauglichen Mikrocontroller (PIC16C765). Ich suche vergeblich nach einer Kommunikationsmöglichkeit in Visual C++ 6.0 mit sogenannten &quot;Human Interface Devices&quot; (HID), denn der Chip meldet sich so am PC an. Ich habe schon was mit der Datei hid.dll gehört, mehr weiß und finde ich dazu leider auch nicht.</p>
<p>Bitte helft mir weiter!</p>
<p>Betriebssystem: Win2k<br />
USB: 1.1</p>
<p>mfG<br />
Firestormer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/442221</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/442221</guid><dc:creator><![CDATA[Firestormer]]></dc:creator><pubDate>Thu, 22 Jan 2004 21:07:23 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Wed, 28 Jan 2004 09:31:46 GMT]]></title><description><![CDATA[<p>Mahlzeit!</p>
<p>Ich mache auch gerade etwas ähnliches mit HIDs. Du brauchst zunächst, um auf Dein HID zugreifen zu können, den Namen für <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/createfile.asp" rel="nofollow">CreateFile</a>, dazu gibt's auch jede Menge Threads hier im Forum. Um dann Daten lesen und schreiben zu können, brauchst Du <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/readfile.asp" rel="nofollow">ReadFile</a> und <a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/fileio/base/writefile.asp" rel="nofollow">WriteFile</a>. Den Namen für CreateFile bekommst Du hiermit:</p>
<pre><code class="language-cpp">#include &lt;stdio.h&gt;
#include &lt;windows.h&gt; 
#include &lt;setupapi.h&gt; 
extern &quot;C&quot; {
#include &lt;hidsdi.h&gt;
}
int main() 
{ 
	PSP_DEVICE_INTERFACE_DETAIL_DATA pspdidd; 
    SP_DEVICE_INTERFACE_DATA         spdid; 
    SP_DEVINFO_DATA                  spdd; 
    HDEVINFO                         hDevInfo; 
    DWORD                            dwIndex, dwSize, dwType; 
    TCHAR                            szProperty[256]; 
    GUID                             guid; 

    ZeroMemory(&amp;spdid, sizeof(spdid)); 
    spdid.cbSize = sizeof(spdid); 
    HidD_GetHidGuid(&amp;guid);
    hDevInfo = SetupDiGetClassDevs(&amp;guid, 
								   NULL, 
								   NULL, 
								   DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);

    if(hDevInfo == INVALID_HANDLE_VALUE) 
    { 
        printf(&quot;SetupDiGetClassDevs failed, Error %u\n&quot;, GetLastError()); 
        return(FALSE); 
    } 

    for(dwIndex = 0; (SetupDiEnumDeviceInterfaces(hDevInfo, 
												  NULL, 
												  &amp;guid, 
												  dwIndex, 
												  &amp;spdid)); dwIndex++) 
    { 
        printf(&quot;Geraete-Index: %u\n\n&quot;, dwIndex); 
        dwSize = 0; 

        SetupDiGetDeviceInterfaceDetail(hDevInfo, 
										&amp;spdid, 
										NULL, 
										0, 
										&amp;dwSize, 
										NULL); 

        if(dwSize) 
        { 
            if(NULL == (pspdidd = (PSP_DEVICE_INTERFACE_DETAIL_DATA)HeapAlloc(GetProcessHeap(), 
																			  HEAP_ZERO_MEMORY, 
																			  dwSize))) 
				continue; 

            pspdidd-&gt;cbSize = sizeof(*pspdidd); 

            ZeroMemory((PVOID)&amp;spdd, sizeof(spdd)); 
            spdd.cbSize = sizeof(spdd); 

            if(SetupDiGetDeviceInterfaceDetail(hDevInfo, 
											   &amp;spdid, 
											   pspdidd, 
											   dwSize, 
											   &amp;dwSize, 
											   &amp;spdd)) 
            { 
                printf(&quot;Name fuer CreateFile(): %s\n\n&quot;, pspdidd-&gt;DevicePath); 
                if(SetupDiGetDeviceRegistryProperty(hDevInfo, 
													&amp;spdd, 
													SPDRP_FRIENDLYNAME, 
													&amp;dwType, 
													(PBYTE)szProperty, 
													sizeof(szProperty), 
													NULL)) 
                { 
                    if(dwType == REG_SZ) 
                    { 
                        printf(&quot;FriendlyName: %s\n\n&quot;, szProperty); 
					} 
                } 
                if(SetupDiGetDeviceRegistryProperty(hDevInfo, 
												    &amp;spdd, 
													SPDRP_DEVICEDESC, 
													&amp;dwType, 
													(PBYTE)szProperty, 
													sizeof(szProperty), 
													NULL)) 
                { 
                    if(dwType == REG_SZ) 
                    { 
                        printf(&quot;DeviceDescription: %s\n\n&quot;, szProperty); 
                    } } } 
            HeapFree(GetProcessHeap(), 0, pspdidd); 
       } } 
    SetupDiDestroyDeviceInfoList(hDevInfo); 
    return(TRUE); 
}
</code></pre>
<p>ähnliche Threads gibt's hier:<br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=54095&amp;start=0" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic.php?t=54095&amp;start=0</a><br />
<a href="http://www.c-plusplus.net/forum/viewtopic.php?t=14977&amp;" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic.php?t=14977&amp;</a></p>
<p>Du darfst aber nicht vergessen, in den Einstellungen</p>
<pre><code>setupapi.lib
hid.lib
</code></pre>
<p>mit zu verlinken.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/445893</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/445893</guid><dc:creator><![CDATA[baschti]]></dc:creator><pubDate>Wed, 28 Jan 2004 09:31:46 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Thu, 29 Jan 2004 10:04:13 GMT]]></title><description><![CDATA[<p>Danke vorerst einmal!</p>
<p>Das hilft mir schon einigermaßen weiter.</p>
<p>Ein Problem das ich noch habe: Brauche ich das Win 2000 DDK?, denn da gibt es so viele include-Dateien die ich nicht habe (hidsdi.h,ntstatus,...usw.)</p>
<p>mfG<br />
Firestormer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/446890</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/446890</guid><dc:creator><![CDATA[Firestormer]]></dc:creator><pubDate>Thu, 29 Jan 2004 10:04:13 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Thu, 29 Jan 2004 10:17:09 GMT]]></title><description><![CDATA[<p>hidsdi.h is ausm ddk falls du die funktionen daraus zwingend brauchst, brauchst du wohl auch das ddk</p>
]]></description><link>https://www.c-plusplus.net/forum/post/446895</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/446895</guid><dc:creator><![CDATA[Sovok]]></dc:creator><pubDate>Thu, 29 Jan 2004 10:17:09 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Thu, 29 Jan 2004 10:34:12 GMT]]></title><description><![CDATA[<p>Mahlzeit!<br />
Ja, das DDK brauchst Du. In dem Prog was ich Dir gepostet habe, sind schon Libs bzw. Header mit dabei. Leider will Microsoft Kohle dafür sehen, zwar nicht für das DDK selber, aber dafür satte 25$ Versandkosten.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/446908</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/446908</guid><dc:creator><![CDATA[baschti]]></dc:creator><pubDate>Thu, 29 Jan 2004 10:34:12 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Thu, 29 Jan 2004 10:48:46 GMT]]></title><description><![CDATA[<p>hast du zufällig die url der bestellseite?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/446913</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/446913</guid><dc:creator><![CDATA[Sovok]]></dc:creator><pubDate>Thu, 29 Jan 2004 10:48:46 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Thu, 29 Jan 2004 10:56:14 GMT]]></title><description><![CDATA[<p>Danke!<br />
Bestelladresse fürs DDK:</p>
<p><a href="http://www.microsoft.com/whdc/ddk/winddk.mspx" rel="nofollow">http://www.microsoft.com/whdc/ddk/winddk.mspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/446917</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/446917</guid><dc:creator><![CDATA[Firestormer]]></dc:creator><pubDate>Thu, 29 Jan 2004 10:56:14 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Thu, 29 Jan 2004 12:05:03 GMT]]></title><description><![CDATA[<p>Nicht schlagen *duck*<br />
Du könntest es ja mal bei der Tauschbörse deiner Wahl versuchen (weiß aber nicht ob das legal ist).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/446964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/446964</guid><dc:creator><![CDATA[musicman]]></dc:creator><pubDate>Thu, 29 Jan 2004 12:05:03 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Wed, 18 Oct 2006 10:47:36 GMT]]></title><description><![CDATA[<p>ich hab jetzt mal 2 jahre danach dieses skript verwendet und ... tadaaaa ... es geht. hab jetzt nur noch ne kurze frage:</p>
<p>ich gebe die ergebnisse auch über ein printf aus (so wie im bsp), bekomm aber nur den ersten buchstaben des wortes zurück ... habe vc++ 2005. liegt wohl am wide char. Wie kann ich das trotzdem ausgeben ?</p>
<p>grüße Nils</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156955</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156955</guid><dc:creator><![CDATA[Nils_langner]]></dc:creator><pubDate>Wed, 18 Oct 2006 10:47:36 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Wed, 18 Oct 2006 10:55:45 GMT]]></title><description><![CDATA[<p>Nimm die UNICODE-Version von printf() - wprintf()</p>
<p>(oder, wenn du sowohl mit ANSI als auch mit UNICODE zurechtkommen willst: _tprintf())</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1156967</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1156967</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Wed, 18 Oct 2006 10:55:45 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Fri, 25 Oct 2013 08:30:47 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>ich würde gerne die Funktion HidD_GetHidGuid benutzen. Doch leider bringt mir der linker folgenden Fehler:</p>
<p>1&gt;KBUSB.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;&quot;void __stdcall HidD_GetHidGuid(struct _GUID *)&quot; (?HidD_GetHidGuid@@YGXPAU_GUID@@@Z)&quot; in Funktion &quot;&quot;unsigned char __cdecl CreateListOfDevices(void)&quot; (?CreateListOfDevices@@YAEXZ)&quot;.</p>
<p>ich habe das header file hid.h eingebunden, die hid.lib bei den liberies unter einstellungen linker hinzugefügt und das verzeichnis wo diese liegt (ddk verzeichnis) bei zusätzliche Bibliotheksverzeichnisse eingefügt</p>
<p>habe ich noch was vergessen?</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1291449</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1291449</guid><dc:creator><![CDATA[maikhaenig]]></dc:creator><pubDate>Fri, 25 Oct 2013 08:30:47 GMT</pubDate></item><item><title><![CDATA[Reply to Kommunikation mit HID über USB on Mon, 24 Sep 2007 07:32:35 GMT]]></title><description><![CDATA[<p>Hallo ich bin seit einiger Zeit drüber eine eigene USB-Firmware für<br />
einen AT90USB162 zu schreiben.</p>
<p>Nach dem ich jetzt endlich das Gerät richtig in Windows als HID-Tastatur<br />
erkannt habe wollte ich nun die ersten Kommunikationsversuche mit dem<br />
Host starten. Dafür wollte ich mir eine kleine C Application schreiben und dabei bin ich auf den Thread hier gestoßen. Die Erkennung des Gerätes klappt soweit auch gut.</p>
<p>Soweit so gut:<br />
Das Problem ist wenn ich HidP_GetCaps aufrufe stürtzt mein Programm<br />
jedesmal mit dem Fehler hidparse.sys konnte nicht gefunden werden.</p>
<p>Jetzt ist die Datei aber im richtigen verzeichniss und auch vorhanden.<br />
Die richtigen Bibiliotheken müsste ich auch eingebunden haben sonst<br />
könnte ich es ja nicht compelieren.</p>
<p>Jemand eine idee an was das liegen könnte</p>
<p>hier mal der C-Code</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;ddk/hidsdi.h&gt;
#include &lt;ddk/hidpi.h&gt;
#include &lt;ddk/hidusage.h&gt;
#include &lt;setupapi.h&gt;

int main()
{
    PSP_DEVICE_INTERFACE_DETAIL_DATA pspdidd;
    SP_DEVICE_INTERFACE_DATA         spdid;
    SP_DEVINFO_DATA                  spdd;
    HDEVINFO                         hDevInfo;
    DWORD                            dwIndex, dwSize, dwType;
    TCHAR                            szProperty[256];
    GUID                             guid;
    HANDLE                           DeviceHandle;
    HIDD_ATTRIBUTES                  Attributes;
    PHIDP_PREPARSED_DATA             PreparsedData;
    HIDP_CAPS                        Capabilities;

    ZeroMemory(&amp;spdid, sizeof(spdid));
    spdid.cbSize = sizeof(spdid);
    HidD_GetHidGuid(&amp;guid);
    hDevInfo = SetupDiGetClassDevs(&amp;guid,NULL,NULL,DIGCF_DEVICEINTERFACE | DIGCF_PRESENT);

    if(hDevInfo == INVALID_HANDLE_VALUE)
    {
        printf(&quot;SetupDiGetClassDevs failed, Error %u\n&quot;, GetLastError());
        return(FALSE);
    }

    for(dwIndex = 0; (SetupDiEnumDeviceInterfaces(hDevInfo,NULL,&amp;guid,dwIndex,&amp;spdid)); dwIndex++)
    {
        printf(&quot;Geraete-Index: %u\n&quot;, dwIndex);
        dwSize = 0;

        SetupDiGetDeviceInterfaceDetail(hDevInfo,&amp;spdid,NULL,0,&amp;dwSize,NULL);

        if(dwSize)
        {
            if(NULL == (pspdidd = (PSP_DEVICE_INTERFACE_DETAIL_DATA)HeapAlloc(GetProcessHeap(),HEAP_ZERO_MEMORY,dwSize)))
                continue;

            pspdidd-&gt;cbSize = sizeof(*pspdidd);

            ZeroMemory((PVOID)&amp;spdd, sizeof(spdd));
            spdd.cbSize = sizeof(spdd);

            if(SetupDiGetDeviceInterfaceDetail(hDevInfo,&amp;spdid,pspdidd,dwSize,&amp;dwSize,&amp;spdd))
            {
                printf(&quot;Name fuer CreateFile(): %s\n&quot;, pspdidd-&gt;DevicePath);

                if(SetupDiGetDeviceRegistryProperty(hDevInfo,&amp;spdd,SPDRP_FRIENDLYNAME,&amp;dwType,(PBYTE)szProperty,sizeof(szProperty),NULL))
                {
                    if(dwType == REG_SZ)
                        printf(&quot;FriendlyName: %s\n&quot;, szProperty);
                }
                if(SetupDiGetDeviceRegistryProperty(hDevInfo,&amp;spdd,SPDRP_DEVICEDESC,&amp;dwType,(PBYTE)szProperty,sizeof(szProperty),NULL))
                {
                    if(dwType == REG_SZ)
                        printf(&quot;DeviceDescription: %s\n\n&quot;, szProperty);
                }
            }
            HeapFree(GetProcessHeap(), 0, pspdidd);
        }
        if((strstr(pspdidd-&gt;DevicePath, &quot;hid#vid_03eb&amp;pid_201c#6&amp;1cdb5d6c&amp;0&amp;0000#{4d1e55b2-f16f-11cf-88cb-001111000030}&quot;)) != NULL)
            break;
    }
    SetupDiDestroyDeviceInfoList(hDevInfo);
    DeviceHandle = CreateFile(pspdidd-&gt;DevicePath,GENERIC_READ,FILE_SHARE_READ,(LPSECURITY_ATTRIBUTES)NULL,OPEN_EXISTING,0,NULL);
    HidD_GetAttributes(DeviceHandle,&amp;Attributes);
 //   printf(&quot;\nVendorID : %X&quot;,Attributes.VendorID);
 //   printf(&quot;\nProductID: %X&quot;,Attributes.ProductID);
 //   printf(&quot;\nVersion  : %X&quot;,Attributes.VersionNumber);
    HidD_GetPreparsedData(DeviceHandle,&amp;PreparsedData);
    HidP_GetCaps(PreparsedData,&amp;Capabilities);

    return(0);
}
</code></pre>
<p>gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1371355</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1371355</guid><dc:creator><![CDATA[Neo120484]]></dc:creator><pubDate>Mon, 24 Sep 2007 07:32:35 GMT</pubDate></item></channel></rss>