On Wed, 24 Oct 2018 at 11:57, artur.raglis@3mdeb.com wrote:
I suppose that returning function status (#2) is not necessary with query functions, so I'll stick to the first approach.
I think it's also a really good idea to have a "context" so that there isn't any global state, i.e. some pointer returned by fl_init() that can be used in all operations. Having global state in a library isn't awesome -- and having a context lets you do memory management in a sane way.
Are there any new ideas / hints that we need to know for further development?
I don't think so; fwupd mainly cares about:
1) enumerating devices, which at the moment is controlled using a whitelist on the machine DMI data: https://github.com/hughsie/fwupd/blob/master/plugins/flashrom/flashrom.quirk 2) flashing a blob of memory on an abstract device, so we'd need to be able to chose the flashrom programmer and not just flash the firmware on some random device 3) verification of the flash process, e.g. just reading back what we wrote and checking the blob is the same 4) progress reporting, with an update at least every 5 seconds 5) sane error reporting, e.g. providing a ASCII/UTF-8 string rather than just setting a tty to write to.
Lastly, it's awesome you're driving this work forward. I'm happy to test any WIP branch with fwupd, or do some sort of high-level API review if that helps.
Richard.