← Back to team overview

hybrid-graphics-linux team mailing list archive

acpi_call now accepts Integer and String parameters

 

Hi, I finally managed to create a parameter parser for acpi_call.
Currently, it only accepts Integer(64bit) and String parameters, but if
there is a need, the code can be changed to add other types (Buffer,
Package...) later.

The code can be found at http://github.com/mkottman/acpi_call , but
since it has been a long time since I last did string processing in C, I
cannot guarantee that it works correctly for all cases :) (don't expect
any "syntax errors").

The interface is as follows:

method_name SP param1 SP param2 ...

where SP is a single space character. paramX can be:
- N or 0xN: ACPI_TYPE_INTEGER, 64bit int in decimal/hexadecimal notation
- "abc": ACPI_TYPE_STRING, content is everything between quotes, no
escape characters allowed

The number of parameters is dynamic, maximum is 16, I hope it is enough
for everybody.

This code is really basic, and to be used only for rough testing. Don't
expect any exception handling, but it should be OK for now...