Domain Name
34
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
Device
If no device URN name is set, the default name is mysimplelink. If setting the device name with length 0,
the device returns to the default name mysimplelink. This configuration is persistent according to the
system-persistent configuration.
Example:
/* set new device name */
_i16 Status;
_u8 *device_name =
"MY-SIMPLELINK-DEV"
;
Status = sl_NetAppSet (SL_NETAPP_DEVICE_ID,SL_NETAPP_DEVICE_URN, strlen(device_name), (_u8 *)
device_name);
if
( Status )
{
/* error */
}
3.10 Domain Name
The domain name is used to access the SimpleLink Wi-Fi device by name, for example accessing the
HTTP server in AP mode. If no domain name is set, the default domain name is www.mysimplelink.net or
mysimplelink.net. This configuration is persistent according to system-persistent configuration.
Example:
/* set new domain name */
_i16 Status;
_u8 *domain_name =
"www.myDomain.net"
;
Status = sl_NetAppSet(SL_NETAPP_DEVICE_ID,SL_NETAPP_DEVICE_DOMAIN,strlen(domain_name),(_u8 *)
domain_name);
if
( Status )
{
/* error */
}
3.11 Device Status
The SimpleLink Wi-Fi device provides an option to read the device status according to the last event
recorded in the SimpleLink device per API silo. The status is clear on read.
This option has two main return values:
•
Device status
•
Asynchronous events
Example:
_i16 Status;
_u32 statusWlan;
_u8 pConfigOpt;
_u16 pConfigLen;
pConfigOpt = SL_DEVICE_EVENT_CLASS_WLAN;
pConfigLen =
sizeof
(_u32);
Status
= sl_DeviceGet(SL_DEVICE_STATUS,&pConfigOpt,&pConfigLen,(_u8 *)(&statusWlan));
if
(SL_DEVICE_STATUS_WLAN_STA_CONNECTED & statusWlan )
{
/* The device is connected */
}
if
(SL_DEVICE_EVENT_DROPPED_WLAN_RX_FILTERS & statusWlan )
{
/* RX filer event dropped */
}
The full list of possible values for possible device status or asynchronous events can be found in the host
driver.