less magic numbers and generic send function

This commit is contained in:
2024-01-21 13:14:47 +01:00
parent 0104e542e1
commit 56bb116ab9
3 changed files with 27 additions and 22 deletions

View File

@@ -1,9 +1,14 @@
#define SERVER "::1"
#define PORT 49000
#define COMMAND_BUFFER 256
#define SEND_BUFFER 256
char* printable(char *str);
int sendCommand(int sock, char *cmd);
#define DGRAM_MSG_LENGTH 4
#define DGRAM_NULL_LENGTH 1
extern const int DGRAM_MSG_START;
extern const int DGRAM_PAYLOAD_START;
int sendToXPlane(int sock, char *msg, char *payload);
int connectXPlane(char *addr, int port);
int disconnectXPlane(int sock);