@@ -2536,6 +2536,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2536
2536
let mut last_hop_time = Instant :: now ( ) ;
2537
2537
let mut first_channel = ( 0u8 , 0u32 ) ;
2538
2538
let mut hop_cycle: u32 = 0 ;
2539
+ let mut old_hop_cycle = u32:: MAX ;
2539
2540
let mut autohunt_success_hop = u32:: MAX ;
2540
2541
2541
2542
// Set starting channel and create the hopper cycle.
@@ -2619,13 +2620,17 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2619
2620
2620
2621
// Handle Hunting
2621
2622
let target_chans: HashMap < Target , Vec < ( u8 , u32 ) > > = oxide. if_hardware . target_chans . clone ( ) ;
2622
- if oxide. config . autohunt && !target_chans. values ( ) . any ( |value| value. is_empty ( ) ) {
2623
- // We found atleast one target channel.
2623
+ // If we found atleast one
2624
+ if oxide. config . autohunt
2625
+ && autohunt_success_hop == u32:: MAX
2626
+ && !target_chans. values ( ) . any ( |value| value. is_empty ( ) )
2627
+ {
2628
+ // We found atleast one target channel. Update autohunt_success_hop
2624
2629
autohunt_success_hop = hop_cycle;
2625
2630
}
2626
2631
2627
2632
if oxide. config . autohunt
2628
- && !target_chans . values ( ) . any ( |value| value . is_empty ( ) )
2633
+ && autohunt_success_hop != u32 :: MAX
2629
2634
&& hop_cycle >= autohunt_success_hop + 3
2630
2635
&& inside_geo
2631
2636
// if we are autohunting
@@ -2669,6 +2674,30 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
2669
2674
if !cli. notransmit {
2670
2675
oxide. config . notx = false ; // Turn notx back to false unless CLI notransmit is true.
2671
2676
}
2677
+ } else if oxide. config . autohunt && old_hop_cycle != hop_cycle {
2678
+ old_hop_cycle = hop_cycle;
2679
+ oxide. status_log . add_message ( StatusMessage :: new (
2680
+ MessageType :: Priority ,
2681
+ "=== AutoHunting NOT Complete ===" . to_string ( ) ,
2682
+ ) ) ;
2683
+ oxide. status_log . add_message ( StatusMessage :: new (
2684
+ MessageType :: Priority ,
2685
+ format ! (
2686
+ "Empty Target Chans: {:?}" ,
2687
+ target_chans. values( ) . filter( |value| value. is_empty( ) )
2688
+ ) ,
2689
+ ) ) ;
2690
+ oxide. status_log . add_message ( StatusMessage :: new (
2691
+ MessageType :: Priority ,
2692
+ format ! (
2693
+ "Hop Iteration: {} | First Success Hop: {}" ,
2694
+ hop_cycle, autohunt_success_hop
2695
+ ) ,
2696
+ ) ) ;
2697
+ oxide. status_log . add_message ( StatusMessage :: new (
2698
+ MessageType :: Priority ,
2699
+ format ! ( "Inside Geo: {}" , inside_geo) ,
2700
+ ) ) ;
2672
2701
}
2673
2702
2674
2703
// Calculate status rates
0 commit comments