mirror of
https://gitlab.com/eql/lqml.git
synced 2025-12-07 11:01:01 -08:00
example 'meshtastic': minor update (define device to be used)
This commit is contained in:
parent
9ee7030350
commit
c77d993496
11 changed files with 90 additions and 35 deletions
|
|
@ -12,13 +12,29 @@ QObject* ini() {
|
|||
return qt;
|
||||
}
|
||||
|
||||
static QBluetoothDeviceInfo toDeviceInfo(const QVariantMap& map) {
|
||||
return QBluetoothDeviceInfo(QBluetoothAddress(map.value("address").toString()),
|
||||
map.value("name").toString(),
|
||||
0);
|
||||
}
|
||||
|
||||
QT::QT() : QObject() {
|
||||
ble = new BLE_ME;
|
||||
}
|
||||
|
||||
QVariant QT::startDeviceDiscovery() {
|
||||
QVariant QT::setDevice(const QVariant& vMap) {
|
||||
auto map = vMap.value<QVariantMap>();
|
||||
ble->setCurrentDevice(toDeviceInfo(map));
|
||||
return vMap;
|
||||
}
|
||||
|
||||
QVariant QT::startDeviceDiscovery(const QVariant& vMap) {
|
||||
auto map = vMap.value<QVariantMap>();
|
||||
if (!map.isEmpty()) {
|
||||
ble->currentDevice = toDeviceInfo(map);
|
||||
}
|
||||
ble->startDeviceDiscovery();
|
||||
return QVariant();
|
||||
return vMap;
|
||||
}
|
||||
|
||||
QVariant QT::read2() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue