Skip to content

Commit

Permalink
show split transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
povauboin committed Mar 6, 2019
1 parent d25f036 commit 7615b30
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 3 deletions.
5 changes: 5 additions & 0 deletions usbaggregator.cpp
Expand Up @@ -148,6 +148,11 @@ void USBAggregator::append(USBPacket* packet)
_token = packet;
_state = TRANS_TOKEN;
}
} else if (pid == PID_SPLIT) {
/* Split transaction */
endTransaction();
_token = packet;
endTransaction();
} else if (pid == PID_SOF) {
/* Catch SOF, nothing to do really */
} else {
Expand Down
4 changes: 4 additions & 0 deletions usbpacket.cpp
Expand Up @@ -167,6 +167,10 @@ const QString USBPacket::details()
switch(getType())
{
case PID_TYPE_SPECIAL:
if(getPid() == PID_SPLIT) {
details = QString("PID:\t0x%1\n")
.arg(m_Pid, 2, 16, QChar('0'));
}
break;

case PID_TYPE_TOKEN:
Expand Down
13 changes: 11 additions & 2 deletions usbproxy.cpp
Expand Up @@ -16,17 +16,24 @@ void USBProxy::setFilter(const USBProxyFilter *filter)
bool USBProxy::filterAcceptsRow(int sourceRow,
const QModelIndex &sourceParent) const
{
QModelIndex index = sourceModel()->index(sourceRow, RECORD_NAME, sourceParent);

if (!m_filter) {
return true;
}

/* Search inside record name */
/* Search inside record name: SOF */

QModelIndex index = sourceModel()->index(sourceRow, RECORD_NAME, sourceParent);
if (sourceModel()->data(index).toString().contains("SOF")) { // FIXME check pid type instead of string matching
return m_filter->sof;
}

/* Search inside record name: SPLIT */

if (sourceModel()->data(index).toString().contains("SPLIT")) { // FIXME check pid type instead of string matching
return true; // XXX FIXME SPLIT filter not yet implemented
}

/* Search inside record status */

/* Accept if parent transaction is selected */
Expand All @@ -41,6 +48,8 @@ bool USBProxy::filterAcceptsRow(int sourceRow,
return m_filter->nakOut;
} else if (item->data(RECORD_NAME).toString().contains("SETUP")) {
return m_filter->nakSetup;
} else {
return true;
}
} else {
return true;
Expand Down
11 changes: 10 additions & 1 deletion usbtransaction.cpp
Expand Up @@ -21,7 +21,13 @@ QVariant USBTransaction::data(int column) const
case RECORD_ENDPOINT:
return QString("%1").arg(m_token->m_Endpoint, 2, 16, QChar('0'));
case RECORD_STATUS:
return m_handshake ? m_handshake->getPidStr() : "Incomplete";
if (m_handshake) {
return m_handshake->getPidStr();
} else if (m_token->getPid() == PID_SPLIT) {
return QString("");
} else {
return QString("Incomplete");
}
case RECORD_LENGTH:
return m_data ? m_data->m_Data.count() : 0;
case RECORD_SUMMARY:
Expand Down Expand Up @@ -49,6 +55,9 @@ QBrush USBTransaction::background() const
return !ack ? QBrush(QColor(165, 214, 167)) : QBrush(QColor(102, 187, 106));
case PID_OUT:
return !ack ? QBrush(QColor(144, 202, 249)) : QBrush(QColor(66, 165, 245));
default:
// XXX FIXME PID_SPLIT color not implemented
return QBrush();
}
}
return QBrush();
Expand Down

0 comments on commit 7615b30

Please sign in to comment.