From c67f528d10f55e34d0d254fb59494778bcb04e90 Mon Sep 17 00:00:00 2001 From: Josh Allen Date: Mon, 13 Feb 2017 16:04:01 -0500 Subject: use zlib crc32 --- tools/ootx_decode/HMD_Datagen.c | 8 +++++--- tools/ootx_decode/Makefile | 6 +++--- 2 files changed, 8 insertions(+), 6 deletions(-) (limited to 'tools') diff --git a/tools/ootx_decode/HMD_Datagen.c b/tools/ootx_decode/HMD_Datagen.c index 34bf543..15ed62c 100644 --- a/tools/ootx_decode/HMD_Datagen.c +++ b/tools/ootx_decode/HMD_Datagen.c @@ -9,8 +9,9 @@ #include #include #include +#include -#include "crc32.h" +//this program is broken and does not produce useable data. uint32_t time_stamp = -525198892; @@ -33,7 +34,8 @@ int main(int argc, char* argv[]) print_preamble(); uint16_t payload_lenth = strlen(str); - uint32_t crc = crc32(0xffffffff,(uint8_t*)str,payload_lenth); + uint32_t crc = crc32( 0L, Z_NULL, 0 ); + crc = crc32( crc, (uint8_t*)str,payload_lenth); print_uint16(payload_lenth); print_payload(str,payload_lenth); @@ -98,4 +100,4 @@ void print_bit(uint8_t data) { */ //fire off a callback when a full OOTX packet is received -} \ No newline at end of file +} diff --git a/tools/ootx_decode/Makefile b/tools/ootx_decode/Makefile index 8be8618..9170ac4 100644 --- a/tools/ootx_decode/Makefile +++ b/tools/ootx_decode/Makefile @@ -1,7 +1,7 @@ all: ootx_decode hmd_datagen -hmd_datagen: HMD_Datagen.c crc32.c crc32.h - gcc -Wall HMD_Datagen.c crc32.c -o hmd_datagen +hmd_datagen: HMD_Datagen.c + gcc -Wall HMD_Datagen.c -lz -o hmd_datagen ootx_decode: ootx_decode.c ootx_decoder.c ootx_decoder.h - gcc -Wall ootx_decode.c ootx_decoder.c -lz -o ootx_decode \ No newline at end of file + gcc -Wall ootx_decode.c ootx_decoder.c -lz -o ootx_decode -- cgit v1.2.3