Giter Site home page Giter Site logo

xiao-fang / hid_utility Goto Github PK

View Code? Open in Web Editor NEW

This project forked from soldernerd/hid_utility

0.0 2.0 0.0 282 KB

This open source (GNU GPLv3) project is aimed at simplifying the development of C# applications that communicate with USB HID (Human Interface Device) devices.

Home Page: https://soldernerd.com/2017/02/14/c-usb-hid-utility/

C# 100.00%

hid_utility's Introduction

This open source (GNU GPLv3) project is aimed at simplifying the development of C# applications that communicate with USB HID (Human Interface Device) devices.

There used to be a Microchip HID PnP Demo application that demonstrated how to connect to a HID device from C#.
The demo is designed to work with their USB demo boards such as the "PIC18F46J50 FS USB Demo Board" (see http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=MA180024)
However, that particular application was based on VisualStudio 2010 and .NET framework 2.0 and no longer gets maintained it seems.

This VisualStudio solution was created on VisualStudio Community 2015 (which is free) and .NET framework 4.6. Please be aware that all projects must be compiled with "x86" setting even on a 64bit platform. 
There are 3 projects in this solution:

- A WindowsForm application named HidDemoWindowsForms
- A WPF application named HidDemoWpf
- A Console application named HidDemoConsole

All 3 projects offer very similar functionality. They connect to suitably programmed HID device, read an ADC value and pushbutton state and let you toggle an LED. They also list all available HID devices and notify you when a device is attached or detached.

All the heavy lifting is done in a common file named hid.cs. It can be included in any C# project, no matter if it is based on WPF, WindowsForms or just a console application. It's full of DLL imports, Marshalling and COM API calls. In other words, it's not pretty and it doesn't look much like C# even though it is. You should not need to edit this file or know anything about it. 

hid.cs offers a nice, truely C# interface that lets you communicate to HID devices. Basically all you need to do is to create an instance of HidUtility and subscribe to the events you're interested in. The 3 applications should give you a good starting point.

More information is available on https://soldernerd.com/2017/02/14/c-usb-hid-utility/

Lukas Fässler
soldernerd.com
2017-02-13





hid_utility's People

Contributors

soldernerd avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.