void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage() { int newHeight = 0; const char *value; if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found"); return; } if (pps_decoder_get_int(m_decoder, "size", &newHeight) != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found"); return; } if (pps_decoder_push(m_decoder, "locale") != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS locale object not found"); return; } if (pps_decoder_get_string(m_decoder, "languageId", &value) != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS languageId field not found"); return; } const QString languageId = QString::fromLatin1(value); if (pps_decoder_get_string(m_decoder, "countryId", &value) != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS size countryId not found"); return; } const QString countryId = QString::fromLatin1(value); setHeight(newHeight); const QLocale locale = QLocale(languageId + QLatin1Char('_') + countryId); setLocale(locale); qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight << "locale=" << locale; }
QByteArray QBBSystemLocaleData::readPpsValue(const char *ppsObject, int ppsFd) { QByteArray result; if (!ppsObject || ppsFd == -1) return result; char buffer[ppsBufferSize]; int bytes = qt_safe_read(ppsFd, buffer, ppsBufferSize - 1); if (bytes == -1) { qWarning("Failed to read Locale pps, errno=%d", errno); return result; } // ensure data is null terminated buffer[bytes] = '\0'; pps_decoder_t ppsDecoder; pps_decoder_initialize(&ppsDecoder, 0); if (pps_decoder_parse_pps_str(&ppsDecoder, buffer) == PPS_DECODER_OK) { pps_decoder_push(&ppsDecoder, 0); const char *ppsBuff; if (pps_decoder_get_string(&ppsDecoder, ppsObject, &ppsBuff) == PPS_DECODER_OK) { result = ppsBuff; } else { int val; if (pps_decoder_get_int(&ppsDecoder, ppsObject, &val) == PPS_DECODER_OK) result = QByteArray::number(val); } } pps_decoder_cleanup(&ppsDecoder); return result; }
void QBBLocaleData::updateMesurementSystem() { char buffer[ppsBufferSize]; errno = 0; int bytes = qt_safe_read(ppsFd, buffer, ppsBufferSize - 1); if (bytes == -1) { qWarning("Failed to read Locale pps, errno=%d", errno); return; } // ensure data is null terminated buffer[bytes] = '\0'; pps_decoder_t ppsDecoder; pps_decoder_initialize(&ppsDecoder, 0); if (pps_decoder_parse_pps_str(&ppsDecoder, buffer) == PPS_DECODER_OK) { pps_decoder_push(&ppsDecoder, 0); const char *measurementBuff; if (pps_decoder_get_string(&ppsDecoder, "uom", &measurementBuff) == PPS_DECODER_OK) { if (qstrcmp(measurementBuff, "imperial") == 0) { pps_decoder_cleanup(&ppsDecoder); ppsMeasurement = QLocale::ImperialSystem; return; } } } pps_decoder_cleanup(&ppsDecoder); ppsMeasurement = QLocale::MetricSystem; }
bool ppsReadRemoteDevice(int fd, pps_decoder_t *decoder, QBluetoothAddress *btAddr, QString *deviceName) { char buf[ppsBufferSize * 2]; char addr_buf[18]; addr_buf[17] = '\0'; if (qt_safe_read(fd, &buf, sizeof(buf)) == -1) { qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "Could not qt_safe_read from pps remote device file"; return false; } qCDebug(QT_BT_QNX) << "Remote device" << buf; //the address of the BT device is stored at the beginning of the qt_safe_read if (buf[0] != '-') { memcpy(&addr_buf, &buf[1], 17); } else { //The device was removed memcpy(&addr_buf, &buf[2], 17); return false; } *btAddr = QBluetoothAddress(QString::fromUtf8(addr_buf)); if (pps_decoder_parse_pps_str(decoder, buf) == PPS_DECODER_OK) { const char* name; pps_decoder_push(decoder, 0); if (pps_decoder_get_string(decoder, "name", &name) == PPS_DECODER_OK) (*deviceName) = QString::fromUtf8(name); return true; } return false; }
void QBBVirtualKeyboard::ppsDataReady() { while(1) { ssize_t nread = read(mFd, mBuffer, sBufferSize - 1); #ifdef QBBVIRTUALKEYBOARD_DEBUG qDebug() << "QBB: keyboardMessage size: " << nread; #endif if (nread < 0) break; // nread is the real space necessary, not the amount read. if (static_cast<size_t>(nread) > sBufferSize - 1) { qCritical("QBBVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1); break; } mBuffer[nread] = 0; pps_decoder_parse_pps_str(mDecoder, mBuffer); pps_decoder_push(mDecoder, NULL); #ifdef QBBVIRTUALKEYBOARD_DEBUG pps_decoder_dump_tree(mDecoder, stderr); #endif const char* value; if (pps_decoder_get_string(mDecoder, "error", &value) == PPS_DECODER_OK) { qCritical("QBBVirtualKeyboard: Keyboard PPS decoder error: %s", value ? value : "[null]"); continue; } if (pps_decoder_get_string(mDecoder, "msg", &value) == PPS_DECODER_OK) { if (strcmp(value, "show") == 0) { mVisible = true; handleKeyboardStateChangeMessage(true); } else if (strcmp(value, "hide") == 0) { mVisible = false; handleKeyboardStateChangeMessage(false); } else if (strcmp(value, "info") == 0) handleKeyboardInfoMessage(); else if (strcmp(value, "connect") == 0) { } else qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS msg value: %s", value ? value : "[null]"); } else if (pps_decoder_get_string(mDecoder, "res", &value) == PPS_DECODER_OK) { if (strcmp(value, "info") == 0) handleKeyboardInfoMessage(); else qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS res value: %s", value ? value : "[null]"); } else qCritical("QBBVirtualKeyboard: Unexpected keyboard PPS message type"); } #ifdef QBBVIRTUALKEYBOARD_DEBUG qDebug() << "QBB: exiting keyboard thread"; #endif if (mDecoder) pps_decoder_cleanup(mDecoder); }
void QQnxVirtualKeyboardPps::ppsDataReady() { ssize_t nread = qt_safe_read(m_fd, m_buffer, ms_bufferSize - 1); qVirtualKeyboardDebug() << Q_FUNC_INFO << "keyboardMessage size: " << nread; if (nread < 0){ connect(); // reconnect return; } // We sometimes get spurious read notifications when no data is available. // Bail out early in this case if (nread == 0) return; // nread is the real space necessary, not the amount read. if (static_cast<size_t>(nread) > ms_bufferSize - 1) { qCritical("QQnxVirtualKeyboard: Keyboard buffer size too short; need %u.", nread + 1); connect(); // reconnect return; } m_buffer[nread] = 0; pps_decoder_parse_pps_str(m_decoder, m_buffer); pps_decoder_push(m_decoder, 0); #if defined(QQNXVIRTUALKEYBOARD_DEBUG) pps_decoder_dump_tree(m_decoder, stderr); #endif const char *value; if (pps_decoder_get_string(m_decoder, "error", &value) == PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS decoder error: %s", value ? value : "[null]"); return; } if (pps_decoder_get_string(m_decoder, "msg", &value) == PPS_DECODER_OK) { if (strcmp(value, "show") == 0) setVisible(true); else if (strcmp(value, "hide") == 0) setVisible(false); else if (strcmp(value, "info") == 0) handleKeyboardInfoMessage(); else if (strcmp(value, "connect") == 0) qVirtualKeyboardDebug() << Q_FUNC_INFO << "Unhandled command 'connect'"; else qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS msg value: %s", value ? value : "[null]"); } else if (pps_decoder_get_string(m_decoder, "res", &value) == PPS_DECODER_OK) { if (strcmp(value, "info") == 0) handleKeyboardInfoMessage(); else qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS res value: %s", value ? value : "[null]"); } else { qCritical("QQnxVirtualKeyboard: Unexpected keyboard PPS message type"); } }
QByteArray QBBSystemLocaleData::readPpsValue(const char *ppsObject, int ppsFd) { QByteArray result; if (!ppsObject || ppsFd == -1) return result; // PPS objects are of unknown size, but must be read all at once. // Relying on the file size may not be a good idea since the size may change before reading. // Let's try with an initial size (512), and if the buffer is too small try with bigger one, // until we succeed or until other non buffer-size-related error occurs. // Using QVarLengthArray means the first try (of size == 512) uses a buffer on the stack - no allocation necessary. // Hopefully that covers most use cases. int bytes; QVarLengthArray<char, 512> buffer; for (;;) { errno = 0; bytes = qt_safe_read(ppsFd, buffer.data(), buffer.capacity() - 1); const bool bufferIsTooSmall = (bytes == -1 && errno == EMSGSIZE && buffer.capacity() < MAX_PPS_SIZE); if (!bufferIsTooSmall) break; buffer.resize(qMin(buffer.capacity()*2, MAX_PPS_SIZE)); } // This method is called in the ctor(), so do not use qWarning to log warnings // if qt_safe_read fails to read the pps file // since the user code may install a message handler that invokes QLocale API again // (i.e QDate, QDateTime, ...) which will cause a infinite loop. if (bytes == -1) { fprintf(stderr, "Failed to read pps object:%s, errno=%d\n", ppsObject, errno); return result; } // ensure data is null terminated buffer[bytes] = '\0'; pps_decoder_t ppsDecoder; pps_decoder_initialize(&ppsDecoder, 0); if (pps_decoder_parse_pps_str(&ppsDecoder, buffer.data()) == PPS_DECODER_OK) { pps_decoder_push(&ppsDecoder, 0); const char *ppsBuff; if (pps_decoder_get_string(&ppsDecoder, ppsObject, &ppsBuff) == PPS_DECODER_OK) { result = ppsBuff; } else { int val; if (pps_decoder_get_int(&ppsDecoder, ppsObject, &val) == PPS_DECODER_OK) result = QByteArray::number(val); } } pps_decoder_cleanup(&ppsDecoder); return result; }
void GLimp_EndFrame( void ) { char buffer[500]; char *p; int len; const char *msg = NULL; int interval; int size[2]; int pos[2]; int rc; if ( strcmp( r_drawBuffer->string, "GL_FRONT" ) != 0 ) { SwapBuffers(); } while ( (len = read(ppsfd, buffer, sizeof( buffer ) -1 ) ) >= 0 ) { if ( len == 0 ) { return; } buffer[len] = '\0'; p = buffer; pps_decoder_parse( &decoder, p, len ); pps_decoder_push( &decoder, NULL ); pps_decoder_get_string(&decoder, "msg", &msg); if (pps_decoder_status(&decoder, true) == PPS_DECODER_OK ) { if ( strcmp(msg, "SWIPE_DOWN") == 0 ) { Sys_QueEvent( Sys_Milliseconds(), SE_KEY, K_ESCAPE, qtrue, 0, NULL ); Sys_QueEvent( Sys_Milliseconds(), SE_KEY, K_ESCAPE, qfalse, 0, NULL ); } /* if ( strcmp(msg, "activate") == 0 ) { Com_Printf("pps:orientation\n"); } else if ( strcmp(msg, "deactivate") == 0 ) { Com_Printf("pps:orientation\n"); } else if ( strcmp(msg, "deflate") == 0 ) { Com_Printf("pps:deflate\n"); } else if ( strcmp(msg, "orientation") == 0 ) { Com_Printf("pps:orientation\n"); } else if ( strcmp(msg, "exit") == 0 ) { Com_Printf("pps:exit\n"); } else if ( strcmp(msg, "invoke") == 0 ) { Com_Printf("pps:invoke\n"); } */ } } }
void QBBVirtualKeyboard::handleKeyboardInfoMessage() { int newHeight = 0; const char* value; if (pps_decoder_push(mDecoder, "dat") != PPS_DECODER_OK) { qCritical("QBBVirtualKeyboard: Keyboard PPS dat object not found"); return; } if (pps_decoder_get_int(mDecoder, "size", &newHeight) != PPS_DECODER_OK) { qCritical("QBBVirtualKeyboard: Keyboard PPS size field not found"); return; } if (pps_decoder_push(mDecoder, "locale") != PPS_DECODER_OK) { qCritical("QBBVirtualKeyboard: Keyboard PPS locale object not found"); return; } if (pps_decoder_get_string(mDecoder, "languageId", &value) != PPS_DECODER_OK) { qCritical("QBBVirtualKeyboard: Keyboard PPS languageId field not found"); mLanguageId = QString::fromLatin1(value); return; } if (pps_decoder_get_string(mDecoder, "countryId", &value) != PPS_DECODER_OK) { qCritical("QBBVirtualKeyboard: Keyboard PPS size countryId not found"); mCountryId = QString::fromLatin1(value); return; } // HUGE hack, should be removed ASAP. newHeight -= KEYBOARD_SHADOW_HEIGHT; // We want to ignore the 8 pixel shadow above the keyboard. (PR 88400) if (newHeight != mHeight) { mHeight = newHeight; handleKeyboardStateChangeMessage(true); } #ifdef QBBVIRTUALKEYBOARD_DEBUG qDebug() << "QBB: handleKeyboardInfoMessage size=" << mHeight << "languageId=" << mLanguageId << " countryId=" << mCountryId; #endif }
QVariant ppsReadSetting(const char *property) { int settingsFD; char buf[ppsBufferSize]; if ((settingsFD = qt_safe_open(btSettingsFDPath, O_RDONLY)) == -1) { qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "failed to open "<< btSettingsFDPath; return QVariant(); } QVariant result; qt_safe_read( settingsFD, &buf, sizeof(buf)); pps_decoder_t decoder; pps_decoder_initialize(&decoder, 0); if (pps_decoder_parse_pps_str(&decoder, buf) == PPS_DECODER_OK) { pps_decoder_push(&decoder, 0); pps_node_type_t nodeType = pps_decoder_type(&decoder, property); if (nodeType == PPS_TYPE_STRING) { const char *dat; if (pps_decoder_get_string(&decoder, property, &dat) == PPS_DECODER_OK) { result = QString::fromUtf8(dat); qCDebug(QT_BT_QNX) << "Read setting" << result; } else { qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "could not read"<< property; return QVariant(); } } else if (nodeType == PPS_TYPE_BOOL) { bool dat; if (pps_decoder_get_bool(&decoder, property, &dat) == PPS_DECODER_OK) { result = dat; qCDebug(QT_BT_QNX) << "Read setting" << result; } else { qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "could not read"<< property; return QVariant(); } } else if (nodeType == PPS_TYPE_NUMBER) { int dat; if (pps_decoder_get_int(&decoder, property, &dat) == PPS_DECODER_OK) { result = dat; qCDebug(QT_BT_QNX) << "Read setting" << result; } else { qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "could not read"<< property; return QVariant(); } } else { qCDebug(QT_BT_QNX) << Q_FUNC_INFO << "unrecognized entry for settings"; } } pps_decoder_cleanup(&decoder); qt_safe_close(settingsFD); return result; }
void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage() { int newHeight = 0; const char *value; if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found"); return; } if (pps_decoder_get_int(m_decoder, "size", &newHeight) != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found"); return; } if (pps_decoder_push(m_decoder, "locale") != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS locale object not found"); return; } if (pps_decoder_get_string(m_decoder, "languageId", &value) != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS languageId field not found"); return; } const QString languageId = QString::fromLatin1(value); if (pps_decoder_get_string(m_decoder, "countryId", &value) != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS size countryId not found"); return; } const QString countryId = QString::fromLatin1(value); // HUGE hack, should be removed ASAP. newHeight -= KEYBOARD_SHADOW_HEIGHT; // We want to ignore the 8 pixel shadow above the keyboard. (PR 88400) setHeight(newHeight); const QLocale locale = QLocale(languageId + QLatin1Char('_') + countryId); setLocale(locale); qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight << "locale=" << locale; }
void QQnxVirtualKeyboardPps::handleKeyboardInfoMessage() { int newHeight = 0; if (pps_decoder_push(m_decoder, "dat") != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS dat object not found"); return; } if (pps_decoder_get_int(m_decoder, "size", &newHeight) != PPS_DECODER_OK) { qCritical("QQnxVirtualKeyboard: Keyboard PPS size field not found"); return; } setHeight(newHeight); qVirtualKeyboardDebug() << Q_FUNC_INFO << "size=" << newHeight; }
QVariant ppsRemoteDeviceStatus(const QByteArray &address, const char *property) { int rmFD; char buf[ppsBufferSize]; QByteArray filename = btRemoteDevFDPath; filename.append(address); if ((rmFD = qt_safe_open(filename.constData(), O_RDONLY)) < 0) { qCWarning(QT_BT_QNX) << Q_FUNC_INFO << "failed to open "<< btRemoteDevFDPath << address; return false; } QVariant res; qt_safe_read(rmFD, &buf, sizeof(buf)); pps_decoder_t ppsDecoder; pps_decoder_initialize(&ppsDecoder, 0); if (pps_decoder_parse_pps_str(&ppsDecoder, buf) == PPS_DECODER_OK) { pps_decoder_push(&ppsDecoder, 0); //Find out about the node type pps_node_type_t nodeType = pps_decoder_type(&ppsDecoder, property); if (nodeType == PPS_TYPE_STRING) { const char *dat; pps_decoder_get_string(&ppsDecoder,property,&dat); res = QString::fromUtf8(dat); } else if (nodeType == PPS_TYPE_BOOL) { bool dat; pps_decoder_get_bool(&ppsDecoder,property,&dat); res = QVariant(dat); } else { qCDebug(QT_BT_QNX) << "RDStatus: No node type" << property; } } pps_decoder_cleanup(&ppsDecoder); qt_safe_close(rmFD); return res; }
static QNetworkConfiguration::BearerType cellularStatus() { QNetworkConfiguration::BearerType ret = QNetworkConfiguration::BearerUnknown; int cellularStatusFD; if ((cellularStatusFD = qt_safe_open(cellularStatusFile, O_RDONLY)) == -1) { qWarning() << "failed to open" << cellularStatusFile; return ret; } char buf[2048]; if (qt_safe_read(cellularStatusFD, &buf, sizeof(buf)) == -1) { qWarning() << "read from PPS file failed:" << strerror(errno); qt_safe_close(cellularStatusFD); return ret; } pps_decoder_t ppsDecoder; if (pps_decoder_initialize(&ppsDecoder, buf) != PPS_DECODER_OK) { qWarning("failed to initialize PPS decoder"); qt_safe_close(cellularStatusFD); return ret; } pps_decoder_error_t err; if ((err = pps_decoder_push(&ppsDecoder, 0)) != PPS_DECODER_OK) { qWarning() << "pps_decoder_push failed" << err; pps_decoder_cleanup(&ppsDecoder); qt_safe_close(cellularStatusFD); return ret; } if (!pps_decoder_is_integer(&ppsDecoder, "network_technology")) { qWarning("field has not the expected data type"); pps_decoder_cleanup(&ppsDecoder); qt_safe_close(cellularStatusFD); return ret; } int type; if (!pps_decoder_get_int(&ppsDecoder, "network_technology", &type) == PPS_DECODER_OK) { qWarning("could not read bearer type from PPS"); pps_decoder_cleanup(&ppsDecoder); qt_safe_close(cellularStatusFD); return ret; } switch (type) { case 0: // 0 == NONE break; // unhandled case 1: // fallthrough, 1 == GSM case 4: // 4 == CDMA_1X ret = QNetworkConfiguration::Bearer2G; break; case 2: // 2 == UMTS ret = QNetworkConfiguration::BearerWCDMA; break; case 8: // 8 == EVDO ret = QNetworkConfiguration::BearerEVDO; break; case 16: // 16 == LTE ret = QNetworkConfiguration::BearerLTE; break; default: qWarning() << "unhandled bearer type" << type; break; } pps_decoder_cleanup(&ppsDecoder); qt_safe_close(cellularStatusFD); return ret; }
void ppsDecodeControlResponse() { ppsResult result; ResultType resType = UNKNOWN; if (ppsCtrlFD != -1) { char buf[ppsBufferSize]; qt_safe_read(ppsCtrlFD, &buf, sizeof(buf) ); if (buf[0] != '@') return; qCDebug(QT_BT_QNX) << "CTRL Response" << buf; pps_decoder_t ppsDecoder; pps_decoder_initialize(&ppsDecoder, 0); if (pps_decoder_parse_pps_str(&ppsDecoder, buf) == PPS_DECODER_OK) { pps_decoder_push(&ppsDecoder, 0); const char *buf; //The pps response can either be of type 'res', 'msg' or 'evt' if (pps_decoder_get_string(&ppsDecoder, "res", &buf) == PPS_DECODER_OK) { result.msg = QString::fromUtf8(buf); resType = RESPONSE; } else if (pps_decoder_get_string(&ppsDecoder, "msg", &buf) == PPS_DECODER_OK) { result.msg = QString::fromUtf8(buf); resType = MESSAGE; } else if (pps_decoder_get_string(&ppsDecoder, "evt", &buf) == PPS_DECODER_OK) { result.msg = QString::fromUtf8(buf); resType = EVENT; } if (pps_decoder_get_string(&ppsDecoder, "id", &buf) == PPS_DECODER_OK) result.id = QString::fromUtf8(buf).toInt(); //read out the error message if there is one if (pps_decoder_get_string(&ppsDecoder, "errstr", &buf) == PPS_DECODER_OK) result.errorMsg = QString::fromUtf8(buf); int dat; if (pps_decoder_get_int(&ppsDecoder, "err", &dat) == PPS_DECODER_OK) { result.error = dat; } //The dat object can be either a string or a array pps_node_type_t nodeType = pps_decoder_type(&ppsDecoder,"dat"); if (nodeType == PPS_TYPE_STRING) { pps_decoder_get_string(&ppsDecoder,"dat",&buf); result.dat << QString::fromUtf8(buf); } else if (nodeType == PPS_TYPE_OBJECT || nodeType == PPS_TYPE_ARRAY) { pps_decoder_push(&ppsDecoder,"dat"); pps_decoder_goto_index(&ppsDecoder, 0); int len = pps_decoder_length(&ppsDecoder); for (int i = 0; i < len; ++i) { switch ( pps_decoder_type(&ppsDecoder, 0)) { case PPS_TYPE_STRING: result.dat << QString::fromUtf8(pps_decoder_name(&ppsDecoder)); pps_decoder_get_string(&ppsDecoder, 0, &buf); result.dat << QString::fromUtf8(buf); break; case PPS_TYPE_NUMBER: result.dat << QString::fromUtf8(pps_decoder_name(&ppsDecoder)); double dvalue; pps_decoder_get_double(&ppsDecoder, 0, &dvalue); result.dat << QString::number(dvalue); break; default: pps_decoder_next(&ppsDecoder); } } } else { qCDebug(QT_BT_QNX) << "Control Response: No node type" << result.msg; } } pps_decoder_cleanup(&ppsDecoder); } if (result.msg == QStringLiteral("radio_init")) { qCDebug(QT_BT_QNX) << "Radio initialized"; } else if (result.msg == QStringLiteral("access_changed") && __newHostMode != -1) { qCDebug(QT_BT_QNX) << "Access changed after radio init"; ppsSendControlMessage("set_access", QStringLiteral("{\"access\":%1}").arg(__newHostMode), 0); __newHostMode = -1; } if (resType == RESPONSE) { QPair<int, QObject*> wMessage = takeObjectInWList(result.id); if (wMessage.second != 0) wMessage.second->metaObject()->invokeMethod(wMessage.second, "controlReply", Q_ARG(ppsResult, result)); } else if (resType == EVENT) { //qCDebug(QT_BT_QNX) << "Distributing event" << result.msg; for (int i=0; i < evtRegistration.size(); i++) { if (result.msg == evtRegistration.at(i).first) evtRegistration.at(i).second->metaObject()->invokeMethod(evtRegistration.at(i).second, "controlEvent", Q_ARG(ppsResult, result)); } } }