def decode_text_field(buf):
    """
    Convert char[] string in buffer to python str object
    :param buf: bytearray with array of chars
    :return: string
    """
    return buf.decode().strip(b'\x00'.decode())