Updated Bidirectional Port Code