#!/bin/bash

usage="
        Usage: $(basename "$0") <uhd-arg-string> [-h]
      Example: $(basename "$0") name=myB210
Functionality: Test the USB rate for the specified USRP device.

      Options:
	-h		Show usage information
"

while getopts 'h' OPT; do
    case $OPT in
        h)
            echo "$usage"
			exit 1
    esac
done

if [[ $# == 0 ]]; then
	argString="all"
else
  argString=$1
fi



TMP=$(mktemp)
var=$(uhd_usrp_probe --args=$argString --init-only 2>"$TMP")
cat "$TMP" | grep -oe "USB [2|3]" | grep -oe "[1|2|3]"
rm "$TMP"