Network Interaction

General Chat, Feel Free To talk about anything here.
Post Reply
Pain
Posts: 10
Joined: Sun Nov 30, 2014 12:59 pm

Network Interaction

Post by Pain »

Hey,
i need some help in interacting with gimx using the network input. I want to send keystrokes to gimx using the network support. Im thinking of following:

Building up a server application which sends packets to the gimx controller. Of what i could read it should be possible. Sadly im a bit lost with the manual that is provided. I do not see which packets needs to be sent to the gimx listener to get it working. Could you maybe provide me a sample "package" of how it should look like to for example press "X" on the xbox controller and maybe "left stick up"?

That would help me out a lot.

Keep up the good work.
User avatar
Matlo
Posts: 5696
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Network Interaction

Post by Matlo »

Hi,

Did you read this wiki page: http://gimx.fr/wiki/index.php?title=Network_API
?
GIMX creator Donate Shop
Pain
Posts: 10
Joined: Sun Nov 30, 2014 12:59 pm

Re: Network Interaction

Post by Pain »

yes i read the wiki put still i have no clue how to send for example a command to push the "b" button on an xbox 360 controller.

Would the package look like push the "b" (abs_axis_0) button?
01 00 00 00 01

a sample would be much appreaciated.
User avatar
Matlo
Posts: 5696
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Network Interaction

Post by Matlo »

You have to send a byte array as described here: http://gimx.fr/wiki/index.php?title=Net ... end_report
The first byte is the packet type, and has to be 0xff for an input report.
The second byte is the length of the axis array in bytes, thus 39 x 4 = 156 = 0x9c.
Bytes 2 to 157 contain the axis/button values. Each axis is encoded as a signed integer (4 bytes).
A value of 0 means "axis centered" of "button released".

Button B has index 16 in the axis array: http://gimx.fr/wiki/index.php?title=Controller_Maps

0xff,
0x9c,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00
GIMX creator Donate Shop
Pain
Posts: 10
Joined: Sun Nov 30, 2014 12:59 pm

Re: Network Interaction

Post by Pain »

thanks a lot, thats something i can work with. I just donated 10$.

Greetings,
Rene
User avatar
Matlo
Posts: 5696
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Network Interaction

Post by Matlo »

Thanks!
GIMX creator Donate Shop
User avatar
Matlo
Posts: 5696
Joined: Wed Jul 06, 2011 7:01 am
Location: France
Contact:

Re: Network Interaction

Post by Matlo »

I realized there are more axes since GIMX 5.2, so the length of the packet is 2 header bytes + 4 x 39 =156 bytes.
GIMX creator Donate Shop
Post Reply