-
Notifications
You must be signed in to change notification settings - Fork 2
/
qmi_test.c
93 lines (88 loc) · 1.95 KB
/
qmi_test.c
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
#include <errno.h>
#include <string.h>
#include "qmi_test.h"
struct qmi_elem_info test_qmi_result_ei[] = {
{
.data_type = QMI_UNSIGNED_2_BYTE,
.elem_len = 1,
.elem_size = sizeof(uint16_t),
.offset = offsetof(struct test_qmi_result, result),
},
{
.data_type = QMI_UNSIGNED_2_BYTE,
.elem_len = 1,
.elem_size = sizeof(uint16_t),
.offset = offsetof(struct test_qmi_result, error),
},
{}
};
struct qmi_elem_info test_name_ei[] = {
{}
};
struct qmi_elem_info test_ping_req_ei[] = {
{
.data_type = QMI_UNSIGNED_1_BYTE,
.elem_len = 4,
.elem_size = sizeof(uint8_t),
.array_type = STATIC_ARRAY,
.tlv_type = 1,
.offset = offsetof(struct test_ping_req, ping),
},
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
.elem_size = sizeof(bool),
.tlv_type = 16,
.offset = offsetof(struct test_ping_req, client_valid),
},
{
.data_type = QMI_STRUCT,
.elem_len = 1,
.elem_size = sizeof(struct test_name),
.tlv_type = 16,
.offset = offsetof(struct test_ping_req, client),
.ei_array = test_name_ei,
},
{}
};
struct qmi_elem_info test_ping_resp_ei[] = {
{
.data_type = QMI_STRUCT,
.elem_len = 1,
.elem_size = sizeof(struct test_qmi_result),
.tlv_type = 2,
.offset = offsetof(struct test_ping_resp, result),
.ei_array = test_qmi_result_ei,
},
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
.elem_size = sizeof(bool),
.tlv_type = 16,
.offset = offsetof(struct test_ping_resp, pong_valid),
},
{
.data_type = QMI_UNSIGNED_1_BYTE,
.elem_len = 4,
.elem_size = sizeof(uint8_t),
.array_type = STATIC_ARRAY,
.tlv_type = 16,
.offset = offsetof(struct test_ping_resp, pong),
},
{
.data_type = QMI_OPT_FLAG,
.elem_len = 1,
.elem_size = sizeof(bool),
.tlv_type = 17,
.offset = offsetof(struct test_ping_resp, client_valid),
},
{
.data_type = QMI_STRUCT,
.elem_len = 1,
.elem_size = sizeof(struct test_name),
.tlv_type = 17,
.offset = offsetof(struct test_ping_resp, client),
.ei_array = test_name_ei,
},
{}
};