diff options
author | Josh Allen <axlecrusher@gmail.com> | 2017-02-13 16:04:01 -0500 |
---|---|---|
committer | Josh Allen <axlecrusher@gmail.com> | 2017-02-13 16:04:01 -0500 |
commit | c67f528d10f55e34d0d254fb59494778bcb04e90 (patch) | |
tree | 0ab4458991b8c30a8116bffa615dd1cc85036772 | |
parent | 7fdfd9fff265d38ae002d8007a02f746f42fd3f2 (diff) | |
download | libsurvive-c67f528d10f55e34d0d254fb59494778bcb04e90.tar.gz libsurvive-c67f528d10f55e34d0d254fb59494778bcb04e90.tar.bz2 |
use zlib crc32
-rw-r--r-- | tools/ootx_decode/HMD_Datagen.c | 8 | ||||
-rw-r--r-- | tools/ootx_decode/Makefile | 6 |
2 files changed, 8 insertions, 6 deletions
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 <stdint.h> #include <time.h> #include <stdlib.h> +#include <zlib.h> -#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 |