Add support for config.txt editing in libpibox
|Status:||Closed||Start date:||02 Jan 2016|
|Target version:||PiBox - 0.11.0|
|Severity:||01 - Critical|
The config.txt for the Raspberry Pi is rather large, but it can be supported in phases, providing support for the most commonly edited features first.
Here is the complete config.txt. The API doesn't need to generate comments, just name=value pairs.
RM #485: Added stubs of rpi API for managing the config.txt file. Added stubs of unit test framework.
RM #485: Completed rpi API for config.txt handling. Extended unit tests to cover basics of that API. Fixed bugs exposed in logging API while testing rpi API.
RM #485: Test that value is an integer before further testing in validate_set. Fix log messages to include function name and remove extraneous memory free in validate_display_rotate. Make sure inputs are valid before saving them in rpiSetValue. Make sure required fields are added, if needed in rpiInit.
#2 Updated by Hammel almost 5 years ago
Here is what the API should look like:
- rpiInit(path) - load and parse the file into a list of name/value pairs. Returns 0 on success, 1 on failure. Does not validate existing names.
- rpiSet(name, value) - Update the specified name with the specified value. If name does not exist, add it if its a valid name. Returns 0 on succes, 1 on failure (not a valid name).
- rpiNames() - returns a list of supported names. This will not be the complete set of configuration options available to config.txt. It is only what is supported by the API.
- rpiValues(name) - returns a list of support values for the specified name. Returns null if the name is not valid.
- rpiGetValue(name) - returns the current value for the specified name
- rpiSave(path) - save current configuration. Does not validate configuration when writing.
- decode_MPG2 (licensed code for MPEG-2 decoding)
- arm_freq - setting this automatically sets the others
- gpu_mem_256 or gpu_mem_512
- dtparam=act_led_trigger=heartbeat (instead of mmc, so I can see processor load)
#5 Updated by Hammel almost 5 years ago
- % Done changed from 20 to 50
Most of this is done now although I still need to verify that required fields are included. I also need to add unit tests for each field to make sure I can only add valid values.
I dropped the gpu memory setting. That seems less like a user configurable item than the others.
#7 Updated by Hammel almost 5 years ago
- Status changed from Closed to In Progress
- % Done changed from 100 to 80
Reopening issue: the use of a hash table was a bad idea. I can't guarantee the ordering of the output to match the input so I munge the input file.
I need to switch to using either singly-linked lists (which is what I started with) or queues. Since this isn't a high activity collection the penalties for using lists isn't really an issue. So I think I'll go back to using lists where the data is a structure with name/value that I can use for searching, replacing, etc.