diff --git a/src/databits.h b/src/databits.h index 50a5da1..ba9c12b 100644 --- a/src/databits.h +++ b/src/databits.h @@ -22,7 +22,7 @@ typedef int (databits_encoder)( typedef unsigned int (databits_decoder)( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ); + unsigned long long bits, unsigned int n_databits ); int @@ -30,7 +30,7 @@ databits_encode_ascii8( unsigned int *databits_outp, char char_out ); unsigned int databits_decode_ascii8( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ); + unsigned long long bits, unsigned int n_databits ); #include "baudot.h" @@ -40,7 +40,7 @@ databits_decode_ascii8( char *dataout_p, unsigned int dataout_size, unsigned int databits_decode_baudot( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ); + unsigned long long bits, unsigned int n_databits ); int @@ -48,11 +48,11 @@ databits_encode_binary( unsigned int *databits_outp, char char_out ); unsigned int databits_decode_binary( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ); + unsigned long long bits, unsigned int n_databits ); unsigned int databits_decode_callerid( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ); + unsigned long long bits, unsigned int n_databits ); diff --git a/src/databits_ascii.c b/src/databits_ascii.c index 5269fc9..a40b54d 100644 --- a/src/databits_ascii.c +++ b/src/databits_ascii.c @@ -34,7 +34,7 @@ databits_encode_ascii8( unsigned int *databits_outp, char char_out ) /* returns nbytes decoded */ unsigned int databits_decode_ascii8( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ) + unsigned long long bits, unsigned int n_databits ) { if ( ! dataout_p ) // databits processor reset: noop return 0; diff --git a/src/databits_baudot.c b/src/databits_baudot.c index 3a2e8b1..f39da3d 100644 --- a/src/databits_baudot.c +++ b/src/databits_baudot.c @@ -28,7 +28,7 @@ /* returns nbytes decoded */ unsigned int databits_decode_baudot( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ) + unsigned long long bits, unsigned int n_databits ) { if ( ! dataout_p ) { // databits processor reset: reset Baudot state baudot_reset(); diff --git a/src/databits_binary.c b/src/databits_binary.c index cbdd66c..72dacc7 100644 --- a/src/databits_binary.c +++ b/src/databits_binary.c @@ -28,7 +28,7 @@ // returns nbytes decoded unsigned int databits_decode_binary( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ) + unsigned long long bits, unsigned int n_databits ) { if ( ! dataout_p ) // databits processor reset: noop return 0; diff --git a/src/databits_callerid.c b/src/databits_callerid.c index 9d8b932..c4bb1f0 100644 --- a/src/databits_callerid.c +++ b/src/databits_callerid.c @@ -157,7 +157,7 @@ decode_cid_reset() /* returns nbytes decoded */ unsigned int databits_decode_callerid( char *dataout_p, unsigned int dataout_size, - unsigned int bits, unsigned int n_databits ) + unsigned long long bits, unsigned int n_databits ) { if ( ! dataout_p ) // databits processor reset return decode_cid_reset(); @@ -183,7 +183,7 @@ databits_decode_callerid( char *dataout_p, unsigned int dataout_size, // Collect input bytes until we've collected as many as the message // length byte says there will be, plus two (the message type byte // and the checksum byte) - unsigned int cid_msglen = cid_buf[1]; + unsigned long long cid_msglen = cid_buf[1]; if ( cid_ndata < cid_msglen + 2) return 0; diff --git a/src/fsk.c b/src/fsk.c index d491218..d782238 100644 --- a/src/fsk.c +++ b/src/fsk.c @@ -178,13 +178,13 @@ fsk_bit_analyze( fsk_plan *fskp, float *samples, unsigned int bit_nsamples, static float fsk_frame_analyze( fsk_plan *fskp, float *samples, float samples_per_bit, int n_bits, const char *expect_bits_string, - unsigned int *bits_outp, float *ampl_outp ) + unsigned long long *bits_outp, float *ampl_outp ) { unsigned int bit_nsamples = (float)(samples_per_bit + 0.5); - unsigned int bit_values[32]; - float bit_sig_mags[32]; - float bit_noise_mags[32]; + unsigned int bit_values[64]; + float bit_sig_mags[64]; + float bit_noise_mags[64]; unsigned int bit_begin_sample; int bitnum; @@ -453,9 +453,9 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples, unsigned int try_step_nsamples, float try_confidence_search_limit, const char *expect_bits_string, - unsigned int *bits_outp, + unsigned long long *bits_outp, float *ampl_outp, - unsigned int *frame_start_outp + unsigned long long *frame_start_outp ) { int expect_n_bits = strlen(expect_bits_string); @@ -482,7 +482,7 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples, continue; float c, ampl_out; - unsigned int bits_out = 0; + unsigned long long bits_out = 0; debug_log("try fsk_frame_analyze at t=%d\n", t); c = fsk_frame_analyze(fskp, samples+t, samples_per_bit, expect_n_bits, expect_bits_string, diff --git a/src/fsk.h b/src/fsk.h index 8089a04..37e7d0e 100644 --- a/src/fsk.h +++ b/src/fsk.h @@ -65,9 +65,9 @@ fsk_find_frame( fsk_plan *fskp, float *samples, unsigned int frame_nsamples, unsigned int try_step_nsamples, float try_confidence_search_limit, const char *expect_bits_string, - unsigned int *bits_outp, + unsigned long long *bits_outp, float *ampl_outp, - unsigned int *frame_start_outp + unsigned long long *frame_start_outp ); int diff --git a/src/minimodem.c b/src/minimodem.c index 2fe72d8..2660e47 100644 --- a/src/minimodem.c +++ b/src/minimodem.c @@ -1011,7 +1011,7 @@ main( int argc, char*argv[] ) // start--v v--stop // char *expect_bits_string = "10dddddddd1"; // - char expect_bits_string[32]; + char expect_bits_string[64]; char start_bit_value = invert_start_stop ? '1' : '0'; char stop_bit_value = invert_start_stop ? '0' : '1'; int j = 0; @@ -1062,10 +1062,10 @@ main( int argc, char*argv[] ) try_step_nsamples = 1; float confidence, amplitude; - unsigned int bits = 0; + unsigned long long bits = 0; /* Note: frame_start_sample is actually the sample where the * prev_stop bit begins (since the "frame" includes the prev_stop). */ - unsigned int frame_start_sample = 0; + unsigned long long frame_start_sample = 0; unsigned int try_first_sample; float try_confidence_search_limit; @@ -1179,8 +1179,8 @@ main( int argc, char*argv[] ) try_step_nsamples = 1; try_confidence_search_limit = INFINITY; float confidence2, amplitude2; - unsigned int bits2; - unsigned int frame_start_sample2; + unsigned long long bits2; + unsigned long long frame_start_sample2; confidence2 = fsk_find_frame(fskp, samplebuf, expect_nsamples, try_first_sample, try_max_nsamples,