forked from spiliot/USBHid
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Main.cs
44 lines (41 loc) · 1.57 KB
/
Main.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
using System;
using UsbHid.USB.Classes;
namespace UsbHid
{
public static class Main
{
private static class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
private static void Main()
{
var devices = DeviceDiscovery.FindHidDevices(new SerialStringMatcher("aimforfs.eu:RMP"));
var device = new UsbHidDevice(devices[0].Key);
var command = new USB.Classes.Messaging.CommandMessage(0x20, new byte[] {
16,
0, (1<<0)+(1<<3)+(1<<6)+(1<<7)+(1<<4),
1, 0x0,
2, 0x0,
3, 1 << 1,
4, (1<<0)+(1<<2)+(1<<3)+(1<<4)+(1<<6)+(1<<7),
5, (1<<3)+(1<<5),
6, 0x0,
7, (1<<0)+(1<<2)+(1<<4)+(1<<5)+(1<<7),
8, (1<<4)+(1<<3)+(1<<5)+(1<<6),
9, (1<<0)+(1<<1)+(1<<4)+(1<<3)+(1<<5)+(1<<7),
10, (1<<0)+(1<<1)+(1<<4)+(1<<3)+(1<<5)+(1<<7),
11, (1<<4)+(1<<3)+(1<<5)+(1<<6),
12, (1<<0)+(1<<2)+(1<<4)+(1<<5)+(1<<7),
13, (1<<0)+(1<<3)+(1<<6)+(1<<7)+(1<<4),
14, (1<<3)+(1<<5),
15, (1<<0)+(1<<2)+(1<<3)+(1<<4)+(1<<6)+(1<<7)
}, device.OutputReportByteLength);
device.SendMessage(command);
System.Diagnostics.Debug.WriteLine(devices);
}
}
}
}