Code Monkey home page Code Monkey logo

Comments (2)

digitaltrails avatar digitaltrails commented on July 22, 2024

Yeah, it's a bit inconsistent, but it's possible to make it consistent by using standard hex prefixes, try:

ddcutil setvcp 0x60 0x0f

If you think about a human just wanting to set brightness, the following works with little need for explanation:

ddcutil setvcp 10 100 

It's mainly when you get into non-continuous values that the confusion arises.

I suspect we're stuck with this, or scripts and applications that interact with ddcutil will break. For my own scripts I've now elected to use hex prefixing all the time.

from ddcutil.

rockowitz avatar rockowitz commented on July 22, 2024

@ashirviskas I agree, its not immediately clear whether the parsed capabilities values for non-continuous features are integer or hex. That there's no leading "x" or "0x" seemed natural when the capabilities command was coded, very early in ddcutil development. given that the unparsed capabilities string returned by the monitor just contains 2 byte hex values. That decision has not worn well. By contrast vcpinfo --verbose, a much later command, reports non-continuous values with a leading "0x". And getvcp --verbose reports the raw bytes with a leading "0x".

It would be good to consistently use either leading "x' or "0x" when reporting hex values. Unfortunately, as @digitaltrails notes, there are screen-scraping applications that parse output that was meant for human consumption. So such changes are not to be made lightly.

Note that when a value is specified by the user, if it begins with "x", "X", "0x" or "0X" it is treated as hexadecimal, otherwise it is an integer. The major exception to this rule is VCP feature code values are always interpreted as hex, whether or not there is a leading hex specifier. The reason for this is that DDC documentation always specifies features identifiers using their hex values. It would be unnatural to refer to feature x 60 (Input Source) as feature 96,

from ddcutil.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.