SChalice
lvl.1
Offline
|
So now my Windows SDK has far greater functionality than DJI's current version.
I first converted the QT files to .vcproj and then created my own classes to replace those in qt_serial_device.cpp and qt_thread.cpp.
I replaced the serial code using something on the web that I have used for other projects: CSerial
The threading "class" is only used to launch a serial read thread and a callback thread which is easily accomplished using beginthreadex (instead of QT)
Thread*
PlatformManager::addThread(Vehicle* vehicle_ptr, uint8_t thread_type)
{
#ifdef REPLACE_QT
if (thread_type == UART_SERIAL_READ_THREAD)
{
readThreadPtr = new (std::nothrow) OSDKTThread(vehicle_ptr, UART_SERIAL_READ_THREAD);
if (readThreadPtr == NULL)
{
AfxMessageBox("Failed to initialize read thread!\n");
}
else
{
TThread* qReadThread = new TThread;
beginthreadex(NULL, 0, &readThread, NULL, 0, NULL);
return readThreadPtr;
}
}
|
|