Comments (1)
Hi @sslupsky,
Unfortunately it is not currently possible. The command list item uses the command handler function pointer to decide if it is a command or a group item:
/// Command list item declaration
typedef struct px_cli_cmd_list_item_s
{
px_cli_handler_t handler; ///< Function to be called when command is executed
union
{
const px_cli_cmd_t * cmd; ///< pointer to command (if handler != NULL)
const px_cli_group_t * group; ///< pointer to group (if handler == NULL)
};
} px_cli_cmd_list_item_t;
So if the pointer to the handler function is NULL, it is a group item. This means that a handler function can not be assigned to a group item (in your example the "led" command to display the current state).
I used this trick to make the CLI group / command declaration as compact as possible, because the cmd/group pointer shares the same memory location using the union
keyword.
Best regards,
Pieter
from px-fwlib.
Related Issues (8)
- Running cli_explorer on ATMEL Xplained XMINI -328p HOT 2
- pwm output HOT 2
- Can pix_log be used with configuration file ? HOT 1
- Interrupts Need to be Disabled in this function HOT 1
- Non-standard escape sequences used in px_vt100.h HOT 1
- TAB completion causes px_cli.c code to hang HOT 2
- Bug in px_log_fs HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from px-fwlib.