Home > Software engineering >  MFC read data via USB
MFC read data via USB

Time:09-26

Use libusb - win32 read USB data, USB data can be read, but not stability, will disconnect USB. Use bushound monitoring, appear C0000030 (endpoint HALTED) error, what reason be excuse me

CodePudding user response:

Daniel to......

CodePudding user response:

Collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

One way to check whether resource leaks:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

Search "GDI leak detection"

CodePudding user response:

refer to the second floor zhao4zhong1 response:
collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

One way to check whether resource leaks:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

Search "GDI leak detection"


refer to the second floor zhao4zhong1 response:
collapsed in the pop-up dialog box, press the corresponding button to enter debugging press Alt + 7 key to view the Call Stack, namely "the Call Stack" from the inside to the following out of from the inner to outer function Call history, double-click a row to the cursor to the Call of the source code or assembly instruction, don't understand when double click on the next line, until we can read ,

One way to check whether resource leaks:
In the process of the task manager to see inside the column selection: memory, virtual memory size, handle number, number of threads, the USER object, GDI objects
Make your program (process) don't quit, cycle through main process many times, the more the better, like 1000000 times or even an infinite loop, record the above numerical, it through at least one hour, as long as possible, such as a month, to record more than the value, if the above two groups of numerical differential is bigger or increasing over time, will certainly have a corresponding resources resource leaks!

Search "GDI leak detection"


Software is not dead, detect USB disconnect

CodePudding user response:

Didn't make this stuff, don't understand, help you up

Can try to see if a wrong number or what events, whether or not there will be a disconnect reason, first to determine the usb device is disconnected, or Windows broken, or is accidentally disconnected

CodePudding user response:

USB disconnect, because is physical disconnection (such as USB line quality problems or poor contact USB port), it is you want to be the exception handling.
If it is a USB driver is not stable, that is about to find driver.

CodePudding user response:

The
reference 4 floor JSZJ reply:
didn't make this stuff, do not understand, help you up

Can try to see if a wrong number or what events, whether or not there will be a disconnect reason, first to determine the usb device is disconnected, or Windows broken, or is accidentally disconnected


This is very difficult to determine, in the process of constantly reading data, the USB connection is not on, use bushound monitoring, appear C0000012 and C0000030 errors

CodePudding user response:

reference 5 floor xiaohuh421 reply:
USB disconnect, because is really physical disconnection quality problem (such as USB cable or USB port poor contact), that is you want to be the exception handling.
If the USB driver is not stable, it will be looking for a driver problem.


The key is bad to determine drive or hardware problem

CodePudding user response:

http://blog.chinaunix.net/uid-29345848-id-4389994.html
http://blog.csdn.net/rayna00/article/details/51555486
Both the content of the post is the same, you can refer to the instructions, may help

CodePudding user response:

The posts above, "" babble" mistake. "a babble" error occurs when the endpoint to accept more data than the endpoint of the specific maximum packet size. Has sent more than setting the maximum message length ", from this description, it should be a message format is not do well, this is usb device sends a message to see the size is wrong, or the Windows to the usb device sends the wrong message

CodePudding user response:

references 9 f JSZJ response:
the posts above, "" babble" mistake. "a babble" error occurs when the endpoint to accept more data than the endpoint of a specific maximum packet size. Has sent more than setting the maximum message length ", from this description, it should be a message format is not do well, this is to look at the usb devices send message size is wrong, or the Windows to the usb device sends the wrong message


A "babble" error occurs when the endpoint to accept more data than the endpoint of a specific maximum packet size. Has sent more than set the maximum message length,
The meaning of this sentence is the endpoint cache is full of lead to this error

CodePudding user response:

Hardware problem well test.
Only need to change a few computer, in a few USB line, in a few of your USB device.
If have the same problem, is you use the driver problem,

If your driver is the system's own, so that is the problem that you use the USB reading library.

If you use the USB reading library, also can be sure there is no problem. That is your own use and configuration problems.

CodePudding user response:

references to the tenth floor sparrow429 response:
Quote: references 9 f JSZJ response:

The posts above, "" babble" mistake. "a babble" error occurs when the endpoint to accept more data than the endpoint of the specific maximum packet size. Has sent more than setting the maximum message length ", from this description, it should be a message format is not do well, this is usb device sends a message to see the size is wrong, or the Windows to the usb device sends the wrong message


A "babble" error occurs when the endpoint to accept more data than the endpoint of a specific maximum packet size. Has sent more than set the maximum message length,
Endpoint cache is full of the meaning of this sentence is causing the error?

This is a clue, there are four kinds of circumstances:
1. Usb devices send message there is something wrong with the set of packages
2. Windows client sends the message there is something wrong with the set of packages
3. The problem of usb device receiving message has
4. There is something wrong with the Windows client receives the message
To receive, may involve memory size, such as the allocated memory is too small, and the size of the message over its cause an exception occurs,
But to understand from the description, I prefer the former two cases

CodePudding user response:

Don't know what you are using USB devices,
Whether can rule out first is a hardware problem, general USB chip will have the SDK, you can burn a loopback firmware, then use the PC application test in the SDK,
If OK, it's a software problem (problem is to distinguish between upper machine or firmware), if there is a problem to solve the problem of hardware

CodePudding user response:

11 references xiaohuh421 response:
hardware problem well test.
Only need to change a few computer, in a few USB line, in a few of your USB device.
If have the same problem, is you use the driver problem,

If your driver is the system's own, so that is the problem that you use the USB reading library.

If you use the USB reading library, also can be sure there is no problem. That is your own use and configuration problems.


Library should be no problem, use is libusb, I doubt is hardware problem, but don't know how to test,

CodePudding user response:

Hardware problem well test.
Only need to change a few computer, in a few USB line, in a few of your USB devices.nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related