%% Update UE Structure Using MIB-SL Message
% Update UE-specific parameter configuration structure settings using the 40-bit MIB-SL message. Encode an MIB-SL message based on one ue structure parameter set.
%% Encode an MIB-SL message from one UE-specific configuration
% Initialize a UE-specific configuration structure with 5 MHz bandwidth for TDD. Encode a 40-bit MIB-SL message using the ue1 structure.

ue1.NSLRB = 25;
ue1.DuplexMode = 'TDD';
ue1.TDDConfig = 6;
ue1.NFrame = 5;
ue1.NSubframe = 1;
ue1.InCoverage = 1;

mibsl = lteSLMIB(ue1);

%
%% Create a second UE-specific configuration
% Initialize a second UE-specific configuration structure with a different configuration. Compare ue2 with ue1.

ue2.NSLRB = 75;
ue2.DuplexMode = 'TDD';
ue2.TDDConfig = 2;
ue2.NFrame = 2;
ue2.NSubframe = 2;
ue2.InCoverage = 0;

isequal(ue2,ue1)

%
%% Update the second UE-specific configuration based on the MIB-SL message
% Using mibsl, update the settings in ue2 to match ue1. Compare ue2 with ue1.

ue2 = lteSLMIB(mibsl,ue2);
isequal(ue2,ue1)

% Copyright 2012 The MathWorks, Inc.