Comments (12)
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.
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.
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.
Thanks, Tweakie.
from hidlibrary.
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.
@parautenbach can you help me?
I'v the same error in Win8 x64
from hidlibrary.
@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.
@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.
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.
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.
Thanks boss!!!!!!
for to gave rid from my issue
from hidlibrary.
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)
- Data just contains 0's HOT 3
- LIbrary methods don't see connected devices HOT 1
- Only Receiving the Second HID Report from 2D Barcode Scanner HOT 1
- Read(timeout) stuck when no data from device HOT 1
- A number of issues with the overlapped I/O code: do we need it? HOT 10
- Reading multiple reports (USB-HID-KBE) HOT 1
- Trying to read report HOT 4
- UsagePage and Usage should be ushort HOT 1
- I cannot read from buffer asynchronously HOT 1
- Linux OS dll load exception on .Net5.0 linux-x64 build HOT 1
- Operation is not supported on this platform Errors in .Net Standard 2.1 or Greater HOT 4
- NuGet package update ? HOT 2
- Friendly name HOT 1
- Reading functions hangs indefinitely. HOT 1
- CloseDevice() function causing the application to hang HOT 1
- How do I get hid keyboard information HOT 1
- Composite HID device, how to get the right interface?
- Pls helb. Error in output data from device
- Data contain only 0
- Hello, do you support.net6.0?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hidlibrary.