Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Hardware address on Mac Os X
Qt 6.11 is out! See what's new in the release blog

Hardware address on Mac Os X

Scheduled Pinned Locked Moved Unsolved General and Desktop
14 Posts 3 Posters 5.4k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stephane78
    wrote on last edited by
    #5

    @mrjj , Hi the wifi is not active and the mac is on lan with ethernet active (it is a macbook pro).

    mrjjM 1 Reply Last reply
    0
    • S stephane78

      @mrjj , Hi the wifi is not active and the mac is on lan with ethernet active (it is a macbook pro).

      mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #6

      @stephane78
      Ok. should have a MAC for the lan. At least on linux/windows.

      So lets wait and see if an actual macintosh users know if its a bug or
      simply works differently for this platform :)

      1 Reply Last reply
      0
      • S Offline
        S Offline
        stephane78
        wrote on last edited by
        #7

        @mrjj, Hi I have found that :https://lists.freebsd.org/pipermail/freebsd-hackers/2004-June/007415.html from that :http://stackoverflow.com/questions/10593736/mac-address-from-interface-on-os-x-c, so I can perhaps try this low level thing on mac os to get the mac address.I come here back again to tell you if it works....

        1 Reply Last reply
        1
        • S Offline
          S Offline
          stephane78
          wrote on last edited by
          #8

          @mrjj,Hi to add to the above things,I have two interfaces "lo0" and "gif0" if I use qDebug and netInterface.name();.So now I will try the code that I mentioned above to get the mac address.

          mrjjM 1 Reply Last reply
          0
          • S stephane78

            @mrjj,Hi to add to the above things,I have two interfaces "lo0" and "gif0" if I use qDebug and netInterface.name();.So now I will try the code that I mentioned above to get the mac address.

            mrjjM Offline
            mrjjM Offline
            mrjj
            Lifetime Qt Champion
            wrote on last edited by
            #9

            @stephane78
            Just to be 100% sure, you did go and look in "hardware" on the mac that it does in fact have an address?

            lo0 = loopback
            gif0 = Software Network Interface
            stf0 = 6to4 tunnel interface
            en0 = Ethernet 0
            fw0 = Firewire
            en1 = Ethernet 1
            vmnet8 = Virtual Interface
            vmnet1 = Virtual Interface
            http://superuser.com/questions/267660/can-someone-please-explain-ifconfig-output-in-mac-os-x

            I do wonder why you dont have a en0 ?

            Happy coding :) i wish you luck.

            S 1 Reply Last reply
            1
            • mrjjM mrjj

              @stephane78
              Just to be 100% sure, you did go and look in "hardware" on the mac that it does in fact have an address?

              lo0 = loopback
              gif0 = Software Network Interface
              stf0 = 6to4 tunnel interface
              en0 = Ethernet 0
              fw0 = Firewire
              en1 = Ethernet 1
              vmnet8 = Virtual Interface
              vmnet1 = Virtual Interface
              http://superuser.com/questions/267660/can-someone-please-explain-ifconfig-output-in-mac-os-x

              I do wonder why you dont have a en0 ?

              Happy coding :) i wish you luck.

              S Offline
              S Offline
              stephane78
              wrote on last edited by
              #10

              @mrjj, Hi, ifconfig detects en0 but Qt doesn't detect it....so thanks I will try the code for freebsd above, with interfaces en0, en1 and en2.

              mrjjM 1 Reply Last reply
              0
              • S stephane78

                @mrjj, Hi, ifconfig detects en0 but Qt doesn't detect it....so thanks I will try the code for freebsd above, with interfaces en0, en1 and en2.

                mrjjM Offline
                mrjjM Offline
                mrjj
                Lifetime Qt Champion
                wrote on last edited by
                #11

                @stephane78
                Oh, you should say Qt version and mac OS version btw. It might be bug or regression.

                S 1 Reply Last reply
                0
                • mrjjM mrjj

                  @stephane78
                  Oh, you should say Qt version and mac OS version btw. It might be bug or regression.

                  S Offline
                  S Offline
                  stephane78
                  wrote on last edited by
                  #12

                  @mrjj it is mac os 10.10.4 and Qt5.6.0

                  S 1 Reply Last reply
                  1
                  • S stephane78

                    @mrjj it is mac os 10.10.4 and Qt5.6.0

                    S Offline
                    S Offline
                    stephane78
                    wrote on last edited by
                    #13

                    @mrjj, yes it might be bug.But I have done a function QString interfacetoMac(char * ) based on the freebsd code that returns the mac adress and I call interfacetoMac on "en0" (if the result is empty on "en1","en2") and I had the Mac address (hardware address) on the mac.So my problem is solved.it seems that Qt don't see en0 on the mac....

                    1 Reply Last reply
                    1
                    • SGaistS Offline
                      SGaistS Offline
                      SGaist
                      Lifetime Qt Champion
                      wrote on last edited by
                      #14

                      Hi,

                      Can you re-test that on a more recent version of Qt ? With my current build of 5.7 it's working correctly.

                      Try 5.6.1-1 at least or the 5.6.2 latest test package.

                      Interested in AI ? www.idiap.ch
                      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                      1 Reply Last reply
                      1

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved