diff --git a/decoder/src/lib/op25_decoder_ff.cc b/decoder/src/lib/op25_decoder_ff.cc index 319075a..90dc480 100644 --- a/decoder/src/lib/op25_decoder_ff.cc +++ b/decoder/src/lib/op25_decoder_ff.cc @@ -126,7 +126,7 @@ op25_decoder_ff::correlated() return (errs <= 4); } -bool +data_unit_sptr op25_decoder_ff::identified() { static const size_t NID[] = { @@ -145,8 +145,7 @@ op25_decoder_ff::identified() itpp::BCH bch(63, 16, 11,"6 3 3 1 1 4 1 3 6 7 2 3 5 4 5 3", true); yank(d_frame_hdr, NID, NID_SZ, b, 0); b = bch.decode(b); - bool identified(b != zeroes); - if(identified) { + if(b != zeroes) { b = bch.encode(b); yank_back(b, 0, d_frame_hdr, NID, NID_SZ); d_data_unit = data_unit::make_data_unit(d_frame_hdr); @@ -154,7 +153,7 @@ op25_decoder_ff::identified() data_unit_sptr null; d_data_unit = null; } - return identified; + return d_data_unit; } void diff --git a/decoder/src/lib/op25_decoder_ff.h b/decoder/src/lib/op25_decoder_ff.h index 19b8aa7..e3634df 100644 --- a/decoder/src/lib/op25_decoder_ff.h +++ b/decoder/src/lib/op25_decoder_ff.h @@ -94,15 +94,15 @@ private: /** * Tests whether d_frame_header identifies a known data unit and if - * so sets d_data_unit to point to an appropriate instance. This - * method must only be called when the frame header is larger than - * 114 bits in length (the minimum size for a frame containing a - * NID). + * so sets d_data_unit to point to an appropriate instance and + * returns a pointer to it. This method must only be called when + * the frame header is larger than 114 bits in length (the minimum + * size for a frame containing a NID). * - * \return true if the frame header identifies a known data unit; - * otherwise false. + * \return A data_unit_sptr pointing to an appropriate data_unit + * instance or NULL if the frame header is unrecognized. */ - bool identified(); + data_unit_sptr identified(); /** * Handle a received symbol.