How to find the bus type in QT?? ATA or SATA.. Pls pls pls help me..
How to find the bus type in QT?? ATA or SATA.. Pls pls pls help me..
How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???
This is a very platform specific task.
Qt doesn't help you in this situation.
You must use plaftform API (better if enclosed in #ifdef code)
A camel can go 14 days without drink,
I can't!!!
Any other way to find the type of bus using QT..
Actually I am building it to support all platforms. If i use windows.h. It will not run on the linux machine.. So It should use the QT functionalities to perform this. Any help to find the bus type.
As you can find in previous answers, there is no way to do that using current version of Qt. You need to use platform-specific methods, which means -So It should use the QT functionalities to perform this. Any help to find the bus type.
NO WAY TO FIND THE BUS TYPE IN QT, USE PLATFORM SPECIFIC API TO DO THIS
Correct. This means that you need to use something like:If i use windows.h. It will not run on the linux machine.
or something similiar to distinguish between different operating systems you want to support.Qt Code:
#ifdef _WIN_32_ #include "my_bus_type_win.h" #else #include "my_bus_type_lin.h" #endifTo copy to clipboard, switch view to plain text mode
Again - you need to implement this on your own. No Qt.
the STORAGE_ADAPTER_DESCRIPTOR contains the bus type that can be used to find the bus type. That is present in the ntdddisk.h . but it returns some garbage values
for the bus type variable.
and? How is this Qt related? ntdddisk.h is part of Win32 API, not Qt.
Do anybody there to help me??
Please stop asking the same questions again and again.
Here several people told you that this is not possible with Qt.
On Linux you can test like this:
The second command will also show SATA-controllers shown by the first command, but it's easy to filter it out.Qt Code:
lspci | grep SATA lspci | grep IDETo copy to clipboard, switch view to plain text mode
You have to be root for this to work.
Is there any way to get it from the system information about the bus type in QT???
I'm closing the topic, we're not getting anywhere here.
Am using the following code::: to find the bus type.. but nothing works
please help me to fix this..
Qt Code:
unsigned long ReturnLen; STORAGE_ADAPTER_DESCRIPTOR AdapDesc; PSTORAGE_ADAPTER_DESCRIPTOR pAdapDesc; STORAGE_PROPERTY_QUERY Query; // input param for query Query.PropertyId = StorageAdapterProperty ; Query.QueryType = PropertyStandardQuery; pAdapDesc = &AdapDesc; pAdapDesc->Size = sizeof(STORAGE_ADAPTER_DESCRIPTOR); // Query using IOCTL_STORAGE_QUERY_PROPERTY if (!DeviceIoControl( m_hDev, IOCTL_STORAGE_QUERY_PROPERTY, &Query, sizeof(STORAGE_PROPERTY_QUERY), pAdapDesc, pAdapDesc->Size*2, &ReturnLen, (LPOVERLAPPED)NULL)) { pLogFile.LogFileWrite((const char *)"SATA/SCSI Interface Determination ERROR Returning 0\r\n"); return 0; } if((pAdapDesc->BusType == BusTypeAta) || (pAdapDesc->BusType == 3) || (pAdapDesc->BusType == 11)) return 2; else if((pAdapDesc->BusType == BusTypeScsi) || (pAdapDesc->BusType == 10)) return 1; }To copy to clipboard, switch view to plain text mode
Your code doesn't make sense.
Secondly, how is this anything to do with Qt?
I want to find the bus type whether it is ATA or SCSI.. How to find that in QT???
Bookmarks