Hello,
I try to add the pc-ble driver from Nordic to my Qt application, but my application crashes all the time without a specific error. So I need some help with the implementation of the driver in my application (64 bit for windows).
Project file:
VERSION_MAJOR = 1
VERSION_MINOR = 0
VERSION_BUILD = 0
QT += core gui serialport
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
CONFIG += c++11 file_copies
COPIES += packageSetup configSetup
# The following define makes your compiler emit warnings if you use
# any Qt feature that has been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS \
"VERSION_MAJOR=$$VERSION_MAJOR" \
"VERSION_MINOR=$$VERSION_MINOR" \
"VERSION_BUILD=$$VERSION_BUILD" \
# You can also make your code fail to compile if it uses deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0
RESOURCES += \
Ressources.qrc
DEPENDPATH += \
Nordic/nrf-ble-driver-4.1.4-win_x86_64/include/sd_api_v5 \
INCLUDEPATH += \
Nordic/nrf-ble-driver-4.1.4-win_x86_64/include/sd_api_v5 \
SOURCES += \
main.cpp \
mainwindow.cpp \
HEADERS += \
mainwindow.h \
FORMS += \
mainwindow.ui \
TRANSLATIONS += \
LIBS += \
-L$${PWD}/Nordic/nrf-ble-driver-4.1.4-win_x86_64/lib -lnrf-ble-driver-sd_api_v5-mt-4_1_4 \
-L$${PWD}/Nordic/nrf-ble-driver-4.1.4-win_x86_64/lib -lnrf-ble-driver-sd_api_v5-mt-static-4_1_4 \
# Target version
VERSION = $${VERSION_MAJOR}.$${VERSION_MINOR}.$${VERSION_BUILD}
# Set the application icon
win32:RC_ICONS +=
# Set the build directories
CONFIG(debug, debug|release) {
DESTDIR = debug
} else {
DESTDIR = ../packages/com.daniel-kampert.DataDownloader/data
}
# Copy package and configuration files
CONFIG(debug, debug|release) {
packageSetup.path = $$shell_quote($${OUT_PWD}/debug)
configSetup.path = $$shell_quote($${OUT_PWD}/debug)
} else {
packageSetup.path = $$shell_quote($${DESTDIR})
configSetup.path = $$shell_quote(../config)
}
# Deployment rules
DEPLOY_COMMAND = $$(QTDIR)/bin/windeployqt
DEPLOY_OPTIONS = "--no-system-d3d-compiler --no-opengl --no-angle --no-opengl-sw"
DEPLOY_TARGET = $$shell_quote($$shell_path($${DESTDIR}/$${TARGET}.exe))
CONFIG(debug, debug|release) {
DEPLOY_OPTIONS += "--debug"
} else {
DEPLOY_OPTIONS += "--release"
}
QMAKE_POST_LINK = $${DEPLOY_COMMAND} $${DEPLOY_OPTIONS} $${DEPLOY_TARGET}
mainwindow.cpp
#include "mainwindow.h"
#include "ui_mainwindow.h"
void MainWindow::StatusHandler(adapter_t * Adapter, sd_rpc_app_status_t code, const char * message)
{
}
void MainWindow::ble_evt_dispatch(adapter_t * Adapter, ble_evt_t * p_ble_evt)
{
}
void MainWindow::log_handler(adapter_t* adapter, sd_rpc_log_severity_t severity, const char * message)
{
}
MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent),
_mUi(new Ui::MainWindow)
{
this->_mUi->setupUi(this);
physical_layer_t * phy;
phy = sd_rpc_physical_layer_create_uart("COM5", 1000000, SD_RPC_FLOW_CONTROL_NONE, SD_RPC_PARITY_NONE);
}
MainWindow::~MainWindow()
{
delete this->_mUi;
}
Maybe someone can help me with the implementation
Thank you