• hsum's avatar
    Refactor is_nr_p7_request_in_window function for clarity and efficiency · 195b23bd
    hsum authored
    The function now utilizes simpler variable names and logic to determine
    if a given NR P7 request falls within the timing window.
    
    The logic for determining if a request is within the timing window is as follows:
    - The function calculates the absolute difference between the current
      and received SFN slots, taking into account the possibility of
      wraparound.
    - If the absolute difference is greater than half of the maximum SFN
      slot value, it subtracts this difference from the maximum SFN slot
      value to get the actual difference.
    - The function then checks if this difference is less than or equal to
      the specified timing window. If it is, the request is considered to be
      within the window.
    
    Additionally, the commit updates the function signature to return a
    boolean value for better readability and consistency.
    
    Changes made:
    - Simplified variable names for readability
    - Improved logic for handling wraparound scenarios
    - Updated function signature to return a boolean value
    Co-authored-by: default avatarRúben Soares Silva <rsilva@allbesmart.pt>
    195b23bd
pnf_p7.c 98.5 KB