Specifications
vmStat(statusCode, args…) – Invoke “status” callbacks
This function is specialized for management applications (like Portal), and provides a range of
control/callback functionality.
Parameter statusCode controls what actions will be taken, and what data will be returned (via a
tellVmStat() callback to the original node).
The currently supported statusCode values are:
0 = VM_RESET: stop the SNAPpy Virtual Machine (for script uploading)
1 = VM_IMG_ERASE: erase the current SNAPpy script
2 = VM_WR_BLK: used when uploading scripts – DO NOT CALL THIS!
3 = VM_INIT: restart the SNAPpy Virtual Machine (after script uploading)
4 = VM_NVREAD: read the specified NV Parameter
5 = VM_NAME: returns NODE NAME if set, else IMAGE NAME, plus Link Quality
6 = VM_VERSION: returns software version number
7 = VM_NET: returns Network ID and Channel
8 = VM_SPACE: returns Total Image (script) Space Available
9 = VM_SCAN: scans all 16 channels for energy, returns 16 character string
10 = VM_INFO: returns Image Name (script name) and Link Quality
You probably should not be invoking vmStat() with status codes of 0-3 (unless you are implementing
your own downloader). Status codes 4-10 are safe to call.
After the statusCode, the next argument varies (depending on the statusCode).
After the “varying” argument comes a final optional argument that specifies a “time window” to
randomly reply within. (More about this below.)
For VM_NVREAD, the second argument is the ID of the NV Parameter you want to read (these are
the same IDs used in the saveNvParam() and loadNvParam() functions). You can also optionally
specify a "reply window."
The “system” NV Parameter IDs are given in section 8.
The reported values will be a "hiByte" of the NV Parameter ID, and a "data" of the actual NV
Parameter value.
For VM_NAME, the only parameter is the optional reply window.
The reported “data” value will be a string name and a Link Quality reading.
For VM_VERSION, the only parameter is the optional reply window.
The reported “data” value will be a version number string
SNAP Reference Manual Document Number 600-0007K Page 79 of 202