dev_Fix()
Fix a device reported broken by dev_Check()
#include "device.h" LResult dev_Fix ( LDevice device );
device | device to fix |
dev_Fix() should be called immediately after a device has been reported broken by dev_Check(). dev_Fix() will attempt to reconnect the layer reported disconnected by dev_Check().
If successful, dev_Fix() returns a non-negative value. Otherwise, it returns a negative value indicating the reason it failed. Possible unsuccessful return values are:
if ((result = dev_Check(device)) < 0) { LOG("Device check failed", lgo_ProtocolMessage(result)); } else if (result != 0) { LOG("Device failure"); if (dev_Fix(device) < 0) { LOG("Cannot restore service"); } else { LOG("Service restored"); } } else { LOG("Device OK"); }