Git Product home page Git Product logo

Comments (12)

parautenbach avatar parautenbach commented on August 25, 2024

I'm having the same issue, but I'm not sure whether I'm doing something wrong. The device is connected and open and I can read data fine. I've tried to open it as overlapped and non-overlapped (for both read and write modes), but to no avail.

Tweakie, have you found the issue?

Mike, is this a valid issue or perhaps due to an incorrect use of the library?

I'm also using version 3.0.0.0 on Windows 7 x64.

from hidlibrary.

parautenbach avatar parautenbach commented on August 25, 2024

Some more info: I've created a GIT clone and upon debugging the test app included in the source, I see it's the native WriteFile method that returns false, but that's about it. Going deeper requires an understanding of the kernel and the debugger cannot provide me with more info.

from hidlibrary.

Tweakie avatar Tweakie commented on August 25, 2024

I think I didn't solve the issue, but I'm not sure . It was more than a
year ago and I didn't have access anymore to the code where I used the
library.

On Wed, May 16, 2012 at 12:19 PM, parautenbach <
[email protected]

wrote:

Some more info: I've created a GIT clone and upon debugging the test app
included in the source, I see it's the native WriteFile method that returns
false, but that's about it. Going deeper requires an understanding of the
kernel and the debugger cannot provide me with more info.


Reply to this email directly or view it on GitHub:
#6 (comment)

from hidlibrary.

parautenbach avatar parautenbach commented on August 25, 2024

Thanks, Tweakie.

from hidlibrary.

parautenbach avatar parautenbach commented on August 25, 2024

I solved my problem: I was writing my data directly from a byte buffer, instead of first creating a report. As a novice, I didn't quite understand input and output reports.

from hidlibrary.

hram avatar hram commented on August 25, 2024

@parautenbach can you help me?
I'v the same error in Win8 x64

from hidlibrary.

parautenbach avatar parautenbach commented on August 25, 2024

@hram: It's a shot in the dark without knowing what type of device you're communicating with, but remember that USB devices are block devices and that you have to write data using the supported block size (chunks). You get it from the device capabilities. Also make a distinction between raw writes and reports. Disclaimer: I'm no expert at USB devices or communication, but do have some background.

from hidlibrary.

hram avatar hram commented on August 25, 2024

@parautenbach I have 2 different libraries. One of them works fine but i realy like source code of this one. I was trying Write(byte[] data) and WriteReport(HidReport report, WriteCallback callback)
and always result is false.
In my case Capabilities.OutputReportByteLength == 65. Whay? I think USB buffer have to be 64 bytes.

from hidlibrary.

parautenbach avatar parautenbach commented on August 25, 2024

Again, you're providing very vague information. What is the other library that works? Isn't it more important to stick what works? All I can say, is that a report length of 65 sounds strange, as it's not a power of 2. But, it sounds like your device wants 65 bytes and you're giving it 64. Without any example code it's impossible to say. You could also compare the binary (hex) raw data created by each library.

You could refer here for some example code :
https://github.com/parautenbach/Build-Lights-Server-and-Client/blob/master/src/WhatsThatLight.Ci.Tools.BuildLights.Client/LightsDeviceController.cs

from hidlibrary.

eried avatar eried commented on August 25, 2024

I am using this library in https://github.com/eried/PrimeComm and my device also returns 65, I have checked with an usb sniffer and it seems the "first" byte is the index%0xFF of the report (I can confirm that the Write works properly).

from hidlibrary.

SaddamBInSyed avatar SaddamBInSyed commented on August 25, 2024

Thanks boss!!!!!!

for to gave rid from my issue

from hidlibrary.

SaddamBInSyed avatar SaddamBInSyed commented on August 25, 2024

one thing some of the card reader device not usually sending the data via data line rather it sending in Control line so in that case,

Don not use WriteFile() funtion to send the data in HID Instead of this you Must use HidD_SetFeature() from hid.dll

Thanks
Saddam

from hidlibrary.

Related Issues (20)

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.