software/drivers/sd8887/src/wlan/mapp/uaputl/uaputl.c
/**
 *  @brief Converts a string to hex value
 *
 *  @param str      A pointer to the string
 *  @param raw      A pointer to the raw data buffer
 *  @return         Number of bytes read
 */
@brief Converts a string to hex value
@param str      A pointer to the string
@param raw      A pointer to the raw data buffer
@return         Number of bytes read
@brief Converts a string to hex value @param str A pointer to the string @param raw A pointer to the raw data buffer @return Number of bytes read
int
string2raw(char *str, unsigned char *raw)
{
	int len = (strlen(str) + 1) / 2;
	do {
		if (!isxdigit(*str)) {
			return -1;
		}
		*str = toupper(*str);
		*raw = CHAR2INT(*str) << 4;
		++str;
		*str = toupper(*str);
		if (*str == '\0')
			break;
		*raw |= CHAR2INT(*str);
		++raw;
	} while (*++str != '\0');
	return len;
}
int string2raw ( char * str , unsigned char * raw ) { int len = ( strlen ( str ) + 1 ) / 2 ; do { if ( ! isxdigit ( * str ) ) { return -1 ; } * str = toupper ( * str ) ; * raw = CHAR2INT ( * str ) << 4 ; ++ str ; * str = toupper ( * str ) ; if ( * str == ' \0 ' ) break ; * raw |= CHAR2INT ( * str ) ; ++ raw ; } while ( * ++ str != ' \0 ' ) ; return len ; }
@brief Converts a string to hex value
  @param str      A pointer to the string
  @param raw      A pointer to the raw data buffer
  @return         Number of bytes read
@brief Converts a string to hex value @param str A pointer to the string @param raw A pointer to the raw data buffer @return Number of bytes read