DNS Server
76
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
Network Addresses
Example:
_i16 Status;
SlNetAppDhcpServerBasicOpt_t dhcpParams;
_u8 outLen =
sizeof
(SlNetAppDhcpServerBasicOpt_t);
dhcpParams.lease_time
= 4096;
// lease time (in seconds) of the IP
Address
dhcpParams.ipv4_addr_start =
SL_IPV4_VAL(192,168,1,10);
// first IP Address for allocation
dhcpParams.ipv4_addr_last
=
SL_IPV4_VAL(192,168,1,16);
// last IP Address for allocation.
Status
= sl_NetAppStop(SL_NETAPP_DHCP_SERVER_ID);
// Stop DHCP server before
settings
if
( Status )
{
// error
}
Status
= sl_NetAppSet(SL_NETAPP_DHCP_SERVER_ID, SL_NETAPP_DHCP_SRV_BASIC_OPT, outLen, (_u8*
)&dhcpParams);
if
( Status )
{
// error
}
Status
= sl_NetAppStart(SL_NETAPP_DHCP_SERVER_ID);
// Start DHCP server with new
settings
if
( Status )
{
// error
}
5.6
DNS Server
The SimpleLink device has an internal DNS server which runs in AP mode and Wi-Fi Direct mode (GO).
The DNS server is enabled by default and can be disabled. The DNS server resolves the SimpleLink
device IPv4 address. The default domain name is
mysimplelink
and it can be configured.
Example:
_i16 Status;
Status
= sl_NetAppStop(SL_NETAPP_DNS_SERVER_ID);
// Stop DNS server
if
( Status )
{
// error
}
5.7
Errors and Asynchronous Events
summarizes the major asynchronous events which are part of the NetApp silo event handler
(slcb_NetAppEvtHdlr).
Table 5-4. Major Asynchronous Events in NetApp Silo
Event
Description
STA Role
AP Role
SL_NETAPP_EVENT_IPV4_A
CQUIRED
IPv4 interface is available for
traffic. The event includes IPv4
parameters such as gateway
mask and DNS server address.
After Wi-Fi connection, two
options:
• Immediate event: static
configuration or DHCPv4
opportunistic renew
configuration.
• Delay between the
connection and the event:
DHCPv4, DHCPv4, fast
renew or LLA.
Immediate