Device Function

Detach

dev_Detach()

Detaches all layers in the device.

Syntax
#include "device.h"

LResult  dev_Detach
    (
         LDevice    device
    );
devicedevice to
Description

dev_Detach() attempts to detach all layers in a device. dev_Detach() does not detach from the top layer unless it is a multiplex layer. If it is not a multiplex layer, it is the layer through which data will be read and written.

Return Values

If successful, dev_Detach() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also

dev_Attach()

Example
if ((result = dev_Connect(device)) < 0)
{
    LOG("Connect failure", dev_ErrorMessage(result));
}
else
{
    if ((result = dev_Detach(device)) < 0)
    {
        LOG("Detach failure", dev_ErrorMessage(result));
    }
}