Make sure the device is enabled before trying to send commands to it.

This commit is contained in:
Tambet Ingo
2008-09-15 17:20:00 +03:00
parent f570e1517d
commit 8e1cabbefc

View File

@@ -280,6 +280,12 @@ mm_serial_send_command (MMSerial *self,
const char *s;
int status;
if (priv->fd == 0) {
g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_SEND_FAILED,
"%s", "Sending command failed: device is not enabled");
return FALSE;
}
if (mm_serial_is_connected (self)) {
g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_SEND_FAILED,
"%s", "Sending command failed: device is connected");