~hostname should be sufficient with the logic: If ~hostname is set, use TCP, otherwise USB.