File: recoveryinterface.cpp

package info (click to toggle)
qflipper 1.3.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 12,320 kB
  • sloc: cpp: 18,500; sh: 247; ansic: 191; xml: 38; python: 14; makefile: 5
file content (76 lines) | stat: -rw-r--r-- 2,229 bytes parent folder | download | duplicates (2)
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
75
76
#include "recoveryinterface.h"

#include <QLoggingCategory>

#include "flipperzero/recovery/setbootmodeoperation.h"
#include "flipperzero/recovery/exitrecoveryoperation.h"
#include "flipperzero/recovery/firmwaredownloadoperation.h"
#include "flipperzero/recovery/correctoptionbytesoperation.h"
#include "flipperzero/recovery/wirelessstackdownloadoperation.h"

#include "recovery.h"
#include "debug.h"

Q_LOGGING_CATEGORY(LOG_RECOVERY, "RCY")

using namespace Flipper;
using namespace Zero;

RecoveryInterface::RecoveryInterface(DeviceState *state, QObject *parent):
    AbstractOperationRunner(parent),
    m_recovery(new Recovery(state, this))
{}

ExitRecoveryOperation *RecoveryInterface::exitRecoveryMode()
{
    auto *operation = new ExitRecoveryOperation(m_recovery, this);
    enqueueOperation(operation);
    return operation;
}

SetBootModeOperation *RecoveryInterface::setOSBootMode()
{
    auto *operation = new SetOSBootOperation(m_recovery, this);
    enqueueOperation(operation);
    return operation;
}

SetBootModeOperation *RecoveryInterface::setRecoveryBootMode()
{
    auto *operation = new SetRecoveryBootOperation(m_recovery, this);
    enqueueOperation(operation);
    return operation;
}

FirmwareDownloadOperation *RecoveryInterface::downloadFirmware(QIODevice *file)
{
    auto *operation = new FirmwareDownloadOperation(m_recovery, file, this);
    enqueueOperation(operation);
    return operation;
}

WirelessStackDownloadOperation *RecoveryInterface::downloadFUS(QIODevice *file, uint32_t address)
{
    auto *operation = new WirelessStackDownloadOperation(m_recovery, file, address, this);
    enqueueOperation(operation);
    return operation;
}

WirelessStackDownloadOperation *RecoveryInterface::downloadWirelessStack(QIODevice *file)
{
    auto *operation = new WirelessStackDownloadOperation(m_recovery, file, 0, this);
    enqueueOperation(operation);
    return operation;
}

CorrectOptionBytesOperation *RecoveryInterface::fixOptionBytes(QIODevice *file)
{
    auto *operation = new CorrectOptionBytesOperation(m_recovery, file, this);
    enqueueOperation(operation);
    return operation;
}

const QLoggingCategory &RecoveryInterface::loggingCategory() const
{
    return LOG_RECOVERY();
}