-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdms_cmd.h
65 lines (50 loc) · 1.44 KB
/
dms_cmd.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
59
60
61
62
63
64
65
// Copyright 2020 The ChromiumOS Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef HERMES_DMS_CMD_H_
#define HERMES_DMS_CMD_H_
#include <cstdint>
#include <base/check.h>
#include <base/logging.h>
#include <libqrtr.h>
#include "hermes/qmi_cmd_interface.h"
class DmsCmd : public QmiCmdInterface {
public:
enum QmiType : uint16_t {
kGetDeviceSerialNumbers = 0x25,
};
explicit DmsCmd(QmiType qmi_type)
: service_(Service::kDms), qmi_type_(qmi_type) {}
uint16_t qmi_type() const override {
return static_cast<uint16_t>(qmi_type_);
}
Service service() const override { return service_; }
const char* ToString() {
switch (qmi_type_) {
case QmiType::kGetDeviceSerialNumbers:
return "GetDeviceSerialNumbers";
default:
CHECK(false) << "Unrecognized value: "
<< static_cast<uint16_t>(qmi_type_);
return "";
}
}
private:
Service service_;
QmiType qmi_type_;
};
struct dms_qmi_result {
uint16_t result;
uint16_t error;
};
struct dms_get_device_serial_numbers_req {};
struct dms_get_device_serial_numbers_resp {
dms_qmi_result result;
bool esn_valid;
char esn[kBufferDataSize];
bool imei_valid;
char imei[kBufferDataSize];
};
extern struct qmi_elem_info dms_get_device_serial_numbers_req_ei[];
extern struct qmi_elem_info dms_get_device_serial_numbers_resp_ei[];
#endif // HERMES_DMS_CMD_H_