function edcaAssignBSSIDs(modelName)
%edcaAssignBSSIDs Assign basic service set (BSS) IDs
% 
%   edcaAssignBSSIDs(MODELNAME) assigns the BSS IDs dynamically at the
%   start of the simulation to all the nodes in the given MODELNAME.
% 
%   MODELNAME is a simulink model name.

%   Copyright 2020 The MathWorks, Inc.

    % Get names of nodes present in the model.
    nodeNamesList = dcfGetNodeNamesList(modelName);
    % Total number of nodes
    numNodes = numel(nodeNamesList);
    
    % Get the BSS information
    [apNodeIDMap, nodeMap, isAP, nodeMACPath] = edcaGetBSSInfo(nodeNamesList);
    % Validate BSSs in network
    edcaValidateBSS(apNodeIDMap, nodeMap, isAP);   
 
    % Set the BSSIDs
    for i = 1:numNodes
        set_param(nodeMACPath(i), 'BSSID', num2str(apNodeIDMap(i)))
    end

end