NetModule NB3700 User Manual page 99

Hide thumbs Also See for NB3700:
Table of Contents

Advertisement

16. Create your own web pages
17. Voice control functions
18. SNMP functions
19. CAN socket functions
20. Various network-related functions
21. Other system-related functions
The SDK API manual (which can be downloaded from the router) provides an overview
but also explains all functions in detail.
Please note that some functions require the corresponding services (e.g. E-Mail, SMS)
to be properly configured prior to utilizing them in the SDK.
Let's now pay some attention to the very powerful API function nb_status. It can
be used to query the router's status values in the same manner as they can be shown
with the CLI. It returns a structure of variables for a specific section (a list of available
sections can be obtained by running cli status -h).
By using the dump function you can figure out the content of the returned structure:
/* dump current location */
dump ( nb_status (
" location "
The script will then generate lines like maybe these:
struct(8): {
.LOCATION_STREET
.LOCATION_CITY
.LOCATION_COUNTRY_CODE = string[2]: "ch"
.LOCATION_COUNTRY
.LOCATION_POSTCODE
.LOCATION_STATE
.LOCATION_LATITUDE
.LOCATION_LONGITUDE
}
In combination with the nb_config_set function, it is possible to start a re-configuration
of any parts of the system upon status changes. You may query possible sections and
parameters again with the CLI:
~ $ cli get -c wanlink.0
Showing configuration sections (matching 'wanlink.0'):
NB3700 User Manual 3.8
) ) ;
= string[11]: "Bahnhofquai"
= string[10]: "Zurich"
= string[11]: "Switzerland"
= string[4]: "8001"
= string[6]: "Zurich"
= string[9]: "47.3778058"
= string[8]: "8.5412757"
99

Hide quick links:

Advertisement

Table of Contents
loading

Table of Contents