def METHOD_NAME(ser, message, file, first_read=False):
    # Special per opt handling:
    if "send_telemetry" in message or "set_az_iothub" in message:
        time.sleep(.15)
    elif "exit" in message and first_read:
        time.sleep(serial_settings.wait_for_flash)
        output = ser.in_waiting
        while output < 4:
            time.sleep(1)
            output = ser.in_waiting
            print("%d bytes in waiting" %output)
    if ser.readable():
        output = ser.readline(ser.in_waiting)
        output = output.decode(encoding='utf-8', errors='ignore')
        check_firmware_errors(output)
        check_sdk_errors(output)
        print(output)
        try:
            # File must exist to write to it
            file.writelines(output)
        except:
            pass