HardwareInfo

Since: BlackBerry 10.0.0

#include <bb/device/HardwareInfo>

To link against this class, add the following line to your .pro file: LIBS += -lbbdevice

Provides access to information about the device hardware.

The HardwareInfo class provides access to information about the configuration, availability, or general values about the device hardware. Many of the methods are protected by permissions because they can be used to uniquely identify a device. Be sure to check the description of individual methods before using them, and ensure that the required permissions have been requested.


Overview

Properties Index

QStringdeviceName [read-only]
QStringhardwareId [read-only]
boolhasPhysicalBackButton [read-only]
boolhasPhysicalMenuButton [read-only]
boolhasPhysicalPhoneKeys [read-only]
bb::device::HdmiConnector::TypehdmiConnector [read-only]
QStringimei [read-only]
boolisPhysicalKeyboardDevice [read-only]
boolisTrackpadDevice [read-only]
QStringmeid [read-only]
QStringmodelName [read-only]
QStringmodelNumber [read-only]
QStringpin [read-only]
QStringserialNumber [read-only]

Public Functions Index

HardwareInfo (QObject *parent=0)
virtual ~HardwareInfo ()
QStringdeviceName () const
QStringhardwareId () const
boolhasPhysicalBackButton () const
boolhasPhysicalMenuButton () const
boolhasPhysicalPhoneKeys () const
bb::device::HdmiConnector::TypehdmiConnector () const
QStringimei () const
boolisPhysicalKeyboardDevice () const
boolisTrackpadDevice () const
QStringmeid () const
QStringmodelName () const
QStringmodelNumber () const
QStringpin () const
intprocessorCount () const
QStringprocessorModel (int cpuNumber) const
intprocessorSpeed (int cpuNumber) const
QStringserialNumber () const

Properties

QString deviceName[read-only]

Name of the device.

Since:

BlackBerry 10.0.0

QString hardwareId[read-only]

Hardware identifier of the device.

Since:

BlackBerry 10.0.0

bool hasPhysicalBackButton[read-only]

Indicates if the device has a physical back button or not.

Since:

BlackBerry 10.3.1

bool hasPhysicalMenuButton[read-only]

Indicates if the device has a physical menu button or not.

Since:

BlackBerry 10.3.1

bool hasPhysicalPhoneKeys[read-only]

Indicates if the device has physical phone keys (Send and End) or not.

Since:

BlackBerry 10.3.1

bb::device::HdmiConnector::Type hdmiConnector[read-only]

Indicates what kind of HDMI connector the device has, if any.

Since:

BlackBerry 10.1.0

QString imei[read-only]

International mobile equipment identity (IMEI) of the device.

Since:

BlackBerry 10.0.0

bool isPhysicalKeyboardDevice[read-only]

Indicates if the device is a physical keyboard device or not.

Since:

BlackBerry 10.0.0

bool isTrackpadDevice[read-only]

Indicates if the device is a trackpad device or not.

Since:

BlackBerry 10.3.1

QString meid[read-only]

Mobile equipment identifier (MEID) of the device.

Since:

BlackBerry 10.0.0

QString modelName[read-only]

The device model name.

Since:

BlackBerry 10.0.0

QString modelNumber[read-only]

The device model number.

Since:

BlackBerry 10.0.0

QString pin[read-only]

The unique identifier for the device.

Since:

BlackBerry 10.0.0

QString serialNumber[read-only]

The serial number for the device.

Since:

BlackBerry 10.0.0

Public Functions

