1
0
mirror of https://github.com/fumiama/simple-dict.git synced 2026-06-10 21:24:49 +08:00

add ack cmd code

This commit is contained in:
源文雨
2022-04-17 16:46:28 +08:00
parent cf768d96da
commit 0bb8889ca4
4 changed files with 34 additions and 37 deletions

View File

@@ -10,9 +10,10 @@
#define DICTPOOLBIT 16
enum SERVERCMD {CMDGET, CMDCAT, CMDMD5, CMDACK, CMDEND, CMDSET, CMDDEL, CMDDAT};
enum SERVERACK {ACKNONE=0b0000011, ACKSUCC=0b0010011, ACKDATA=0b0100011, ACKNULL=0b0110011, ACKNEQU=0b1000011, ACKERRO=0b1010011};
struct CMDPACKET {
uint8_t cmd;
uint8_t cmd; // SERVERCMD or SERVERACK
uint8_t datalen; // data len is less than 255
uint8_t md5[16]; // md5 digest of data below
uint8_t data[]; // with TEA encoding, 64 bytes will be 160 bytes