The current system firmware version is reported by System Profiler as “SPHardwareDataType”.
System firmware versions are also reported (as “Boot ROM”) in diagnostic 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?