Symbian stores the firmware version as a number in Z:/resource/versions/sw.txt
Reading :/resource/ doesn't need any capabilties and there are many ways to do it, e.g. via HAL API, native C++ file APIs, QtMobilty and others.
But all of them need imports, linking against a .dll etc., but in the end it comes down to reading the file.
So you can use QFile and a few lines of code to do that, e.g. if you want heavy features on FP2 only and not on Refresh:
bool isFP2() const
{
QFile verFile("Z:/resource/versions/sw.txt");
if(!verFile.open(QFile::ReadOnly | QFile::Text))
return false;
return QTextStream(&verFile).readLine().split(".").at(0).toInt(0) == 113;
}
(Closing QFile isn't required, it happens automatically in the destructor)
If you want the main number of the firmware version itself:
int getFirmwareVersion() const
{
QFile verFile("Z:/resource/versions/sw.txt");
if(!verFile.open(QFile::ReadOnly | QFile::Text))
return -1;
return QTextStream(&verFile).readLine().split(".").at(0).toInt(0);
}
You just have to import this two headers:
#include <QFile>
#include <QTextStream>
Both are part of the QCore module, so it even works in console apps
Regards