function ret = setCOMPort(mdlName, comPort)
% setCOMPort Small utility to set the COM port for an arduino target from the
% command line
    
% Copyright 2015 - 2016 The MathWorks, Inc.

    ctd=get_param(mdlName, 'CoderTargetData');
    if nargin == 1
        ret = ctd.HostCOMPort.COM_port_number;
    else
        ctd.HostCOMPort.COM_port_number = comPort;
        set_param(mdlName, 'CoderTargetData', ctd)
    end
end