So, viewtopic.php?f=3&t=1163&p=7557&hilit=byte+array#p7557 states how to send an input report over UDP to an instance of GIMX (I'm guessing the instance is running using --src xxx.xxx.xxx.xxx:xxx).
I'm trying to write my own app to communicate with GIMX over 127.0.0.1 - but I'm having trouble connecting or sending the correct messages, so I'm hoping you guys can straighten me out a bit?
Here's my setup:
XBOX 360 is connected to GIMX, GIMX to my Windows PC. XBOX 360 pad is also connected to PC. Software runs fine, as both keyboard and mouse can control the XBOX 360.
I listen on 127.0.0.1:51914 which is set by the gimx launcher UI (input=network)
My VC++ app opens a UDP socket:
Code: Select all
struct sockaddr_in connectedSocket;
int length = sizeof(connectedSocket);
char receiveBuffer[1000];
char message[1000];
WSADATA wsa;
if (WSAStartup(MAKEWORD(2, 2), &wsa) != 0)
{
printf("\nFailed. Error Code : %d", WSAGetLastError());
exit(EXIT_FAILURE);
}
//create socket
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == SOCKET_ERROR)
{
printf("\n\nsocket() failed with error code : %d", WSAGetLastError());
exit(EXIT_FAILURE);
}
//setup address structure
memset((char *)&connectedSocket, 0, sizeof(connectedSocket));
connectedSocket.sin_family = AF_INET;
connectedSocket.sin_port = htons(PORT);
connectedSocket.sin_addr.S_un.S_addr = inet_addr(SERVER);
I send packets of data:
0xff, (header type)
0x9c (header size + packet size: 39*4)
then the remaining bytes of data to represent the pad state
No response, nothing.
I'm clearly doing something wrong here. I'm expecting either {0x00, 0x00} to query the controller type (where I would answer, then send the data packets), or no commands, so I can just send the data packets.
I would really like to know which steps I need to perform to get this up and running if possible, I've read the Network API page through and through, and the setup wiki.
(Note: I'm using VC++ because of the hardware device I want to send commands to GIMX - it only has VC++ libraries, and it's closed source)