2.5.16. TAPOp_CloseConnection

Close a TAPOp connection.


#include “tapop.h”

extern TAPOp_Error TAPOp_CloseConnection(unsigned8 connectId);



Connection ID, as returned by TAPOp_OpenConnection.


The function returns:


No error.


Connection could not be made.


The connectId was not recognized.


The RPC connection was lost while processing thisrequest.


The call attempts to select the connection. If this cannot be done (for example, because another TAP controller is being accessed), the call fails with a TAPOp_UnableToSelect error.

The TAPOp connection is closed and the resources associated with it are released for use by another client. After this call, TAPOp functions must not use this connection ID. TAPOp_DeleteAllMacros is called to remove the macro definitions defined for this connection.


Do not confuse closure of a connection with deselecting a connection, which enables the client to tell the server at what points the hardware can be shared with another client. Deselection occurs when a TAPOp function is called and the deselect parameter is nonzero.


This example demonstrates closing a connection and then closing the base RPC interface in a program that only opens one connection. The TAPCheck macro is not used in this case because the error handling associated with it is inappropriate. Instead, an explicit loop is used, with a simple timeout counter.

    ... declarations
    int timeout = 20;
    // close TAP connection
    do {
        t_err = TAPOp_CloseConnection(connectId);
    } while (t_err == TAPOp_UnableToSelect && timeout-- > 0);
    // close TCP/IP connection

See also

These TAPOp API functions provide similar or related functionality:

Copyright © 1998-2002 ARM Limited. All rights reserved.ARM DUI 0154B