function [transports mexfiles interfaces] = ccslink_extmode_registration(varargin)

%CCSLINK_EXTMODE_REGISTRATION Registers the possible external mode implementations
%   CCSLINK_EXTMODE_REGISTRATION registers the CCSLINK external mode
%   implementation by returning a cell array of strings TRANSPORTS representing
%   the communications supported by the external mode implementation and
%   a cell array of strings MEXFILES which names the files that implement
%   external mode
%   This file will search for target specific registration files to add
%   external mode capabilities provided by target products. you can add your own
%   specific target registration file by adding on the matlab path a
%   ccslink registration file using this name:
%   ccsTarget_extmode_registration.m

%   Copyright 2007-2008 The MathWorks, Inc.

transports = {};
mexfiles = {};
interfaces = {};

cs = varargin{1};
regFiles = which('ccsTarget_extmode_registration.m','-all');
for i = 1:length(regFiles)
    currentFile = regFiles{i};
    regDir = fileparts(currentFile);
    prevDir = pwd;
    cd(regDir);
    try
        [transports mexfiles interfaces] = ccsTarget_extmode_registration(cs);
     
    catch extRegException
        cd(prevDir);
        rethrow(extRegException);
    end
    cd(prevDir);
end