Info |
---|
This section refers to the following sample application(s):
|
Table of Contents |
---|
The
Include Page | ||||
---|---|---|---|---|
|
...
Note |
---|
To be able to see the "Hello, World!" message, connect a terminal client (such as PuTTY or TeraTerm) to the CLI serial interface of your device. Refer to the SmartMesh IP Tools Guide for information about the different serial ports. |
When the mote boots, you see the following on your terminal client:
No Format |
---|
> Hello, World! |
The
Include Page | ||||
---|---|---|---|---|
|
help
to see the default CLI commands:No Format |
---|
> Hello, World! > > help help <command> Commands: mtrace mset mget minfo mlog mfs mseti mgeti mshow mxtal mhwlog > |
Note |
---|
By convention, all default CLI commands start with the letter "m", for "mote". |
You can issue the command minfo
to obtain general information about the state of the device:
No Format |
---|
> minfo Net stack v1.2.1.3 state: Idle mac: 00:17:0d:00:00:38:0f:47 moteid: 0 netid: 423 blSwVer: 13 ldrSwVer: 1.0.3.12 UTC time: 0:0 reset st: 200 |
You can use the command mset
to configure a number of elements of the
Include Page | ||||
---|---|---|---|---|
|
No Format |
---|
> mset netid 477 |
This setting is stored in non-volatile memory. After a reboot of the device, you can verify that the setting is still present.
No Format |
---|
> Hello, World! > mget netid netid = 477 |
Tip |
---|
Refer to the SmartMesh IP Manager Mote CLI Guide for a description of these commands. |
Implementation Details
The 00-hello
sample application initializes the CLI Module, before printing "Hello, World!" over it. Initialization involves:
- opening the CLI module by calling
dnm_ucli_openPort()
; - raising the default access level to
DN_CLI_ACCESS_USER
so the user can issue CLI commands such asmset
; - create a channel to receive CLI notifications;
- initialize the CLI Module.
- continuously call the (blocking)
dnm_loc_processNotifications()
to process received CLI command.
Tip |
---|
These operations are so common that we built the simple The |