Driver for USB launcher in Windows 7

There is a missle launcher that runs via USB

alt text

Software for it can be found on the DreamCheeky website

What I want to do is manage this computer through my programs. Therefore, I see the following problems:

  • Get driver <---
  • Include this driver in my C # applications (I'll talk about this later)

For the first part, which is the most important, I found several ports of the linux driver, but can I use the driver that came with the program? Or can I take linux code and build a driver on Windows?

The most useful source I found is the code from the NZ Mac port , but I have no idea what to do with it.

Any tips and tricks appreciated. This is my introduction to drivers.

EDIT - More Thoughts

I think I can just call and get USB commands. In the dgwilson code from the NZ macro port, it has the following:

// Control of the launcher works on a binary code – see the table below for an explanation // // | 16 | 8 | 4 | 2 | 1 | // |β€”β€”|β€”|β€”|β€”|β€”| // | 0 | 0 | 0 | 0 | 1 | 1 – Up // | 0 | 0 | 0 | 1 | 0 | 2 – Down // | 0 | 0 | 0 | 1 | 1 | 3 – nothing // | 0 | 0 | 1 | 0 | 0 | 4 – Left // | 0 | 0 | 1 | 0 | 1 | 5 – Up / Left // | 0 | 0 | 1 | 1 | 0 | 6 – Down / left // | 0 | 0 | 1 | 1 | 1 | 7 – Slow left // | 0 | 1 | 0 | 0 | 0 | 8 – Right // | 0 | 1 | 0 | 0 | 1 | 9 – Up / Right // | 0 | 1 | 0 | 1 | 0 | 10 – Down / Right // | 0 | 1 | 0 | 1 | 1 | 11 – Slow Right // | 0 | 1 | 1 | 0 | 0 | 12 – nothing // | 0 | 1 | 1 | 0 | 1 | 13 – Slow Up // | 0 | 1 | 1 | 1 | 0 | 14 – Slow Down // | 0 | 1 | 1 | 1 | 1 | 15 – Stop // | 1 | 0 | 0 | 0 | 0 | 16 – Fire // // | Fire |RT |LT |DN |UP | // 

Does this mean that there may be a USB library that just sends these commands and receives feedback commands?

Answer

All this has been done before and sits and waits at rocket.codeplex.com Even what I thought to do (WiiMote connection)!

+4
source share
3 answers

I just bought the Dream Cheeky Thunder Missile Launcher , which seems to be the successor to the model mentioned here in this question (as well as the model that was written by rocket.codeplex.com ).

But I could not get rocket.codeplex.com to work with my model (yes, I used the constructor overload, which allows me to supply VendorID and DeviceID, and yes, I provided the correct identifiers for my model), so I wrote my own library.

Here it is, perhaps it helps other people:
MissileSharp

+1
source

It seems that someone has already done the hard work for you - make a comment No. 8 from the link you posted:

http://dgwilson.wordpress.com/windows-missile-launcher/#comment-2160

(Windows.dll and a simple API that you can use in your application will load there.)

+2
source

"Retaliation" kicks ass ... works like a charm, and it's super easy to change and run ...

https://github.com/codedance/Retaliation

you need to download and set up access to the USB library in Python so that it works http://sourceforge.net/apps/trac/libusb-win32/wiki

install the filter driver with this program, this will allow you to capture everything sent via this USB port, remember which one, because it will work only if you plug it in again in this particular port ...

after that just run retaliation.py and enjoy =)

I made some changes to my answer. I, since I have an old booster model, it does not come with a β€œboot sequence” without firing ...

 elif command == "prefire": send_cmd(FIRE) time.sleep(4.5) send_cmd(STOP) elif command == "firewithprefire": send_cmd(FIRE) time.sleep(.5) send_cmd(STOP) 

the second command is triggered after "loading up", so unknown victims do not hear the sound of loading, since it was "pre-loaded", just a click and a rocket fly ...

also with the old version of the booster you can send too high values ​​in the move command and the booster will try to do this, it seems that newer versions stop the base after some points, the older version does the same, but only when it reaches the maximum values, so sending a move (2,000,000, left) will make it go all the way to the left, and then try to keep moving left, basically breaking gears, but if it's already at the maximum on the left, it will ignore the command, so I'm changing Neil course as follows:

 def send_move(cmd, duration_ms): secs = (duration_ms / 1000.0) for x in range(0, int(secs)): send_cmd(cmd) time.sleep(1) send_cmd(STOP) 

this may sound awful, but this is the only way to make sure it doesn't reach its maximum value when sending a move command, especially when using the park command, which moves the launcher to position 0,0 ...

hope this helps someone =)

amuses

+1
source

Source: https://habr.com/ru/post/1334540/


All Articles