Results 1 to 20 of 20

Thread: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

  1. #1
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default How to find the bus type in QT??

    How to find the bus type in QT?? ATA or SATA.. Pls pls pls help me..

  2. #2
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

  3. #3
    Join Date
    Jan 2006
    Location
    Napoli, Italy
    Posts
    621
    Thanks
    5
    Thanked 86 Times in 81 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: 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!!!

  4. #4
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    Any other way to find the type of bus using QT..

  5. #5
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    Quote Originally Posted by Gokulnathvc View Post
    Any other way to find the type of bus using QT..
    Yes. Qt is open-source so you can implement that functionality into Qt and then use it.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  6. #6
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    Quote Originally Posted by Gokulnathvc View Post
    Any other way to find the type of bus using QT..
    No, Qt does not support this. You must use platform specific API as already stated.

    EDIT: Or you can do as Wysota says, I'm sure people will be greatful if you manage to get your changes into the trunk.

  7. #7
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    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.

  8. #8
    Join Date
    Sep 2009
    Location
    Wroclaw, Poland
    Posts
    1,394
    Thanked 342 Times in 324 Posts
    Qt products
    Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    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 -

    NO WAY TO FIND THE BUS TYPE IN QT, USE PLATFORM SPECIFIC API TO DO THIS

    If i use windows.h. It will not run on the linux machine.
    Correct. This means that you need to use something like:
    Qt Code:
    1. #ifdef _WIN_32_
    2. #include "my_bus_type_win.h"
    3. #else
    4. #include "my_bus_type_lin.h"
    5. #endif
    To copy to clipboard, switch view to plain text mode 
    or something similiar to distinguish between different operating systems you want to support.
    Again - you need to implement this on your own. No Qt.

  9. #9
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    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.

  10. #10
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    and? How is this Qt related? ntdddisk.h is part of Win32 API, not Qt.

  11. #11
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to find the bus type in QT??

    Do anybody there to help me??

  12. #12
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to find the bus type in QT??

    Please stop asking the same questions again and again.

    Here several people told you that this is not possible with Qt.

  13. #13
    Join Date
    Jan 2009
    Location
    The Netherlands and Spain
    Posts
    150
    Thanks
    6
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: How to find the bus type in QT??

    On Linux you can test like this:
    Qt Code:
    1. lspci | grep SATA
    2. lspci | grep IDE
    To copy to clipboard, switch view to plain text mode 
    The second command will also show SATA-controllers shown by the first command, but it's easy to filter it out.
    You have to be root for this to work.

  14. #14
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    Is there any way to get it from the system information about the bus type in QT???

  15. #15
    Join Date
    Apr 2010
    Posts
    769
    Thanks
    1
    Thanked 94 Times in 86 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    Quote Originally Posted by Gokulnathvc View Post
    Is there any way to get it from the system information about the bus type in QT???
    For the fourth time - no, there is not.

  16. #16
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to Find the Bus Type in QT? Using STORAGE_ADAPTER_DESCRIPTOR???

    I'm closing the topic, we're not getting anywhere here.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  17. #17
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Finding the bus type in QT?

    Am using the following code::: to find the bus type.. but nothing works
    please help me to fix this..

    Qt Code:
    1. unsigned long ReturnLen;
    2. STORAGE_ADAPTER_DESCRIPTOR AdapDesc;
    3. PSTORAGE_ADAPTER_DESCRIPTOR pAdapDesc;
    4. STORAGE_PROPERTY_QUERY Query; // input param for query
    5. Query.PropertyId = StorageAdapterProperty ;
    6. Query.QueryType = PropertyStandardQuery;
    7.  
    8. pAdapDesc = &AdapDesc;
    9. pAdapDesc->Size = sizeof(STORAGE_ADAPTER_DESCRIPTOR);
    10.  
    11. // Query using IOCTL_STORAGE_QUERY_PROPERTY
    12. if (!DeviceIoControl( m_hDev,
    13. IOCTL_STORAGE_QUERY_PROPERTY,
    14. &Query,
    15. sizeof(STORAGE_PROPERTY_QUERY),
    16. pAdapDesc,
    17. pAdapDesc->Size*2,
    18. &ReturnLen,
    19. (LPOVERLAPPED)NULL))
    20. {
    21. pLogFile.LogFileWrite((const char *)"SATA/SCSI Interface Determination ERROR Returning 0\r\n");
    22. return 0;
    23. }
    24.  
    25. if((pAdapDesc->BusType == BusTypeAta) || (pAdapDesc->BusType == 3) || (pAdapDesc->BusType == 11))
    26. return 2;
    27. else if((pAdapDesc->BusType == BusTypeScsi) || (pAdapDesc->BusType == 10))
    28. return 1;
    29.  
    30. }
    To copy to clipboard, switch view to plain text mode 

  18. #18
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Finding the bus type in QT?

    Your code doesn't make sense.

    Secondly, how is this anything to do with Qt?

  19. #19
    Join Date
    Mar 2011
    Location
    Coimbatore,TamilNadu,India
    Posts
    382
    Thanks
    10
    Thanked 13 Times in 12 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Finding the bus type in QT?

    I want to find the bus type whether it is ATA or SCSI.. How to find that in QT???

  20. #20
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Finding the bus type in QT?

    Threads merged and moved to the appropriate forum.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. Replies: 7
    Last Post: 19th April 2011, 13:20
  2. Replies: 2
    Last Post: 22nd December 2009, 21:52
  3. Replies: 17
    Last Post: 31st March 2006, 06:57
  4. Type and User Type
    By campana in forum Qt Programming
    Replies: 1
    Last Post: 28th February 2006, 00:22

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.