API Documentation
Documentation for developing SailfishOS applicationsSysInfo Namespace
(Sailfish::Mdm::SysInfo)The SysInfo namespace provides access to device information. More...
Header: | #include <mdm-sysinfo.h> |
Functions
QString | bluetoothMacAddress() |
QString | deviceModel() |
QString | deviceUid() |
QString | manufacturer() |
QString | productName() |
QString | softwareVersion() |
QString | softwareVersionId() |
QString | wlanMacAddress() |
Detailed Description
The SysInfo namespace provides access to device information.
The available device information includes MAC addresses of connectivity adapters, software version numbers, product name and model, and device UID.
To use these methods, clients must add the following to their qmake project:
CONFIG += link_pkgconfig PKGCONFIG += sailfishmdm
and then #include <mdm-sysinfo.h>
.
Example of usage:
#include <mdm-sysinfo.h> void printSystemInfo() { qInfo() << "Software version:" << Sailfish::Mdm::SysInfo::softwareVersion(); qInfo() << "Software version id:" << Sailfish::Mdm::SysInfo::softwareVersionId(); qInfo() << "Device model:" << Sailfish::Mdm::SysInfo::deviceModel(); qInfo() << "Device UID:" << Sailfish::Mdm::SysInfo::deviceUid(); qInfo() << "Bluetooth MAC Address:" << Sailfish::Mdm::SysInfo::bluetoothMacAddress(); qInfo() << "Wireless LAN MAC Address:" << Sailfish::Mdm::SysInfo::wlanMacAddress(); qInfo() << "Product name:" << Sailfish::Mdm::SysInfo::productName(); qInfo() << "Manufacturer:" << Sailfish::Mdm::SysInfo::manufacturer(); }
Function Documentation
QString SysInfo::bluetoothMacAddress()
Returns the Bluetooth MAC address of the device, or an empty string if Bluetooth is not supported.
For example: "50:56:a8:02:00:a3"
QString SysInfo::deviceModel()
Returns the model name of the device.
The string is a simple vendor-defined model identifier. For example: "tbj"
QString SysInfo::deviceUid()
Returns the unique identifier of the device.
The unique identifier is globally unique, and may be derived from an internal MAC address or other unique identifier. It is not necessarily a UUID. For example: "5056a80300a3"
QString SysInfo::manufacturer()
Returns the name of the manufacturer of the device.
For example: "Jolla"
QString SysInfo::productName()
Returns the product name of the device.
The product name is vendor and device specific. For example: "Jolla Tablet"
QString SysInfo::softwareVersion()
Returns version information about the operating system software on the device.
The string contains not only the version number but also the release code-name as well as the architecture and release flavour of the software. For example: "2.1.2.257 (Iijoki) (i486,devel)"
QString SysInfo::softwareVersionId()
Returns the version identifier of the operating system software on the device.
The string contains the version identifier as a dotted version number. For example: "2.1.2.257"
QString SysInfo::wlanMacAddress()
Returns the Wireless LAN MAC address of the device, or an empty string if Wireless LAN is not supported.
For example: "50:56:a8:03:00:a3"