# Retrieve the attribute value of a hfp device
find_attr() {
    local node=$1
    local attribute=$2
    local p=$3

    while [ "$p" != "/sys" ]
    do
        case $(basename "$p") in
            $node)
                cat "$p/$attribute"
                return 0
        esac
        p="$(dirname "$p")"
    done

    return 1
}

