Comms refactor (prerequisite of libproxmark work)#371
Comms refactor (prerequisite of libproxmark work)#371pwpiwi merged 2 commits intoProxmark:masterfrom
Conversation
|
This is currently blocking me from doing further work on libproxmark and porting Proxmark to Android. Aside from the merge conflicts, are there any outstanding issues with the style of this PR? |
|
Yes, it unnecessarily moves unrelated global variables to files where you never would expect them. Can't we have the comms refactoring only with this PR? |
|
Part of the challenge of this porting work is that there are global variables in the first place. It makes it very difficult to isolate the client into a library at all, because I need to be able to entirely reconfigure the PM3 client's context without restarting the entire binary. The point of moving them all into one file is that in the next stage, they'll be wrapped up into a They need to be all declared exactly once, and right now they're declared multiple times depending on if you're using a GUI build of PM3 or not, and if you're using the GUI application or not. I have concerns that there are latent bugs in the existing implementation. I'm going to skip the globals shuffling for now, and move that straight into passing a context struct around. However, it will make the context struct PR larger, and I suspect this debate will reopen. |
0ec3dcf to
dcd394e
Compare
|
Please take a look at dcd394e. |
|
On Ubuntu 14.04.5 LTS I get Should be fixed. |
|
If I am not mistaken, most of the "globals" in 'comms_globals.h` can be made static. |
Fixed
They could (and I'm aware what I'm doing now is a hack), however this would mean that the code would need to be repeated across the different contexts that |
|
I am still not sure where this will end and I don't think that the discussion with the other maintainers really came to an end already. Therefore please don't assume this to be an "intermediate" PR. I would like to accept it because the refactoring makes sense. But not with a separate |
|
You can't have a |
|
Good! On which platforms did you test? |
|
|
Tested on Kali and Windows 10. Runs fine on Kali, on Windows however there is an issue. When running |
|
My humble tests of parts of this changes has left me with a somewhat dying client after a while. |
I tried to repro this on Linux, and couldn't. I note you're on a slightly different firmware, and this probably shouldn't have any impact, but I would feel more assured if you were on exactly the same firmware. I tried to run with gator91600's binaries (without my modifications, specifically this build), in a virtual machine running Windows 7. Using USB based sharing to the guest in VirtualBox, I was unable to even get the client to even connect to my PM3. The client just reports "invalid serial port" and then Windows reports I also tried sharing to the Windows guest as a serial port (rather than USB device), again running gator91600's binaries, and saw the "USB Speed Test timed out" message you did when running I suspect there may be something else at play which causes this issue, but I'm also not able to reproduce this command actually working properly on a mainline client on Windows. If you can be very certain that you're not able to reproduce the same symptoms on Windows without my patches, I will have a go at getting a real Windows environment running and some cross-compiler for it. But that is a huge time investment. This should also be documented in a testing procedure somewhere, because this is not a command I would consider running -- I was doing regular card operations which are significantly less stressful.
What platform is this, and can you please run with a clean build, using firmware that matches my version? I don't have enough information to troubleshoot this, and I'm aware your branch has a different protocol to mainline. |
24bca6a to
87d0ba5
Compare
|
I've refactored to take into account recent changes in #414 (and squashed commits), but am still blocked needing more info about the other Windows issues (because I don't think they're related to my changes). |
Issue is on Windows only.
The error message is quite common, because the speed test runs for 1500ms which is exactly the timeout for the client waiting for a response. However usually the results are displayed nevertheless and I found no issue with this command without your commit. To be sure, I will provide a patch for the speed test timeout first and then test again. |
|
I have raised PR #434 which should fix the timeout with hw status in Windows. Please fix your merge conflicts and I will test your PR again. |
87d0ba5 to
adcf6c1
Compare
3a64c2a to
88e61ce
Compare
|
Merge conflicts resolved again because #434 was merged. |
|
Any insight performance-wise from this commit ? |
|
Observed the same as you did: flashing is much slower on Kali. Output of |
|
I have the issue #449 |
REVERT: From upstream proxmark3-master, revert comms refasctor Proxmark#371/Proxmark#450
…oxmark#371)"" This reverts commit 289d25a.
…oxmark#371)"" This reverts commit 289d25a.
…oxmark#371)"" This reverts commit 289d25a.
…oxmark#371)"" This reverts commit 289d25a.
…oxmark#371)"" This reverts commit 289d25a.
This is a refactor of exclusively the comms related code from #346, and a part of work for Issue #334:
comms_globals.h)proxmark3built with Qt support quitting on startupflasheruses same code asproxmark3client for communication with hardwareThis appears to work with me on Linux and OSX with Qt and non-Qt targets.