software/drivers/sd8887/src/wlan/mapp/uaputl/uaputl.c
/**
 *  @brief Provides interface to perform read/write operations on regsiters
 *  @param argc     Number of arguments
 *  @param argv     Pointer to the arguments
 *  @return         UAP_SUCCESS/UAP_FAILURE
 */
@brief Provides interface to perform read/write operations on regsiters
@param argc     Number of arguments
@param argv     Pointer to the arguments
@return         UAP_SUCCESS/UAP_FAILURE
@brief Provides interface to perform read / write operations on regsiters @param argc Number of arguments @param argv Pointer to the arguments @return UAP_SUCCESS / UAP_FAILURE
int
apcmd_regrdwr(int argc, char *argv[])
{
	int opt;
	t_s32 reg;
	int ret = UAP_SUCCESS;
	while ((opt = getopt_long(argc, argv, "+", cmd_options, NULL)) != -1) {
		switch (opt) {
		default:
			print_regrdwr_usage();
			return UAP_SUCCESS;
		}
	}
	argc -= optind;
	argv += optind;
	if ((argc < 2) || (argc > 3)) {
		printf("ERR:wrong arguments.\n");
		print_regrdwr_usage();
		return UAP_FAILURE;
	}
	if ((atoi(argv[0]) != 1) && (atoi(argv[0]) != 2) &&
	    (atoi(argv[0]) != 3)) {
		printf("ERR:Illegal register type %s. Must be either '1','2' or '3'.\n", argv[0]);
		print_regrdwr_usage();
		return UAP_FAILURE;
	}
	reg = atoi(argv[0]);
	ret = apcmd_regrdwr_process(reg, argv[1], argc > 2 ? argv[2] : NULL);
	return ret;
}
int apcmd_regrdwr ( int argc , char * argv [ ] ) { int opt ; t_s32 reg ; int ret = UAP_SUCCESS ; while ( ( opt = getopt_long ( argc , argv , " " , cmd_options , NULL ) ) != -1 ) { switch ( opt ) { default : print_regrdwr_usage ( ) ; return UAP_SUCCESS ; } } argc -= optind ; argv += optind ; if ( ( argc < 2 ) || ( argc > 3 ) ) { printf ( " \n " ) ; print_regrdwr_usage ( ) ; return UAP_FAILURE ; } if ( ( atoi ( argv [ 0 ] ) != 1 ) && ( atoi ( argv [ 0 ] ) != 2 ) && ( atoi ( argv [ 0 ] ) != 3 ) ) { printf ( " \n " , argv [ 0 ] ) ; print_regrdwr_usage ( ) ; return UAP_FAILURE ; } reg = atoi ( argv [ 0 ] ) ; ret = apcmd_regrdwr_process ( reg , argv [ 1 ] , argc > 2 ? argv [ 2 ] : NULL ) ; return ret ; }
@brief Provides interface to perform read/write operations on regsiters
  @param argc     Number of arguments
  @param argv     Pointer to the arguments
  @return         UAP_SUCCESS/UAP_FAILURE
@brief Provides interface to perform read / write operations on regsiters @param argc Number of arguments @param argv Pointer to the arguments @return UAP_SUCCESS / UAP_FAILURE
/* Check arguments */