-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodem_helper.h
58 lines (43 loc) · 1.6 KB
/
modem_helper.h
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
// Copyright 2017 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef MODEMFWD_MODEM_HELPER_H_
#define MODEMFWD_MODEM_HELPER_H_
#include <memory>
#include <string>
#include <vector>
#include <base/files/file_path.h>
namespace modemfwd {
struct FirmwareInfo {
FirmwareInfo() = default;
FirmwareInfo(const std::string& main_version,
const std::string& carrier_uuid,
const std::string& carrier_version)
: main_version(main_version),
carrier_uuid(carrier_uuid),
carrier_version(carrier_version) {}
std::string main_version;
std::string carrier_uuid;
std::string carrier_version;
};
struct HelperInfo {
explicit HelperInfo(const base::FilePath& executable_path)
: executable_path(executable_path) {}
base::FilePath executable_path;
std::vector<std::string> extra_arguments;
};
class ModemHelper {
public:
virtual ~ModemHelper() = default;
virtual bool GetFirmwareInfo(FirmwareInfo* out_info) = 0;
virtual bool FlashMainFirmware(const base::FilePath& path_to_fw,
const std::string& version) = 0;
virtual bool FlashCarrierFirmware(const base::FilePath& path_to_fw,
const std::string& version) = 0;
virtual bool Reboot() = 0;
virtual bool FlashModeCheck() = 0;
virtual bool ClearAttachAPN(const std::string& carrier_uuid) = 0;
};
std::unique_ptr<ModemHelper> CreateModemHelper(const HelperInfo& helper_info);
} // namespace modemfwd
#endif // MODEMFWD_MODEM_HELPER_H_