Closed aquaxp closed 3 years ago
Well, spec is wrong then (and it's anyway generated from the headers).
In current form of spec speedTable
field is represent "A table containing temperature/speed pairs", but that's obviously not true because used type - zes_fan_temp_speed_t
is represent only single temperature/speed pair, it's not an array.
To match spec speedTable
should be at least a literally array - which means that it still need to change it's type from zes_fan_temp_speed_t
to zes_fan_temp_speed_t[]
. A proper a data structure that will contain not only array of temperature/speed, but also information how many of them are defined is zes_fan_speed_table_t
.
zesFanGetConfig
is intended to return fan configuration and in case if fan is configured for work with table - speedTable
should contain array of temperature/speed pairs, not a single one.
This is a bug. Thanks for bringing it to our attention. We will fix this in the next release of the spec.
@aquaxp The header files in this repo are generated from the spec. Once the next release of the spec is published I'll regenerate these headers to pick up this bug fix.
@bmyates Should I close this pull-request then and create an issue?
Yes please, thanks!
From logic point of view and documentation comment 'speedTable' field should have 'zes_fan_speed_table_t' type instead 'zes_fan_temp_speed_t'. This field should contain a speed's table that was configured instead a single entry from speed's table.