本文整理汇总了C++中AttributeList::writerWrite方法的典型用法代码示例。如果您正苦于以下问题:C++ AttributeList::writerWrite方法的具体用法?C++ AttributeList::writerWrite怎么用?C++ AttributeList::writerWrite使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AttributeList
的用法示例。
在下文中一共展示了AttributeList::writerWrite方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: sendDictationResults
/**
* @brief VoiceEndpoint::sendDictationResults
* Important: Pebble accepts only 1 sentence currently, hence need to choose the best one here
*/
void VoiceEndpoint::sendDictationResults()
{
if(m_sessId>0) {
if(m_sesTimer) {
killTimer(m_sesTimer);
m_sesTimer = 0;
m_sesPhase = PhResultSent;
}
quint32 flags = m_appUuid.isNull()?0:FlagAppInitiated;
quint8 result = (m_sesResult.sentences.count()>0)?ResSuccess:ResInvalidRecognizerResponse;
qDebug() << "Sending session recognition result" << result << "for session" << m_sessId << "with content" << m_sesResult.sentences.count() << "for app" << m_appUuid << m_appUuid.isNull();
QByteArray pkt;
WatchDataWriter writer(&pkt);
writer.write<quint8>(CmdDictatResult);
writer.writeLE<quint32>(flags);
writer.writeLE<quint16>(m_sessId);
writer.write<quint8>(result);
AttributeList al;
if(!m_appUuid.isNull())
al.append(Attribute(m_appUuid));
m_sesResult.sort(1);
if(result==ResSuccess)
al.append(Attribute(Transcription(m_sesResult)));
al.writerWrite(writer);
m_watchConnection->writeToPebble(WatchConnection::EndpointVoiceControl,pkt);
qDebug() << "Sent" << pkt.toHex();
}
}