HardwareInfo (

Constructs a HardwareInfo object.

Constructs a HardwareInfo object that can be used to retrieve information about the device.

Parameters
parent

If not 0, the supplied parent is responsible for deleting this instance.

Since:

BlackBerry 10.0.0

virtual~HardwareInfo ()

Destructor.

Since:

BlackBerry 10.0.0

QString deviceName ()

Retrieves the 'name' identifier attached to the device model.

The device name provides a value that helps to identify the device.

Return:

The name of the device encoded as a string.

Since:

BlackBerry 10.0.0

QString hardwareId ()

Retrieves the hardware identifier of the device.

The hardware identifier provides a value that is identical across all devices of similar configuration.

An example of a hardware identifier is:
  • "0x04002607".

All devices with this identifier will have the same characteristics, such as radio, screen size, processor, etc.

Return:

The hardware identifier of the device encoded as a string.

Since:

BlackBerry 10.0.0

bool hasPhysicalBackButton ()

Returns whether or not a physical back button is present on the device.

Return:

true if the device has a back button, and false otherwise.

Since:

BlackBerry 10.3.1

bool hasPhysicalMenuButton ()

Returns whether or not a physical menu button is present on the device.

Return:

true if the device has a menu button, and false otherwise.

Since:

BlackBerry 10.3.1

bool hasPhysicalPhoneKeys ()

Returns whether or not physical phone keys (Send and End) are present on the device.

Return:

true if the device has phone keys, and false otherwise.

Since:

BlackBerry 10.3.1

bb::device::HdmiConnector::Type hdmiConnector ()

Indicates whether the device possesses an HDMI connector, and if so what type.

Since:

BlackBerry 10.1.0

QString imei ()

Retrieves the international mobile equipment identity (IMEI) of the device.

The IMEI uniquely identifies a device that connects to a GSM cellular network. The IMEI is composed of 14 decimal digits, plus a check digit. For more information about the structure of the IMEI, see 3GPP TS 23.003.

Permissions:

The application must have the read_device_identifying_information permission to access the deivce's IMEI.

Return:

The IMEI of the device encoded as a string, an empty string in the case where either the calling function does not have sufficient permission to read the IMEI, or if the device has no IMEI.

Since:

BlackBerry 10.0.0

bool isPhysicalKeyboardDevice ()

Returns whether or not a physical keyboard is present on the device.

Return:

true if the device has a physical keyboard, and false otherwise.

Since:

BlackBerry 10.0.0

bool isTrackpadDevice ()

Returns whether or not a trackpad is present on the device.

Return:

true if the device has a trackpad, and false otherwise.

Since:

BlackBerry 10.3.1

QString meid ()

Retrieves the mobile equipment identifier (MEID) of the device.

The MEID uniquely identifies a device that connects to a CDMA cellular network. The MEID is composed of 14 hexadecimal digits. For more information about the structure of the MEID, see 3GPP2 report S.R0048.

Permissions:

The application must have the read_device_identifying_information permission to access the device's MEID.

Return:

The MEID of the device encoded as a string, or an empty string in the case where either the calling function does not have sufficient permission to read the MEID, or if the device has no MEID.

Since:

BlackBerry 10.0.0

QString modelName ()

Returns the model name of the device.

Permissions:

The application must have the access_device_model_name permission to access the model name of the device.

Return:

The model name of the device, or an empty string otherwise.

Since:

BlackBerry 10.0.0

QString modelNumber ()

Returns the model number of the device.

Permissions:

The application must have the access_device_model_name permission to access the model number of the device.

Return:

The model number of the device, or an empty string otherwise.

Since:

BlackBerry 10.0.0

QString pin ()

Retrieves the device PIN.

This function lets you retrieve the PIN of the BlackBerry device, which is a unique identifier for the device.

Some examples of PIN number values are:
  • "0x08A34C0A"

  • "0x31C45EF8"

  • "0x89912341"

Permissions:

The application must have the read_device_identifying_information permission to access the device PIN.

Return:

The PIN of the device, or an empty string if the calling function does not have sufficient permission to read the PIN value.

Since:

BlackBerry 10.0.0

int processorCount ()

Returns the number of processors on the device.

Return:

The number of processors on the device, or 0 on error.

Since:

BlackBerry 10.0.0

QString processorModel (
  • intcpuNumber)

Returns the CPU model of the processor at the supplied index.

Parameters
cpuNumber

The index of the CPU for the model requested. Valid indices are greater than or equal to 0 and less than the number of available processors (as given by HardwareInfo::processorCount()).

Return:

The model of the processor at the index provided, and an empty string otherwise.

Since:

BlackBerry 10.0.0

int processorSpeed (
  • intcpuNumber)

Returns the CPU clock speed of the processor at the supplied index, in MHz.

Parameters
cpuNumber

The index of the CPU for which the clock speed is requested. Valid indices are greater than or equal to 0 and less than the number of available processors (as given by HardwareInfo::processorCount()).

Return:

The clock speed of the processor at the provided index, or 0 on error.

Since:

BlackBerry 10.0.0

QString serialNumber ()

Retrieves the device serial number.

This function retrieves the serial number of the device as a QString. When displayed as a string it typically takes the form of a 22 digit base 10 number.

Some examples of serial number values are:
  • "0000000000134300329165"

  • "0000000000134300213459"

  • "0000000000134300118234"

Permissions:

The application must have the read_device_identifying_information permission to access the serial number.

Return:

The serial number of the device, or an empty string if the calling function does not have sufficient permission.

Since:

BlackBerry 10.0.0

Last modified: 2014-09-30



Got questions about leaving a comment? Get answers from our Disqus FAQ.

comments powered by Disqus