Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Nov 2010 20:01:27 +0100
From:      David DEMELIER <demelier.david@gmail.com>
To:        Dan Nelson <dnelson@allantgroup.com>
Cc:        FreeBSD Questions <freebsd-questions@freebsd.org>
Subject:   Re: trying to sysctl(3) a char value
Message-ID:  <AANLkTikr%2BdKe36utv=5afxByui8vThvXd%2Bpnw6Jpu_Ma@mail.gmail.com>
In-Reply-To: <20101124185702.GE58734@dan.emsphone.com>
References:  <AANLkTikBXRoDHmGnQLoi4MEoBv09J8vbjG=6wriRxqg%2B@mail.gmail.com> <20101124185702.GE58734@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help
2010/11/24 Dan Nelson <dnelson@allantgroup.com>:
> In the last episode (Nov 24), David DEMELIER said:
>> Since I cannot adjust the brightness on my HP Probook because it sucks
>> I'm writing a small script that can be use instead. I need to sysctl
>> the following sysctl variables :
>>
>> hw.acpi.video.lcd0.brightness
>> hw.acpi.video.lcd0.levels
>>
>> the -brightness one is easy since it's an integer, but the levels is
>> possibly a char :
>>
>> markand@Melon ~ $ sysctl hw.acpi.video.lcd0.brightness
>> hw.acpi.video.lcd0.brightness: 90
>> markand@Melon ~ $ sysctl hw.acpi.video.lcd0.levels
>> hw.acpi.video.lcd0.levels: 100 50 0 5 10 15 20 25 30 33 36 40 43 46 50 5=
5 60 65 70 75 80 83 86 90 93 96 100
>
> Looking at the source, that sysctl definition is CTLTYPE_OPAQUE with a
> display format of "I", which means that it's just an array of integers.
> Print each one in a loop. =C2=A0You can also take a look at
> /usr/src/sbin/sysctl/sysctl.c to see how it printed the numbers.
>
> --
> =C2=A0 =C2=A0 =C2=A0 =C2=A0Dan Nelson
> =C2=A0 =C2=A0 =C2=A0 =C2=A0dnelson@allantgroup.com
>

Thank you, it works !

--=20
Demelier David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?AANLkTikr%2BdKe36utv=5afxByui8vThvXd%2Bpnw6Jpu_Ma>