This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

setAddress

Change IP address, subnet mask, or gateway used by radio hardware

Syntax

setAddress(dev,'IPAddress',IPAddress)
setAddress(dev,'IPAddress',IPAddress,Name,Value)

Description

example

setAddress(dev,'IPAddress',IPAddress) changes the IP address of the radio hardware specified by dev.

setAddress automatically restarts the radio hardware from the SD card and the new IP address takes effect immediately upon restart.

example

setAddress(dev,'IPAddress',IPAddress,Name,Value) uses additional options specified by one or more name-value pair arguments. Use these options to change the subnet mask and gateway of the radio hardware specified by dev.

Examples

collapse all

Create a radio object. Change the default IP address.

dev = sdrdev('E310');
setAddress(dev,'IPAddress','192.168.3.10');

If the new IP address has a different subnet than the old IP address, update the host network connection. See Step 3. Configure Host Computer of the manual setup instructions.

Create a radio object. Change the default IP address and specify a new subnet mask.

dev = sdrdev('E310');
setAddress(dev,'IPAddress','192.168.3.10', ...
           'SubnetMask','/23');

If the new IP address has a different subnet than the old IP address, update the host network connection. See Step 3. Configure Host Computer of the manual setup instructions.

Create a radio object. Change the default IP address and specify a new gateway.

dev = sdrdev('E310');
setAddress(dev,'IPAddress','192.168.2.3', ...
           'Gateway','192.168.2.1');

If the new IP address has a different subnet than the old IP address, update the host network connection. See Step 3. Configure Host Computer of the manual setup instructions.

Input Arguments

collapse all

Interface to radio hardware, specified as a comm.SDRDevE310 radio object. To create this object, use the sdrdev function.

New IP address of the radio hardware, specified as a dotted-quad character vector.

Example: 'IPAddress','192.168.30.2'

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

Example: 'SubnetMask','/23','Gateway','192.168.2.1' specifies that setAddress updates the subnet mask and gateway for the new IP address of the radio hardware.

New subnet mask, specified as the comma-separated pair consisting of 'SubnetMask' and a character vector using the CIDR format.

Example: 'SubnetMask','/23'

New gateway, specified as the comma-separated pair consisting of 'Gateway' and a dotted-quad character vector.

Example: 'Gateway','192.168.2.1'

Tips

The host network connection must be on the same subnet as the radio hardware. If the new IP address has a new subnet, update the host network connection. See Step 3. Configure Host Computer of the manual setup instructions.

Introduced in R2016b