mirror of
https://github.com/open-sdr/openwifi.git
synced 2025-05-29 05:34:28 +00:00
Add value print only option to side_ch_ctl.c:
When two arguments are input (no matter the exact value/form of the 2nd input), the side_ch_ctl will print value only to ease some bash script to call/use further (avoid extra parsing while extra info present)
This commit is contained in:
parent
ce26cc15c7
commit
e557222ed1
@ -288,17 +288,22 @@ int main(const int argc, char * const argv[])
|
|||||||
unsigned int reg_val, *cmd_buf;
|
unsigned int reg_val, *cmd_buf;
|
||||||
unsigned short port;
|
unsigned short port;
|
||||||
struct sockaddr_in server;
|
struct sockaddr_in server;
|
||||||
|
int value_only_flag = 0;
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (argc!=2) {
|
if (argc<2) {
|
||||||
printf("Wrong input!\n");
|
printf("1 argument is needed!\n");
|
||||||
print_usage();
|
print_usage();
|
||||||
return(ret);
|
return(ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
value_only_flag = (argc>2?1:0);
|
||||||
|
|
||||||
ret = parse_para_string(argv[1], &action_flag, ®_type, ®_idx, ®_val, &interval_ms);
|
ret = parse_para_string(argv[1], &action_flag, ®_type, ®_idx, ®_val, &interval_ms);
|
||||||
printf("parse: ret %d\n", ret);
|
if (value_only_flag==0) {
|
||||||
printf(" tx: action_flag %d reg_type %d reg_idx %d reg_val %u interval_ms %d\n", action_flag, reg_type, reg_idx, reg_val, interval_ms);
|
printf("parse: ret %d\n", ret);
|
||||||
|
printf(" tx: action_flag %d reg_type %d reg_idx %d reg_val %u interval_ms %d\n", action_flag, reg_type, reg_idx, reg_val, interval_ms);
|
||||||
|
}
|
||||||
if (ret<0) {
|
if (ret<0) {
|
||||||
printf("Wrong input!\n");
|
printf("Wrong input!\n");
|
||||||
print_usage();
|
print_usage();
|
||||||
@ -383,7 +388,10 @@ int main(const int argc, char * const argv[])
|
|||||||
// printf("num_dma_symbol %d\n", side_info_size/8);
|
// printf("num_dma_symbol %d\n", side_info_size/8);
|
||||||
|
|
||||||
if (action_flag!=ACTION_SIDE_INFO_GET) {
|
if (action_flag!=ACTION_SIDE_INFO_GET) {
|
||||||
printf(" rx: size %d val %d 0x%08x\n", side_info_size, cmd_buf[0], cmd_buf[0]);
|
if (value_only_flag==0)
|
||||||
|
printf(" rx: size %d val %d 0x%08x\n", side_info_size, cmd_buf[0], cmd_buf[0]);
|
||||||
|
else
|
||||||
|
printf("%u\n", cmd_buf[0]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user