English
Language : 

ZAURA Datasheet, PDF (74/99 Pages) –
ZAURA RF Wireless Library
Programmer’s Reference Manual
62
Creating User-Defined ZAURA RF Shell Commands
The ZAURA RF Shell Library provides a set of utility functions and
global variables that applications can use to build custom shell com-
mands. To implement a user-defined shell command, it is necessary to
understand how the ZAURA RF Shell Library processes ASCII text from
the console.
As a user enters characters on the console, the ZAURA RF Shell Library
buffers these characters and increments a global counter to track the num-
ber of characters entered (ZAURA_RF_UartAvail). After the user presses
the Enter key, the Shell Library detects a carriage return in the console
input stream and sets the ZAURA_RF_UartEOL flag to TRUE to indicate
that a command line has been received.
Applications that use the ZAURA RF Shell must monitor the
ZAURA_RF_UartEOL flag and call ZAURA_RF_ShellProcessCmdLine
at noninterrupt time to allow the Shell Library to interpret the command
just entered.
Note: After the ZAURA_RF_UartEOL flag is set to TRUE, the Shell Library
stops buffering console input. Therefore, applications should call
ZAURA_RF_ShellProcessCmdLine soon after this flag is set to avoid lost
console input. Alternatively, the console program can be configured to
insert delays between command lines.
The ZAURA_RF_ShellProcessCmdLine function parses the console
input into space-delimited tokens that are referenced by the
pZAURA_RF_Tokens array. The first token (at index 0 in
pZAURA_RF_Tokens array) is always the name of the console com-
mand, and the remaining tokens (if any) point to user-supplied parame-
ters.
Example. If the user enters test 1 2 3 on the console, the ZAURA RF
Shell will recognize 4 tokens. The first token contains the value test and
ZAURA RF Wireless Shell API Reference
RM006003-1011