Docsity

Function Broadcast-Network Programming-Project Codes, Study Guides, Projects, Research of Network Programming

Toggle sidebar
bg1
function broad = broadcast(num,nodes)
if num == 1
status = 'There are no devices connected to the Master device';
x = imread('2.JPG');
broad(1) = struct('simu', x,'stat',status);
end
if num == 2
status = ['Master device is sending data to ' nodes(2).Device_Name];
x = imread('5.JPG');
broad(1) = struct('simu', x,'stat',status);
end
if num == 3
status = ['Master device is sending data to ' nodes(2).Device_Name ',
' nodes(3).Device_Name];
x = imread('58.JPG');
broad(1) = struct('simu', x,'stat',status);
end
if num == 4
status = ['Master device is sending data to ' nodes(2).Device_Name ',
' nodes(3).Device_Name ', ' nodes(4).Device_Name];
x = imread('57.JPG');
broad(1) = struct('simu', x,'stat',status);
end
if num == 5
status = ['Master device is sending data to ' nodes(2).Device_Name ',
' nodes(3).Device_Name ', ' nodes(4).Device_Name ', '
nodes(5).Device_Name];
x = imread('56.JPG');
broad(1) = struct('simu', x,'stat',status);
end
if num == 6
status = ['Master device is sending data to ' nodes(2).Device_Name ',
' nodes(3).Device_Name ', ' nodes(4).Device_Name ', '
nodes(5).Device_Name ', ' nodes(6).Device_Name];
x = imread('55.JPG');
broad(1) = struct('simu', x,'stat',status);
end
if num == 7
status = ['Master device is sending data to ' nodes(2).Device_Name ',
' nodes(3).Device_Name ', ' nodes(4).Device_Name ', '
nodes(5).Device_Name ', ' nodes(6).Device_Name ', '
nodes(7).Device_Name];
x = imread('54.JPG');
broad(1) = struct('simu', x,'stat',status);
end
if num == 8
docsity.com
pf2

Partial preview of the text

Download Function Broadcast-Network Programming-Project Codes and more Study Guides, Projects, Research Network Programming in PDF only on Docsity!

function broad = broadcast(num,nodes)

if num == 1 status = 'There are no devices connected to the Master device'; x = imread('2.JPG'); broad(1) = struct('simu', x,'stat',status); end

if num == 2 status = ['Master device is sending data to ' nodes(2).Device_Name]; x = imread('5.JPG'); broad(1) = struct('simu', x,'stat',status); end

if num == 3 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name]; x = imread('58.JPG'); broad(1) = struct('simu', x,'stat',status); end

if num == 4 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name]; x = imread('57.JPG'); broad(1) = struct('simu', x,'stat',status); end

if num == 5 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name ', ' nodes(5).Device_Name]; x = imread('56.JPG'); broad(1) = struct('simu', x,'stat',status); end

if num == 6 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name ', ' nodes(5).Device_Name ', ' nodes(6).Device_Name]; x = imread('55.JPG'); broad(1) = struct('simu', x,'stat',status); end

if num == 7 status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name ', ' nodes(5).Device_Name ', ' nodes(6).Device_Name ', ' nodes(7).Device_Name]; x = imread('54.JPG'); broad(1) = struct('simu', x,'stat',status); end

if num == 8

docsity.com

status = ['Master device is sending data to ' nodes(2).Device_Name ', ' nodes(3).Device_Name ', ' nodes(4).Device_Name ', ' nodes(5).Device_Name ', ' nodes(6).Device_Name ', ' nodes(7).Device_Name ', ' nodes(8).Device_Name]; x = imread('53.JPG'); broad(1) = struct('simu', x,'stat',status); end

docsity.com