def extract_value(value):
    """
    Given UAVCAN Value object, returns the value and its type
    """
    if   hasattr(value, 'boolean_value'): return (bool(value.boolean_value), bool)
    elif hasattr(value, 'integer_value'): return (int(value.integer_value), int)
    elif hasattr(value, 'real_value'):    return (float(value.real_value), float)
    elif hasattr(value, 'string_value'):  return (str(value.string_value), str)
    else:                                 return (None, None)