Device Function



Reconnect any layers below the top layer which are not in data transfer state.

#include "device.h"

LResult  dev_Unblock
         LDevice  device
devicedevice to unblock

dev_Unblock() is intended to be used for devices in which the top layer is not multiplexed. In this type of device, data transfer takes place through the top protocol layer. If lgo_Read() or lgo_Write() returns lgo_ERROR_TRANSMISSION_BLOCKED when one or more layers below in a device are not in data transfer state. dev_Unblock() can be called in this case to try to fix the device.

Return Values

If successful, dev_Unblock() returns a non-negative value representing the number of bytes written. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:

See Also


if ((result = lgo_Write(cid, buffer, count)) < 0)
    if (result == lgo_ERROR_TRANSMISSION_BLOCKED)
        if ((result = dev_Unblock(majorDevice) < 0)
            LOG("Unblock failure", dev_ErrorMessage(result));