You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
612 B
C
33 lines
612 B
C
#pragma once
|
|
|
|
#include "connection.h"
|
|
|
|
struct Client {
|
|
|
|
void* buffer;
|
|
size_t max_size;
|
|
size_t size;
|
|
|
|
uint8_t hostbyte;
|
|
|
|
int16_t seq;
|
|
|
|
struct Connection* connection;
|
|
|
|
};
|
|
|
|
static inline uint8_t host2byte(uint8_t host, uint8_t index) {
|
|
return index * 32 + host;
|
|
}
|
|
|
|
static inline void byte2host(uint8_t b, uint8_t* host, uint8_t* index) {
|
|
*host = (b & 0x1F);
|
|
*index = b >> 5;
|
|
}
|
|
|
|
// Not sure what these are for, but they are used for the hostbyte
|
|
static const uint8_t DEFAULT_CLIENT_HOST = 9;
|
|
static const uint8_t DEFAULT_CLIENT_INDEX = 6;
|
|
static const uint8_t DEFAULT_ROBOT_INDEX = 0;
|
|
|