bin/pwn_gqrx_scanner in pwn-0.5.59 vs bin/pwn_gqrx_scanner in pwn-0.5.60

- old
+ new

@@ -41,11 +41,11 @@ options.on('-PINT', '--precision=INT', '<Optional - Precision of Frequency 1-12 (Defaults to 5)>') do |p| opts[:precision] = p end - options.on('-SFLOAT', '--strength-lock=FLOAT', '<Optional - Strength to trigger lock on frequency (Defaults to -45.0)>') do |s| + options.on('-SFLOAT', '--strength-lock=FLOAT', '<Optional - Strength to lock onto frequency (Defaults to -45.0)>') do |s| opts[:strength_lock] = s end options.on('-LFLOAT', '--lock-freq-duration=FLOAT', '<Optional - Duration to lock onto Freqency when Strength < --strength-lock value (Defaults to 0.5)>') do |l| opts[:lock_freq_duration] = l @@ -247,11 +247,11 @@ squelch: current_squelch, rf_gain: rf_gain, if_gain: if_gain, bb_gain: bb_gain, strength: current_strength, - strength_trigger_lock_on_freq: strength_lock, + strength_lock: strength_lock, lock_freq_duration: lock_freq_duration } print '.' sleep lock_freq_duration if current_strength > strength_lock @@ -278,16 +278,16 @@ squelch: 0.0, rf_gain: 0.0, if_gain: 0.0, bb_gain: 0.0, strength: 0.0, - strength_trigger_lock_on_freq: strength_lock, + strength_lock: strength_lock, lock_freq_duration: lock_freq_duration } if start_freq > target_freq start_freq.downto(target_freq) do |this_freq| - next unless (i % multiplier).zero? + next unless (this_freq % multiplier).zero? init_freq_hash = init_freq( gqrx_sock: gqrx_sock, demodulator_mode: demodulator_mode, bandwidth: bandwidth, @@ -298,13 +298,14 @@ current_strength = init_freq_hash[:strength] prev_strength = prev_freq_hash[:strength] prev_freq = prev_freq_hash[:frequency] - approaching_detection = true if current_strength > prev_strength - if approaching_detection && current_strength < prev_strength - puts "**** Found a signal at ~ #{prev_freq} Hz ****" + approaching_detection = true if current_strength > prev_strength && + current_strength > strength_lock + if approaching_detection && current_strength <= prev_strength + puts "\n**** Found a signal ~ #{prev_freq} Hz ****" puts JSON.pretty_generate(prev_freq_hash) approaching_detection = false end prev_freq_hash = init_freq_hash @@ -323,12 +324,13 @@ current_strength = init_freq_hash[:strength] prev_strength = prev_freq_hash[:strength] prev_freq = prev_freq_hash[:frequency] - approaching_detection = true if current_strength > prev_strength + approaching_detection = true if current_strength > prev_strength && + current_strength > strength_lock if approaching_detection && current_strength < prev_strength - puts "\n**** Discovered a signal at #{prev_freq} Hz ****" + puts "\n**** Discovered a signal ~ #{prev_freq} Hz ****" puts JSON.pretty_generate(prev_freq_hash) approaching_detection = false end prev_freq_hash = init_freq_hash