3dscontroller-ng/PC/include/wireless.h

48 lines
649 B
C
Raw Normal View History

2014-12-05 20:03:50 +00:00
#pragma once
#ifndef WINVER
#define WINVER 0x0500
#endif
#include <windows.h>
#include <winsock.h>
#define IP INADDR_ANY
enum NET_COMMANDS {
CONNECT,
KEYS,
};
struct packet {
unsigned char command;
unsigned int keys;
struct {
short x;
short y;
2014-12-07 13:47:50 +00:00
} circlePad;
2014-12-05 20:03:50 +00:00
struct {
unsigned short x;
unsigned short y;
} touch;
};
extern SOCKET listener;
extern SOCKET client;
extern struct sockaddr_in client_in;
extern int sockaddr_in_sizePtr;
2014-12-08 17:34:52 +00:00
extern struct packet buffer;
2014-12-05 20:03:50 +00:00
extern char hostName[80];
void initNetwork(void);
2014-12-08 18:27:03 +00:00
void printIPs(void);
2014-12-05 20:03:50 +00:00
void startListening(void);
void sendBuffer(int length);
int receiveBuffer(int length);