Revision aed3754b core/src/aos_shell.c
| core/src/aos_shell.c | ||
|---|---|---|
| 1278 | 1278 |
} |
| 1279 | 1279 |
|
| 1280 | 1280 |
/** |
| 1281 |
* @brief Count the number of commands assigned to the shell. |
|
| 1282 |
* |
|
| 1283 |
* @param[in] shell The shell to count the commands for. |
|
| 1284 |
* |
|
| 1285 |
* @return The number of commands associated to the shell. |
|
| 1286 |
*/ |
|
| 1287 |
unsigned int aosShellCountCommands(aos_shell_t* shell) |
|
| 1288 |
{
|
|
| 1289 |
aosDbgCheck(shell != NULL); |
|
| 1290 |
|
|
| 1291 |
unsigned int count = 0; |
|
| 1292 |
aos_shellcommand_t* cmd = shell->commands; |
|
| 1293 |
while (cmd != NULL) {
|
|
| 1294 |
++count; |
|
| 1295 |
cmd = cmd->next; |
|
| 1296 |
} |
|
| 1297 |
|
|
| 1298 |
return count; |
|
| 1299 |
} |
|
| 1300 |
|
|
| 1301 |
/** |
|
| 1281 | 1302 |
* @brief Add a channel to a AosShellStream. |
| 1282 | 1303 |
* |
| 1283 | 1304 |
* @param[in] stream The AosShellStream to extend. |
| ... | ... | |
| 1303 | 1324 |
* |
| 1304 | 1325 |
* @param[in] stream The AosShellStream to modify. |
| 1305 | 1326 |
* @param[in] channel The channel to remove. |
| 1306 |
* @return |
|
| 1327 |
* |
|
| 1328 |
* @return A status value. |
|
| 1329 |
* @retval AOS_SUCCESS The channel was removed successfully. |
|
| 1330 |
* @retval AOS_ERROR The specified channel was not found to be associated with the shell. |
|
| 1307 | 1331 |
*/ |
| 1308 | 1332 |
aos_status_t aosShellStreamRemoveChannel(AosShellStream* stream, AosShellChannel* channel) |
| 1309 | 1333 |
{
|
Also available in: Unified diff