API Documentation

Documentation for developing SailfishOS applications

BaseStation Class

(Sailfish::Mdm::BaseStation)

Retrieves information about base stations. To use this class, clients must add the following to their qmake project: More...

Header: #include <mdm-basestation.h>

Public Types

Public Functions

BaseStation(QObject *parent = 0)
virtual ~BaseStation()
QList<BaseStationInfo> getBaseStations()

Signals

void baseStationChanged(QList<BaseStationInfo> baseStations)

Detailed Description

Retrieves information about base stations. To use this class, clients must add the following to their qmake project:

 CONFIG += link_pkgconfig
 PKGCONFIG += sailfishmdm

and then #include <mdm-basestation.h>.

Example of usage:

 #include <mdm-basestation.h>

 void getBaseStations()
 {
     Sailfish::Mdm::BaseStation bs;
     QList<Sailfish::Mdm::BaseStation::BaseStationInfo> cells = bs.getBaseStations();
     qInfo() << "Base station:";
         for (Sailfish::Mdm::BaseStation::BaseStationInfo cell : cells) {
             if (cell.type == "gsm") {
                 qInfo() << cell.path << "gsm" << cell.registered
                         << "mcc:" << cell.mcc << "mnc:" << cell.mnc
                         << "lac:" << cell.lac << "cid:" << cell.cid
                         << "signalStrength:" << cell.signalStrength;
             } else if (cell.type == "wcdma") {
                 qInfo() << cell.path << "wcdma" << cell.registered
                         << "mcc:" << cell.mcc << "mnc:" << cell.mnc
                         << "lac:" << cell.lac << "cid:" << cell.cid
                         << "psc:" << cell.psc
                         << "signalStrength:" << cell.signalStrength;
             } else if (cell.type == "lte") {
                 qInfo() << cell.path << "lte" << cell.registered
                         << "mcc:" << cell.mcc << "mnc:" << cell.mnc
                         << "ci:" << cell.ci << "pci:" << cell.pci
                         << "tac:" << cell.tac
                         << "signalStrength:" << cell.signalStrength
                         << "rsrp:" << cell.rsrp << "rsrq:" << cell.rsrq
                         << "rssnr:" << cell.rssnr << "cqi:" << cell.cqi;
             } else {
                 qInfo() << cell.path << "unknown" << cell.registered;
             }
         }

 }

Member Function Documentation

BaseStation::BaseStation(QObject *parent = 0)

Constructs a BaseStation instance with the given parent.

[virtual] BaseStation::~BaseStation()

Destroys the BaseStation instance.

[signal] void BaseStation::baseStationChanged(QList<BaseStationInfo> baseStations)

QList<BaseStationInfo> BaseStation::getBaseStations()

Returns a list of BaseStationInfo instances.

We use cookies to improve your user experience and to help us to develop our services. By continuing to browse the site, you approve of our use of cookies.