function acqResults = acquisitionEntryPoint( pathName, fileName, signalType )               

fprintf( '\n /----------------------------------------------------------\\\n');
fprintf( '/------------------------------------------------------------\\\n' );
fprintf( '||                                                          ||\n'  );
fprintf( '||             GPS Software Receiver in Matlab              ||\n'  );
fprintf( '||           Signal Acquisition by FFT Processing           ||\n'  );
fprintf( '||       Copyright (c) 2003-2017  David S. De Lorenzo       ||\n'  );
fprintf( '||                     2018-2023    Trimble Inc.            ||\n'  );
fprintf( '||                                                          ||\n'  );
fprintf( '\\------------------------------------------------------------/\n' );
fprintf( ' \\----------------------------------------------------------/\n'  );


%==============================================================================%
%                                                                              %
%   Set pathName and fileName strings                                          %
%                                                                              %
%==============================================================================%
% pathName = 'TestData';
% fileName = 'TestDataFile';


%==============================================================================%
%                                                                              %
%   Initialize constants and acquisition settings                              %
%                                                                              %
%==============================================================================%
% signalType = 'L1-C/A';
settings   = acquisitionSettings( signalType );

%=== Optional --> provide user-specified changes to primary settings ==========%
if ( exist( fullfile( pathName, [fileName '___settings.m'] ), 'file' ) == 2 )
    run( fullfile( pathName, [fileName '___settings.m'] ) );
elseif strcmp( fileName, 'TestDataFile' )
    %--- Quick-start for TestDataFile that accompanies this code release -------
    settings.signalType             = 'L1-C/A';     % GPS=L1-C/A
    settings.samplingFreq           = 16.3676e6;    % [Hz]
    settings.intermediateFreq       =  4.1304e6;    % [Hz]
    settings.dataType               = 'real';       % real/complex
    settings.dataFormat             = 'schar';      % for 'fread'
    settings.acq.prnSearchVec       = [ 3 15 ];     % PRN #
% elseif 1
    % %--- Quick-start for data w/o a dedicated "settings" file ----------------
    % settings.signalType             = 'L1-C/A';     % GPS=L1-C/A
    % settings.samplingFreq           = 16.3676e6;    % [Hz]
    % settings.intermediateFreq       =  4.1304e6;    % [Hz]
    % settings.dataType               = 'real';       % real/complex
    % settings.dataFormat             = 'schar';      % for 'fread'
    % settings.acq.prnSearchVec       = [ 3 15 ];     % PRN #
else
    error( 'No user-specified settings were loaded at run-time!!' );
end

%=== Calculate secondary settings =============================================%
settings = acquisitionSettingsSecondary( settings );


%==============================================================================%
%                                                                              %
%   Open the input data file                                                   %
%                                                                              %
%==============================================================================%
fidIn = fopen( fullfile( pathName, fileName ), 'r' );
if ( fidIn ~= -1 )
    fprintf( '\nData file opened successfully:  %s\n', fileName );
else
    error( '***  ERROR OPENING FILE:  %s  ***', fullfile(pathName, fileName) );
end


%==============================================================================%
%                                                                              %
%   Run main acquisition program                                               %
%                                                                              %
%==============================================================================%
acqResultsAll = acquisitionDriver( pathName, fileName, fidIn, settings );


%==============================================================================%
%                                                                              %
%   Quick detection logic and save plots to JPEG                               %
%                                                                              %
%==============================================================================%
acqResults = acquisitionQuickDetect( pathName, fileName, ...
                                     settings, acqResultsAll );


%==============================================================================%
%                                                                              %
%   Refine acquisition Doppler frequency estimate                              %
%                                                                              %
%==============================================================================%
acqResults = acquisitionRefineDoppler( fidIn, settings, acqResults );


%==============================================================================%
%                                                                              %
%   Close the input data file                                                  %
%                                                                              %
%==============================================================================%
status = fclose( fidIn );
if ( status ~= -1 )
    fprintf( '\nData file closed successfully:  %s\n', fileName );
else
    error( '***  ERROR CLOSING FILE!!  *** ' );
end


%==============================================================================%
%                                                                              %
%   Show acquisition results                                                   %
%                                                                              %
%==============================================================================%
acquisitionShowResults( fileName, acqResults );


%==============================================================================%
%                                                                              %
%   Save results to disk                                                       %
%                                                                              %
%==============================================================================%
acquisitionSaveResults( pathName, fileName, settings, acqResults );


end
%===============================================================================