Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix device parsing #20

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

fix device parsing #20

wants to merge 3 commits into from

Conversation

carlnorum
Copy link

If a device has fewer than 6 lines in its system profiler description, it will get merged with the following device in the egrep output. This patch changes the device splitting logic into an awk script that is more context aware about the format of the system profiler output.

If a device has fewer than 6 lines in its system profiler description,
it will get merged with the following device in the egrep output. This
patch changes the device splitting logic into an awk script that is
more context aware about the format of the system profiler output.
@carlnorum
Copy link
Author

An example of the broken egrep output from my machine today:

--
        TS4 USB2.0 Hub:

          Product ID: 0x5802
          Vendor ID: 0x2188  (CalDigit)
          Version: 1.01
          Speed: Up to 480 Mb/s
          Manufacturer: CalDigit, Inc.
          Location ID: 0x02100000 / 1
          Current Available (mA): 500
--
            USB2.1 Hub:

              Product ID: 0x5409
              Vendor ID: 0x0bda  (Realtek Semiconductor Corp.)
              Version: 1.41
              Speed: Up to 480 Mb/s
              Manufacturer: Generic
              Location ID: 0x02150000 / 3
              Current Available (mA): 500
--
                BillBoard Device:

                  Product ID: 0x5418
                  Vendor ID: 0x0bda  (Realtek Semiconductor Corp.)
                  Version: 1.01
                  Manufacturer: Realtek
                  Location ID: 0x02155000

                C3422WE:

                  Product ID: 0xc00f
                  Vendor ID: 0x413c  (Dell Inc.)
                  Version: 0.00
                  Serial Number: CMFND1CIARFL
                  Speed: Up to 12 Mb/s
                  Manufacturer: Dell
                  Location ID: 0x02153000 / 7
--
                HID Device:

                  Product ID: 0x1101
                  Vendor ID: 0x0bda  (Realtek Semiconductor Corp.)
                  Version: 1.01
                  Speed: Up to 480 Mb/s
                  Manufacturer: Realtek
                  Location ID: 0x02156000 / 6
                  Current Available (mA): 500
--

This patch fixes that short "billboard" device to work correctly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants