diff --git a/src/device.c b/src/device.c index eaa9570..894e068 100644 --- a/src/device.c +++ b/src/device.c @@ -633,6 +633,7 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, c strncpy( serialnumber, &result[15], 20 ); } + if( *bus == 0 ) { if( strstr( result, "Transport protocol:" ) != 0 ) @@ -645,6 +646,18 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, c *bus = NWIPE_DEVICE_SAS; } } + + if( strstr( result, "SATA Version is:" ) != 0 ) + { + + /* strip any leading or trailing spaces and left justify, +4 is the length of "bus type:" */ + trim( &result[16] ); + + if( strncmp( &result[16], "SATA", 4 ) == 0 ) + { + *bus = NWIPE_DEVICE_ATA; + } + } } }