Author Topic: How to write data with HID  (Read 6827 times)

TRudolphi

  • Newbie
  • *
  • Posts: 2
    • View Profile
How to write data with HID
« on: October 03, 2008, 03:24:56 pm »
I have the Demo version of nrComm and want to read / write data to my PIC
HID device. I tried with success the hiddemo example but I cannot figure out
how to write data to my PIC circuit. :'(

Could you give an example how to write some data?

Thanks

Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: How to write data with HID
« Reply #1 on: October 03, 2008, 04:56:53 pm »
Hello

You can use the following method:

TnrHID.WriteReport(Buffer, Sz);

where Buffer is pointer to byte array and Sz is size of this array.
The first byte of array should contain the ID of report.

Roman Novgorodov
DeepSoftware.Com
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.

Microvision

  • Newbie
  • *
  • Posts: 1
    • View Profile
Re: How to write data with HID
« Reply #2 on: October 10, 2008, 10:39:11 pm »
First of all thanks to Roman Novgorodov for the good work on nrComm Lib, keep up the god spirit!

I'm planning on using the nrComm Lib in an borland or CodeGear application using USB communication with a USB HID device.
In my seatrch on the web I have found the following helpful links:

Info on USB (and HID):
The reference: http://www.lvr.com/hidpage.htm
The overview: http://www.usbmadesimple.co.uk/index.html

Info on a hardware USB HID device (including source C code):
As USB HID device I’m using: Keil MCBSTM32 evaluation board, for info: http://www.keil.com/arm/mcbstm32/
I run the Keil MCBSTM32 HID demo firmware on the evaluation board, for info: http://www.keil.com/download/docs/361.asp 

Info on a PC (Win XP, CodeGear C++) HID client application:
Take a look at the source code:
Project: usbhidioc.cpp
Version: 2.0
Date: 12/20/00
by Jan Axelson (jan@lvr.com)
It can be found at:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1960 or http://www.lvr.com/files/
Some of the early releases are written for Borland C++ Version 6 and some later releases for Visual C++

For testing and sniffing your USB client app. take a look at: http://www.lvr.com/hidpage.htm and look for the work of: Robert Marquardt (HIDTEST (including source (Delphi)) and SimpleHIDWrite).

I thing the learning curve for USB is a little step but after a couple of days of hard work I begin to see the light.

Good luck coding

Cheers
Microvision


Roman Novgorodov

  • Engineer
  • Administrator
  • Hero Member
  • *****
  • Posts: 994
  • we will win
    • View Profile
    • Forums.nrCommLib.Com
Re: How to write data with HID
« Reply #3 on: October 11, 2008, 05:39:13 pm »
Hello

Thank you for detail information.
We are using MSDN and DDK information in our job generally.
I hope it will be useful for us and all guys who develop the HID solutions.

And thanks for warm words :-)

Roman
DeepSoftware llc - The professional components for Delphi/CBuilder/.NET. The high quality custom software development.
Forums.nrCommLib.Com - DeepSoftware Tech Support Forum.