File: fuzzingwindow.h

package info (click to toggle)
savvycan 220-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 12,456 kB
  • sloc: cpp: 61,803; sh: 293; javascript: 91; python: 44; makefile: 8
file content (74 lines) | stat: -rw-r--r-- 1,630 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef FUZZINGWINDOW_H
#define FUZZINGWINDOW_H

#include <QDialog>
#include <QListWidget>
#include <QTimer>
#include "can_structs.h"

namespace Ui {
class FuzzingWindow;
}

namespace BitSequenceType
{
    enum
    {
        Sequential,
        Sweeping,
        Random
    };
}

class FuzzingWindow : public QDialog
{
    Q_OBJECT

public:
    explicit FuzzingWindow(const QVector<CANFrame> *frames, QWidget *parent = 0);
    ~FuzzingWindow();

signals:
    void sendCANFrame(const CANFrame *);
    void sendFrameBatch(const QList<CANFrame> *);

private slots:
    void changePlaybackSpeed(int newSpeed);
    void timerTriggered();
    void clearAllFilters();
    void setAllFilters();
    void toggleFuzzing();
    void idListChanged(QListWidgetItem *item);
    void bitfieldClicked(int);
    void changedNumDataBytes(int newVal);
    void updatedFrames(int numFrames);
    void markAllHigh();
    void markAllLow();
    void markAllAuto();

private:
    Ui::FuzzingWindow *ui;
    const QVector<CANFrame> *modelFrames;
    QTimer *fuzzTimer;
    QList<int> foundIDs;
    QList<int> selectedIDs;
    QList<CANFrame> sendingBuffer;
    int startID, endID, currentID, currentIdx;
    bool seqIDScan, rangeIDSelect;
    int bitSequenceType;
    bool currentlyFuzzing;
    uint8_t currentBytes[64];
    uint8_t bitGrid[512];
    uint8_t numBits;
    uint64_t bitAccum;
    int numSentFrames;

    void refreshIDList();
    void calcNextID();
    void calcNextBitPattern();
    void redrawGrid();
    bool eventFilter(QObject *obj, QEvent *event);
    void changedDataByteText(int which, QString valu);
};

#endif // FUZZINGWINDOW_H