本文整理汇总了C++中Shell_check_help_request函数的典型用法代码示例。如果您正苦于以下问题:C++ Shell_check_help_request函数的具体用法?C++ Shell_check_help_request怎么用?C++ Shell_check_help_request使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了Shell_check_help_request函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Shell_decrease_volume
/******************************************************************************
* @name Shell_decrease_volume
*
* @brief Servers the decrease volume command
*
* @param None
*
* @return None
*
******************************************************************************
* This function is used to decrease volume of the audio device
*****************************************************************************/
int32_t Shell_decrease_volume(int32_t argc,char *argv[])
{
bool print_usage = TRUE, shorthelp = FALSE;
print_usage = Shell_check_help_request (argc, argv, &shorthelp);
if (!print_usage)
{
if (argc > 1)
{
printf (" Error: Channel parameter is too large\n");
return (SHELL_EXIT_ERROR);
}
else
{
audio_decrease_volume_command();
}
}
else
{
if (shorthelp)
{
printf("%s\n", argv[0]);
}
else
{
printf("Usage: %s\n", argv[0]);
}
}
return(SHELL_EXIT_SUCCESS);
}
示例2: Shell_exit
int32_t Shell_exit(int32_t argc, char *argv[] )
{
bool print_usage, shorthelp = FALSE;
int32_t return_code = SHELL_EXIT_SUCCESS;
SHELL_CONTEXT_PTR shell_ptr = Shell_get_context( argv );
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage) {
shell_ptr = Shell_get_context( argv );
shell_ptr->EXIT = TRUE;
if (shell_ptr->COMMAND_FP != stdin) {
fclose(shell_ptr->COMMAND_FP);
}
}
if (print_usage) {
if (shorthelp) {
printf("%s\n", argv[0]);
} else {
printf("Usage: %s\n", argv[0]);
}
}
return return_code;
} /* Endbody */
示例3: Shell_get_module
int_32 Shell_get_module(int_32 argc, char_ptr argv[] )
{
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage)
{
if (argc > 2)
{
printf("Error, invalid number of parameters\n");
return_code = SHELL_EXIT_ERROR;
print_usage = TRUE;
}
else
{
if (argc == 1)
{
printf("Module %d active.\n", _bsp_btnled_get_twrpi());
}
}
}
if (print_usage)
{
printf("Usage: %s \n", argv[0]); /* show in help command */
}
return return_code;
}
示例4: Shell_mute
/******************************************************************************
* @name Shell_mute
*
* @brief Servers the mute command
*
* @param None
*
* @return None
*
******************************************************************************
* This function is used to mute the audio device
*****************************************************************************/
int32_t Shell_mute(int32_t argc, char *argv[])
{
bool print_usage, shorthelp = FALSE;
print_usage = Shell_check_help_request (argc, argv, &shorthelp);
if (!print_usage)
{
if (argc > 1)
{
printf(" Error: This command doesn't need parameters\n");
return (SHELL_EXIT_ERROR);
}
else
{
audio_mute_command();
}
}
if (print_usage)
{
if (shorthelp)
{
printf("%s\n", argv[0]);
}
else
{
printf("Usage: %s\n", argv[0]);
}
}
return(SHELL_EXIT_SUCCESS);
}
示例5: Shell_bootloader_go_image
int_32 Shell_bootloader_go_image(int_32 argc, char_ptr argv[] )
{ /* Body */
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage) {
_autoboot_cmd = AUTOBOOT_DISABLE;
_image_index = _io_atoi(argv[1]);
if(_bootloader_check_image(FALSE,_image_index)) {
printf("\nStarting application at image:%d\n",_image_index);
_mqx_exit(0);
}
else {
printf("\nError no image found !\n");
}
}
if (print_usage) {
if (shorthelp) {
printf("%s [<index>] \n", argv[0]);
} else {
printf("Usage: %s [<index>] \n", argv[0]);
printf(" <index> = image index in memory table \n");
}
}
}
示例6: Shell_Clock_server_start
int_32 Shell_Clock_server_start(int_32 argc, char_ptr argv[] )
{
uint_32 result;
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage) {
if (argc == 1) {
result =RTCS_task_create("Clock_server", SHELL_CLOCK_SERVER_PRIO,
SHELL_CLOCK_SERVER_STACK, Clock_server_task, NULL);
if (result == 0) {
printf("Clock Server Started.\n");
} else {
printf("Unable to start Clock Server, error = 0x%x\n",result);
return_code = SHELL_EXIT_ERROR;
}
} else {
printf("Error, %s invoked with incorrect number of arguments\n", argv[0]);
print_usage = TRUE;
}
}
if (print_usage) {
if (shorthelp) {
printf("%s \n", argv[0]);
} else {
printf("Usage: %s\n",argv[0]);
}
}
return return_code;
} /* Endbody */
示例7: Shell_decrease_volume
/******************************************************************************
* @name Shell_decrease_volume
*
* @brief Servers the decrease volume command
*
* @param None
*
* @return None
*
******************************************************************************
* This function is used to decrease volume of the audio device
*****************************************************************************/
int_32 Shell_decrease_volume(int_32 argc,char_ptr argv[])
{
boolean print_usage = TRUE, shorthelp = FALSE;
volatile static uint_16 cur_volume, min_volume;
print_usage = Shell_check_help_request (argc, argv, &shorthelp);
if (!print_usage)
{
if (argc > 1)
{
printf (" Error: Channel parameter is too large\n");
return (SHELL_EXIT_ERROR);
}
else
{
audio_decrease_volume_command();
}
}
else
{
if (shorthelp)
{
printf("%s\n", argv[0]);
}
else
{
printf("Usage: %s\n", argv[0]);
}
}
return(SHELL_EXIT_SUCCESS);
}
示例8: Shell_FTP_client
int_32 Shell_FTP_client(int_32 inargc, char_ptr inargv[] )
{
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
print_usage = Shell_check_help_request(inargc, inargv, &shorthelp );
if (!print_usage) {
if (inargc > 2) {
printf("Error, %s invoked with incorrect number of arguments\n", inargv[0]);
print_usage = TRUE;
} else {
FTP_client(inargv[1] );
}
}
if (print_usage) {
if (shorthelp) {
printf("%s [<host>]\n", inargv[0]);
} else {
printf("Usage: %s [<host>]\n", inargv[0]);
printf(" <host> = host ip address or name\n");
}
}
return return_code;
} /* Endbody */
示例9: Shell_command_list
int_32 Shell_command_list(int_32 argc, char_ptr argv[] )
{ /* Body */
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
SHELL_CONTEXT_PTR shell_ptr = Shell_get_context( argv );
SHELL_COMMAND_PTR command_ptr;
uint_32 i;
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage) {
if (argc==1) {
for (i=0,command_ptr = shell_ptr->COMMAND_LIST_PTR;
command_ptr->COMMAND != NULL;
i++,command_ptr++)
{
printf("%-8s ", command_ptr->COMMAND);
if ((i&7)==7) printf("\n");
} /* Endwhile */
if ((i&7)!=0) printf("\n");
} else {
print_usage = TRUE;
}
}
if (print_usage) {
if (shorthelp) {
printf("%s\n", argv[0]);
} else {
printf("Usage: %s\n", argv[0]);
}
}
return return_code;
} /* Endbody */
示例10: Shell_ledoff
/*
* Turn off LED1 or LED2.
*/
int_32 Shell_ledoff(int_32 argc, char_ptr argv[] )
{
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage)
{
if (argc !=2 )
{
printf("Error, invalid number of parameters\n");
return_code = SHELL_EXIT_ERROR;
print_usage=TRUE;
}
else
{
/* Read in command line argument to determine LED to turn on */
if(argv[1][0]=='1' && argv[1][1]=='\0')
SEC_SetOutput(SEC_LED1_OUTPUT, 0);
else if(argv[1][0]=='2' && argv[1][1]=='\0')
SEC_SetOutput(SEC_LED2_OUTPUT, 0);
else if(argv[1][0]=='3' && argv[1][1]=='\0')
SEC_SetOutput(SEC_LED3_OUTPUT, 0);
else
printf("Invalid Argument. Must be '1', '2' or '3'\n");
}
}
if (print_usage) {
print_usage_led (shorthelp, argv[0], "<LED number> = Turn off LED1, LED2 or LED3");
}
return return_code;
}
示例11: Shell_status
/*
* Print out current value of push buttons, if board is moving or tiled,
* the value of the potentiometer, and the elapsed time since bootup
*/
int_32 Shell_status(int_32 argc, char_ptr argv[] )
{
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
int pot;
TIME_STRUCT time;
DATE_STRUCT date;
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage)
{
if (argc > 1)
{
printf("Error, invalid number of parameters\n");
return_code = SHELL_EXIT_ERROR;
print_usage=TRUE;
}
else
{
/* Print out 'Door' status */
printf("Door (SW2): ");
if(SEC_GetDoorStatus()==OPENED)
printf("Open\n");
else
printf("Closed\n");
/* Print out 'Window' status */
printf("Window (SW3): ");
if(SEC_GetWindowStatus()==OPENED)
printf("Open\n");
else
printf("Closed\n");
/* Print out movement/tilt status */
printf("Motion Detection: ");
if(SEC_GetMovementStatus()==MOVING)
printf("Movement\n");
else
printf("No Movement\n");
/* Print out potentiometer percentage in 10% increments */
pot = (SEC_Params.GarageStatus / 409) * 10;
printf("Garage Door (Potentiometer R2): %d%% Open\n",pot);
/* Print out elapsed time since bootup */
_time_get(&time);
_time_to_date(&time,&date);
printf("Time Since Bootup: %02d:%02d:%02d\n\n",date.HOUR,date.MINUTE,date.SECOND);
}
}
if (print_usage)
{
print_usage_simple (shorthelp, argv[0], "Display security system status");
}
return return_code;
}
示例12: Shell_arpdel
int_32 Shell_arpdel(int_32 argc, char_ptr argv[] )
{ /* Body */
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
_ip_address ipaddr;
_rtcs_if_handle ihandle = ipcfg_get_ihandle (BSP_DEFAULT_ENET_DEVICE);
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage) {
if (argc != 2) {
return_code = SHELL_EXIT_ERROR;
print_usage = TRUE;
} else if (! Shell_parse_ip_address( argv[1], &ipaddr)) {
printf("Error, invalid ip address\n");
return_code = SHELL_EXIT_ERROR;
}
if (return_code == SHELL_EXIT_SUCCESS) {
RTCS_arp_delete(ihandle,ipaddr);
}
}
if (print_usage) {
if (shorthelp) {
printf("%s <ip_address>\n", argv[0]);
} else {
printf("Usage: %s <ip_address> \n", argv[0]);
printf(" <ip_address> = IP Address\n");
}
}
return return_code;
} /* Endbody */
示例13: Shell_bootloader_list_image
int_32 Shell_bootloader_list_image(int_32 argc, char_ptr argv[] )
{ /* Body */
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage) {
if (argc != 1) {
printf("Error, invalid number of parameters\n");
return_code = SHELL_EXIT_ERROR;
print_usage=TRUE;
}
else {
_bootloader_list_image();
}
}
if (print_usage) {
if (shorthelp) {
printf("%s\n", argv[0]);
} else {
printf("Usage: %s ", argv[0]);
printf(" <%s> to list image table\n",argv[0]);
}
}
} /* Endbody */
示例14: Shell_arpdisp
int_32 Shell_arpdisp(int_32 argc, char_ptr argv[] )
{ /* Body */
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
_rtcs_if_handle ihandle = ipcfg_get_ihandle (BSP_DEFAULT_ENET_DEVICE);
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage) {
if (argc > 2) {
return_code = SHELL_EXIT_ERROR;
print_usage = TRUE;
} else {
ARP_display_if_table(ihandle);
}
}
if (print_usage) {
if (shorthelp) {
printf("%s [<ihandle>]\n", argv[0]);
} else {
printf("Usage: %s [<ihandle>] \n", argv[0]);
printf(" <ihandle> = Interface handle\n");
}
}
return return_code;
} /* Endbody */
示例15: Shell_bootloader_del_image
int_32 Shell_bootloader_del_image(int_32 argc, char_ptr argv[] )
{ /* Body */
boolean print_usage, shorthelp = FALSE;
int_32 return_code = SHELL_EXIT_SUCCESS;
uint_32 index, block, result;
print_usage = Shell_check_help_request(argc, argv, &shorthelp );
if (!print_usage) {
if ((argc < 2) || (argc >= 3)) {
printf("Error, invalid number of parameters\n");
return_code = SHELL_EXIT_ERROR;
print_usage=TRUE;
}
else
{
index = _io_atoi(argv[1]);
_bootloader_del_image(index);
}
}
if (print_usage) {
if (shorthelp) {
printf("%s <index> \n", argv[0]);
} else {
printf("Usage: %s <index> \n", argv[0]);
printf(" <index> = index of image to delete\n");
}
}
}