The current system firmware version is reported by System Profiler as "SPHardwareDataType".
System firmware versions are also reported (as "Boot ROM") in diagnostics logs, but here they are the system firmware versions at the time the logs were generated - not necessarily the current system firmware version.
Is there a way to programmatically obtain the current system firmware version in macOS using C++ without using System Profiler?
Is there a way to programmatically obtain the current system firmware version in macOS using C++ without using System Profiler?
It might be possible through IOKit (I haven't really looked for it), but what I would actually recommend is using the "system_profiler" command line tool. You can restrict it's output to the section your interested in ("Hardware") and you can have it output in JSON or XML so that the data is easy to work with. That's both less work and more reliable than trying to pull it out of IOKit.
__
Kevin Elliott
DTS Engineer, CoreOS/Hardware