Virgil IoT KIT
Public Types | Public Member Functions
VSQSnapSnifferQml Class Referencefinal

SNAP Sniffer as ListView data model. More...

#include <VSQSnapSnifferQml.h>

Inheritance diagram for VSQSnapSnifferQml:
Inheritance graph
[legend]
Collaboration diagram for VSQSnapSnifferQml:
Collaboration graph
[legend]

Public Types

enum  DeviceInfoRoles {
  MacDst, MacSrc, EthernetPacketType, TransactionId,
  ServiceId, ElementId, Flags, Content,
  ContentSize, Timestamp
}
 Data roles. More...
 

Public Member Functions

 VSQSnapSnifferQml (const VSQSnapSnifferQmlConfig &snifferConfig, VSQNetifBase *netif)
 Constructor. More...
 
 ~VSQSnapSnifferQml ()=default
 
int rowCount (const QModelIndex &parent=QModelIndex()) const override
 Rows count. More...
 
QVariant data (const QModelIndex &index, int role=Qt::DisplayRole) const override
 Obtain data. More...
 
QHash< int, QByteArray > roleNames () const override
 Role names. More...
 

Detailed Description

SNAP Sniffer as ListView data model.

Note
You do not need to call it directly. VSQIoTKitFacade::init will call it if you provide VSQFeatures::SNAP_SNIFFER feature

Member Enumeration Documentation

◆ DeviceInfoRoles

Data roles.

Enumerator
MacDst 

Destination's MAC address.

VSQSnapPacket::m_dest field. Use it as "macDst" in QML

MacSrc 

Source's MAC address.

VSQSnapPacket::m_src field. Use it as "macSrc" in QML

EthernetPacketType 

Hex string representation of Ethernet's packet type.

VSQSnapPacket::m_ethernetPacketType field. Use it as "ethernetPacketType" in QML

TransactionId 

Transaction's ID.

VSQSnapPacket::m_transactionId field. Use it as "transactionId" in QML

ServiceId 

Hex string representation of service's ID.

VSQSnapPacket::m_serviceId field. Use it as "serviceId" in QML

ElementId 

Hex string representation of element's ID.

VSQSnapPacket::m_elementId field. Use it as "elementId" in QML

Flags 

Hex string representation of packet's flags.

VSQSnapPacket::m_flags field. Use it as "flags" in QML

Content 

Packet's content.

VSQSnapPacket::m_content field. Use it as "content" in QML

ContentSize 

Packet's content size.

VSQSnapPacket::m_content field data size. Use it as "contentSize" in QML

Timestamp 

Timestamp.

VSQSnapPacket::m_timestamp field. Use it as "timestamp" in QML

Constructor & Destructor Documentation

◆ VSQSnapSnifferQml()

VSQSnapSnifferQml::VSQSnapSnifferQml ( const VSQSnapSnifferQmlConfig snifferConfig,
VSQNetifBase netif 
)

Constructor.

Parameters
snifferConfigSniffer configuration
netifNetwork interface implementation

◆ ~VSQSnapSnifferQml()

VSQSnapSnifferQml::~VSQSnapSnifferQml ( )
default

Member Function Documentation

◆ data()

QVariant VSQSnapSnifferQml::data ( const QModelIndex &  index,
int  role = Qt::DisplayRole 
) const
override

Obtain data.

Returns the data stored under the given role for the item referred to by the index.

Parameters
indexData index
roleDeviceInfoRoles data role
Returns

◆ roleNames()

QHash<int, QByteArray> VSQSnapSnifferQml::roleNames ( ) const
override

Role names.

Returns the model's role names.

Returns
DeviceInfoRoles to string conversions as QHash

◆ rowCount()

int VSQSnapSnifferQml::rowCount ( const QModelIndex &  parent = QModelIndex()) const
override

Rows count.

Returns the number of rows under the given parent. When the parent is valid it means that rowCount is returning the number of children of parent.

Parameters
parentParent
Returns
Number of rows

The documentation for this class was generated from the following file: