
6. LW2 Programmer's Reference
RAP-B511 series
– User's Manual
42
6.3. Network Configuration
6.3.1. Query the Current IP Status
Description
: IP address settings can be queried as follows.
Format
Example
Command {IP_STAT=?}
Response (IP_STAT=<type>;<ip_address>;
<subnet_mask>;<gateway_addr>)CrLf
{ip_stat=?}
(IP_STAT=0;192.168.0.100;
255.255.255.0;192.168.0.1)
Legend
:
<type>:
0 = static IP; 1 = DHCP.
<ip_addr>:
IP address (four decimal octets separated by dots).
<subnet_mask>:
Subnet mask (four decimal octets separated by dots).
<gateway_addr>:
Gateway address (four decimal octets separated by dots).
Explanation
: The device has a static (fix) IP address: 192.168.0.100; the subnet mask is 255.255.255.0, the
gateway address is 192.168.0.1.
6.3.2.
Set the IP Address
Description
: IP address can be set as follows.
Format
Example
Command {IP_ADDRESS=<type>;<ip_address>}
Response (IP_ADDRESS=<type>;<ip_address>)CrLf
{ip_address=0;192.168.0.110}
(IP_ADDRESS=0;192.168.0.110;)
Legend
:
<type>: 0 = static IP; 1 = DHCP
INFO: The IP address can be queried by typing the “ip_address=?” command. The response contains the
fix IP address that is stored in the device even if DHCP is enabled; in this case, this IP address is not valid.
6.3.3.
Set the Subnet Mask
Description
: Subnet mask can be set as follows.
Format
Example
Command {IP_NETMASK=<subnet_mask>}
Response (IP_NETMASK=<subnet_mask>)CrLf
{ip_netmask=255.255.255.0}
(IP_NETMASK=255.255.255.0)
Legend
:
<subnet_mask>:
Four decimal octets separated by dots.
INFO: The subnet mask can be queried by typing the “ip_address=?” command. The response contains
the fix IP subnet mask that is stored in the device even if DHCP is enabled; in this case, this IP subnet
mask is not valid.
6.3.4.
Set the Gateway Address
Description
: Gateway address can be set as follows.
Format
Example
Command {IP_GATEWAY=<gateway_addr>}
Response (IP_GATEWAY=<gateway_addr>)CrLf
{ip_gateway=192.168.0.50}
(IP_GATEWAY=192.168.0.50)
Legend
:
<gateway_addr>:
Four decimal octets separated by dots.
INFO: The gateway address can be queried by typing the “ip_gateway=?” command. The response contains
the static IP gateway address that is stored in the device even if DHCP is enabled. In that case, the latest
valid gateway address (for static IP) is stored.
6.3.5.
Apply Network Settings
Description
: Apply the network settings and restart the network interface.
Format
Example
Command {ip_apply}
Response (IP_APPLY)CrLf
{ip_apply}
(IP_APPLY)
6.4. GPIO Configuration
6.4.1.
Set Level and Direction for Each Pins
Description
: GPIO pins can be configured as follows. See more details about GPIO connector in the section
and about the interface in the section.
Format
Example
Command {GPIO<pin_nr>=<dir>;<level>}
Response (GPIO<pin_nr>=<dir>;<level>)CrLf
{gpio1=O;H}
(GPIO1=O;H)
Legend
:
Parameter <dir>
Description
I
Input
O
Output
Parameter <level>
Description
L
Low
H
High
T
Toggle
Explanation
: GPIO pin 1 is set to output with high level.
INFO: The current GPIO pin configuration can be queried by typing the {GPIO<pin_nr>=?} command.
<pin_nr>:
GPIO pin number 1...3
<dir>:
The direction of the communication, it can be input or output.
<level>:
The level of the pin, it can be low or high.