C API for BALTECH SDK

§ brp_detach_layer()

BRP_LIB brp_protocol brp_detach_layer ( brp_protocol  composite_protocol,
brp_layer_id  layer_id 
)

Removes a protocol from a composite protocol stack without destroying.

After calling this function, the application is responsible for destroying the returned protocol object (expect it was NULL)!

This function ensures, that the detached protocol will be closed. All other layers will be kept open, except the closed protocol was the I/O layer. In the latter case the other protocols will be closed, too.

The protocol layer will keep intact, so that you can insert another protocol at exactly the same position, later when specifing the same layer_id.

Returns
The protocol previously attached to the specified layer ID. If the layer ID is not used yet, or set to NULL, NULL will be returned.
Parameters
composite_protocolcomposite protocol to where layer shall be removed from
layer_ididentification of layer (see BRP_LAYERID_*, i.e. BRP_LAYERID_BRP) which protocol shall be detached