%hScanLTEWaveformHSPCheck Hardware Support Package (HSP) installation check
%   HSPINSTALLED = hScanLTEWaveformHSPCheck(RADIOCHOICE) returns
%   either 1 or 0 by checking whether the selected hardware support package
%   root is available or not respectively.

%   Copyright 2019 The MathWorks, Inc.

function HSPInstalled = hScanLTEWaveformHSPCheck(radioChoice)
    switch radioChoice
        case 'RTL-SDR'
            if ~exist('sdrrroot', 'file')
                HSPInstalled = 0;
            else
                HSPInstalled = 1;
            end
        case 'ADALM-PLUTO'
            if isempty(which('plutoradio.internal.getRootDir'))
                HSPInstalled = 0;
            else
                HSPInstalled = 1;
            end
        case {'USRP-B200/B210','USRP-N200/N210','USRP-X300/X310'}
            if ~exist('sdruroot', 'file')
                HSPInstalled = 0;
            else
                HSPInstalled = 1;
            end
        case {'ZedBoard-FMC2/3/4','ZC706-FMC2/3/4'}
            if ~exist('sdrzroot', 'file')
                HSPInstalled = 0;
            else
                HSPInstalled = 1;
            end
    end
end