Dokit
Internal development documentation
|
Defines the PokitProduct helper functions. More...
#include <qtpokit/pokitmeter.h>
#include <qtpokit/pokitpro.h>
#include <qtpokit/pokitproducts.h>
#include <qtpokit/statusservice.h>
#include "pokitproducts_p.h"
#include <QCoreApplication>
#include <QLoggingCategory>
Go to the source code of this file.
Namespaces | |
namespace | CapacitanceRange |
Encapsulates convenience functions for working with capacitance ranges. | |
namespace | CurrentRange |
Encapsulates convenience functions for working with current ranges. | |
namespace | ResistanceRange |
Encapsulates convenience functions for working with resistance ranges. | |
namespace | VoltageRange |
Encapsulates convenience functions for working with voltage ranges. | |
Functions | |
static | Q_LOGGING_CATEGORY (lc, "dokit.pokit.products", QtInfoMsg) |
Logging category for this file. | |
QTPOKIT_BEGIN_NAMESPACE QString | toString (const PokitProduct product) |
Returns product as user-friendly string. | |
bool | isPokitProduct (const QBluetoothDeviceInfo &info) |
Returns true if info describes a Pokit device. | |
PokitProduct | pokitProduct (const QBluetoothDeviceInfo &info) |
Returns the PokitProduct corresponding the Bluetotoh device info. | |
bool | isPokitProduct (const QList< QBluetoothUuid > &serviceUuids) |
Returns true if serviceUuids contains a known Pokit Status service UUID. | |
bool | isPokitProduct (const QLowEnergyController &controller) |
Returns true if controller describes a Pokit device. | |
PokitProduct | pokitProduct (const QList< QBluetoothUuid > &serviceUuids) |
Returns the PokitProduct corresponding to the Bluetooth serviceUuids. | |
PokitProduct | pokitProduct (const QLowEnergyController &controller) |
Returns the PokitProduct corresponding to the Bluetooth controller. | |
QString | CapacitanceRange::toString (const PokitProduct product, const quint8 range) |
Returns product's capacitance range as a human-friendly string. | |
QVariant | CapacitanceRange::maxValue (const PokitProduct product, const quint8 range) |
Returns the maximum value for product's range in (integer) nanofarads, or the string "Auto". | |
QString | CurrentRange::toString (const PokitProduct product, const quint8 range) |
Returns product's current range as a human-friendly string. | |
QVariant | CurrentRange::maxValue (const PokitProduct product, const quint8 range) |
Returns the maximum value for product's range in (integer) microamps, or the string "Auto". | |
QString | ResistanceRange::toString (const PokitProduct product, const quint8 range) |
Returns product's current range as a human-friendly string. | |
QVariant | ResistanceRange::maxValue (const PokitProduct product, const quint8 range) |
Returns the maximum value for product's range in (integer) ohms, or the string "Auto". | |
QString | VoltageRange::toString (const PokitProduct product, const quint8 range) |
Returns product's current range as a human-friendly string. | |
QVariant | VoltageRange::maxValue (const PokitProduct product, const quint8 range) |
Returns the maximum value for product's range in (integer) millivolts, or the string "Auto". | |
Defines the PokitProduct helper functions.
Definition in file pokitproducts.cpp.
bool isPokitProduct | ( | const QBluetoothDeviceInfo & | info | ) |
Returns true
if info describes a Pokit device.
Currently, this is based on whether or not info's service UUIDs includes a known Pokit Status service, but this test criteria might be swapped for something else sometime.
Definition at line 43 of file pokitproducts.cpp.
References isPokitProduct(), and QBluetoothDeviceInfo::serviceUuids().
Referenced by PokitDiscoveryAgentPrivate::deviceDiscovered(), DeviceCommand::deviceDiscovered(), PokitDiscoveryAgentPrivate::deviceUpdated(), isPokitProduct(), and isPokitProduct().
bool isPokitProduct | ( | const QList< QBluetoothUuid > & | serviceUuids | ) |
Returns true
if serviceUuids contains a known Pokit Status service UUID.
Currently, this is the only known way to detect a Pokit device.
Definition at line 73 of file pokitproducts.cpp.
References QList::contains(), StatusService::ServiceUuids::pokitMeter, and StatusService::ServiceUuids::pokitPro.
bool isPokitProduct | ( | const QLowEnergyController & | controller | ) |
Returns true
if controller describes a Pokit device.
Currently, this is based on whether or not controller's service UUIDs includes a known Pokit Status service, but this test criteria might be swapped for something else sometime.
Definition at line 88 of file pokitproducts.cpp.
References isPokitProduct(), and QLowEnergyController::services().
PokitProduct pokitProduct | ( | const QBluetoothDeviceInfo & | info | ) |
Returns the PokitProduct corresponding the Bluetotoh device info.
If info is not a Pokit device, then result is undefined.
Definition at line 55 of file pokitproducts.cpp.
References pokitProduct(), and QBluetoothDeviceInfo::serviceUuids().
Referenced by DeviceCommand::deviceDiscovered(), pokitProduct(), and pokitProduct().
PokitProduct pokitProduct | ( | const QList< QBluetoothUuid > & | serviceUuids | ) |
Returns the PokitProduct corresponding to the Bluetooth serviceUuids.
Currently, this is based on whether or not servceUuids includes a known Pokit Status service, but this test criteria might be swapped for something else sometime.
Definition at line 101 of file pokitproducts.cpp.
References QList::contains(), PokitMeter, StatusService::ServiceUuids::pokitMeter, PokitPro, StatusService::ServiceUuids::pokitPro, and QCoreApplication::translate().
PokitProduct pokitProduct | ( | const QLowEnergyController & | controller | ) |
Returns the PokitProduct corresponding to the Bluetooth controller.
Currently, this is based on whether or not controller's service UUIDs includes a known Pokit Status service, but this test criteria might be swapped for something else sometime.
Definition at line 123 of file pokitproducts.cpp.
References pokitProduct(), and QLowEnergyController::services().
QTPOKIT_BEGIN_NAMESPACE QString toString | ( | const PokitProduct | product | ) |
Returns product
as user-friendly string.
Definition at line 26 of file pokitproducts.cpp.
References QString::arg(), PokitMeter, PokitPro, and QCoreApplication::translate().
Referenced by AbstractPokitServicePrivate::createServiceObject(), and DeviceCommand::deviceDiscovered().