Device Parameter Querying Through HTTP (Device Tokens)
147
SWRU455A – February 2017 – Revised March 2017
Copyright © 2017, Texas Instruments Incorporated
HTTP Server
9.5.1 Retrieving Tokens Through GET Request
A token value may be retrieved by an HTTP GET request whose target is the token name. These requests
must have the encoding of
application/x-www-form-urlencoded
. Only one parameter can be queried in
each HTTP GET request.
9.5.2 Embedded Tokens
The HTTP server automatically replaces token names with their values when it serves files from the file
system or ROM. For example, if a text file is created on the file system under the path
/www/example.txt
with the content:
Device hardware version: __SL_G_V.D
Device network version: __SL_G_V.A
Then a GET request to
mysimplelink.net /example.txt
returns the following text:
Device hardware version: 20000000
Device network version:
3.92.1.1
The tables in the following sections specify all supported tokens.
9.5.3 System Information
lists the system information tokens.
Table 9-14. System Information Tokens
Token
Name
Value and Usage
__SL_G_S.A
System Up Time
Returns the system up time since the last
reset in the following format:
000 days 00:00:00
__SL_G_S.B
Device Name (URN)
Returns device name
__SL_G_DNP
Device Name
Returns device name + MAC address (as
string) if the default device name is set.
__SL_G_S.C
Domain Name
Returns domain name
__SL_G_S.D
Device Mode (role)
Returns device role.
Values: Station, Access Point, P2P
__SL_G_S.E
Device Role Station
Drop-down menu select/not select
Returns selected if device is station, else it
returns not_selected.
__SL_G_S.F
Device Role AP
Drop-down menu select/not select
Returns selected if device is AP, else it
returns not_selected.
__SL_G_S.G
Device Role P2P
Drop-down menu select/not select
Returns selected if device is in P2P, else
it returns not_selected.
__SL_G_S.H
Device Name URN (truncated to 16 bytes) Returns the URN string name with up to
16 bytes length. Longer names will be
truncated.
__SL_G_S.I
System requires reset (after parameters
change)
If system requires reset, return value will
be the following string: "-- Some
parameters were changed, System may
require reset --" else it returns an empty
string.
(Every internal post that was handled will
cause this token to return TRUE.)
__SL_G_S.J
Get System Time and Date
Returned value is a string with the
following format:
year, month, day, hours, minutes, seconds
__SL_G_S.K
Safe Mode Status
If device is in safe mode – return Safe
Mode, if not return empty string.