Commit fb7005a0 authored by chenhaowen's avatar chenhaowen

change to old checksum mode

parent 25965dbb
......@@ -61,7 +61,7 @@ static int make_keep_alive2_pkt2(uint8_t *buf, uint8_t cnt, uint8_t *flag,\
static void gen_ka1_checksum(uint8_t *checksum, uint8_t *seed, uint8_t mode);
static void gen_ka2_checksum(uint8_t *data, int len, uint8_t *checksum);
//static int32_t drcomCRC32(char *data, int len);
static int32_t drcomCRC32(char *data, int len);
static void print_as_hex(uint8_t *buf, int len);
/****local functions****/
......@@ -325,8 +325,6 @@ static void print_as_hex(uint8_t *buf, int len)
fflush(stdout);
}
/* unused*/
/*
static int32_t drcomCRC32(char *data, int len)
{
int ret = 0;
......@@ -338,7 +336,6 @@ static int32_t drcomCRC32(char *data, int len)
}
return ret;
}
*/
static int make_keep_alive1_pkt1(uint8_t *buf, uint8_t cnt)
{
......@@ -390,7 +387,8 @@ static int make_keep_alive1_pkt2(uint8_t *buf, uint8_t *seed,\
index += 4;
memcpy(buf+index, seed, 4);
index += 4;
/*
/**/
int32_t temp_num;
temp_num = 20000711;
memcpy(buf+index, (char *)&temp_num, 4);
index += 4;
......@@ -403,7 +401,9 @@ static int make_keep_alive1_pkt2(uint8_t *buf, uint8_t *seed,\
index += 4;
memcpy(buf+index, "\x00\x00\x00\x00", 4);
index += 4;
*/
/**/
/*
uint8_t checksum[8] = {0};
gen_ka1_checksum(checksum, seed, check_mode);
#ifdef DEBUG
......@@ -413,6 +413,7 @@ static int make_keep_alive1_pkt2(uint8_t *buf, uint8_t *seed,\
#endif
memcpy(buf+index, checksum, 8);
index += 8;
*/
memset(buf+index, 0x00, 16*4);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment