source: ResearchApps/PHY/WARPLAB/ResearchExamples/LTE_Setup/LTE_MATLAB_Reference_Files/1user_mimo/warplab_initialize.m

Last change on this file was 1590, checked in by mduarte, 14 years ago
File size: 1.1 KB
Line 
1function [socketHandles,packetNum] = warplab_initialize(varargin)
2
3% Create arp entry for magic sync
4% we change this manually
5!arp -s 10.0.0.244 ff-ff-ff-ff-ff-ff 10.0.0.200
6
7%Close any stale sockets before trying to create new ones
8pnet('closeall');
9
10% Check length of input argument
11leninput = length(varargin);
12
13% Input argument varargin defines the number of nodes
14if(0 == leninput)
15    % If there is no number of nodes specified then use 2 nodes as default
16    nodes = [1:2];
17else
18    % If there is a number of nodes specified then use that many number of
19    % nodes
20    nodes = [1:1:varargin{1}];
21end
22   
23
24%Define the nodes' IP addresses & UDP ports
25% The IP address and UDP port ranges must match those hardc-coded in the FPGA
26% nodes
27IPAddrs = warplab_IP2int('10.0.0.0') + nodes;
28UDP_Ports = 9000 + nodes-1;
29
30%Define the magic SYNC address; this must match the address hard-coded in the FPGA
31MagicSyncAddr = '10.0.0.244';
32
33%Define an initial packet number
34packetNum = 1;
35
36socketHandles = warplab_initNets(MagicSyncAddr, IPAddrs, UDP_Ports);
37warplab_initNodes(socketHandles);
Note: See TracBrowser for help on using the repository browser.