Revision 916f8d28 core/src/aos_system.c
| core/src/aos_system.c | ||
|---|---|---|
| 357 | 357 |
* |
| 358 | 358 |
* @return An exit status. |
| 359 | 359 |
* @retval AOS_OK The command was executed successfuly. |
| 360 |
* @retval AOS_INVALID_ARGUMENTS There was an issue with the arguemnts.
|
|
| 360 |
* @retval AOS_INVALIDARGUMENTS There was an issue with the arguemnts.
|
|
| 361 | 361 |
*/ |
| 362 | 362 |
static int _shellcmd_configcb(BaseSequentialStream* stream, int argc, char* argv[]) |
| 363 | 363 |
{
|
| 364 | 364 |
aosDbgCheck(stream != NULL); |
| 365 | 365 |
|
| 366 | 366 |
// local variables |
| 367 |
int retval = AOS_INVALID_ARGUMENTS;
|
|
| 367 |
int retval = AOS_INVALIDARGUMENTS; |
|
| 368 | 368 |
|
| 369 | 369 |
// if there are additional arguments |
| 370 | 370 |
if (argc > 1) {
|
| ... | ... | |
| 401 | 401 |
} |
| 402 | 402 |
else {
|
| 403 | 403 |
chprintf(stream, "unknown option '%s'\n", argv[3]); |
| 404 |
return AOS_INVALID_ARGUMENTS;
|
|
| 404 |
return AOS_INVALIDARGUMENTS; |
|
| 405 | 405 |
} |
| 406 | 406 |
} |
| 407 | 407 |
} |
| ... | ... | |
| 470 | 470 |
} |
| 471 | 471 |
else {
|
| 472 | 472 |
chprintf(stream, "unknown option '%s' or invalid value '%s'\n", argv[2], argv[3]); |
| 473 |
return AOS_INVALID_ARGUMENTS;
|
|
| 473 |
return AOS_INVALIDARGUMENTS; |
|
| 474 | 474 |
} |
| 475 | 475 |
dt.tm_wday = aosTimeDayOfWeekFromDate(dt.tm_mday, dt.tm_mon+1, dt.tm_year+1900) % 7; |
| 476 | 476 |
aosSysSetDateTime(&dt); |
| ... | ... | |
| 487 | 487 |
} |
| 488 | 488 |
|
| 489 | 489 |
// print help, if required |
| 490 |
if (retval == AOS_INVALID_ARGUMENTS) {
|
|
| 490 |
if (retval == AOS_INVALIDARGUMENTS) {
|
|
| 491 | 491 |
chprintf(stream, "Usage: %s OPTION\n", argv[0]); |
| 492 | 492 |
chprintf(stream, "Options:\n"); |
| 493 | 493 |
chprintf(stream, " --help\n"); |
| ... | ... | |
| 578 | 578 |
* |
| 579 | 579 |
* @return An exit status. |
| 580 | 580 |
* @retval AOS_OK The command was executed successfully. |
| 581 |
* @retval AOS_INVALID_ARGUMENTS There was an issue with the arguments.
|
|
| 581 |
* @retval AOS_INVALIDARGUMENTS There was an issue with the arguments. |
|
| 582 | 582 |
*/ |
| 583 | 583 |
static int _shellcmd_shutdowncb(BaseSequentialStream* stream, int argc, char* argv[]) |
| 584 | 584 |
{
|
| ... | ... | |
| 603 | 603 |
chprintf(stream, " --restart, -r\n"); |
| 604 | 604 |
chprintf(stream, " Shutdown and restart system.\n"); |
| 605 | 605 |
|
| 606 |
return (argc != 2) ? AOS_INVALID_ARGUMENTS : AOS_OK;
|
|
| 606 |
return (argc != 2) ? AOS_INVALIDARGUMENTS : AOS_OK; |
|
| 607 | 607 |
} |
| 608 | 608 |
// handle argument |
| 609 | 609 |
else {
|
| ... | ... | |
| 629 | 629 |
} |
| 630 | 630 |
else {
|
| 631 | 631 |
chprintf(stream, "unknown argument %s\n", argv[1]); |
| 632 |
return AOS_INVALID_ARGUMENTS;
|
|
| 632 |
return AOS_INVALIDARGUMENTS; |
|
| 633 | 633 |
} |
| 634 | 634 |
} |
| 635 | 635 |
#else /* (AMIROOS_CFG_SSSP_ENABLE == true) */ |
Also available in: Unified diff