-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathLocalTab.cpp
More file actions
176 lines (144 loc) · 3.84 KB
/
LocalTab.cpp
File metadata and controls
176 lines (144 loc) · 3.84 KB
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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
/**
****************************************************************************************
*
* @file localtab.h
*
* @brief logging Window
*
* Copyright (C) ViewTool 2018
*
* $Rev: 1.0$
*
* Change History:
* 12/21/18: Initial release, working on capturing BLE data, see captured data in file: 2018.12.21-14.52.34.txt
*
****************************************************************************************
*/
#include "common.h"
#include "app_config.h"
#include "LocalTab.h"
#include <QGroupBox>
#include <QLabel>
#include <QPushButton>
#include <QGridLayout>
#include <QHBoxLayout>
LocalTab::LocalTab(QWidget *parent) : QWidget(parent)
{
QPushButton *clearbutton = new QPushButton("clear", this);
QObject::connect(clearbutton, SIGNAL(clicked()), this, SLOT(clear()));
QLabel *logAreaMarginLabel_1 = new QLabel(tr(""));
QLabel *logAreaMarginLabel_2 = new QLabel(tr(""));
QLabel *logAreaMarginLabel_3 = new QLabel(tr(""));
logTextEdit = new QTextEdit(this);
// logTextEdit->setFixedWidth(565);
// logTextEdit->setFixedHeight(210);
QScrollBar *sb = logTextEdit->verticalScrollBar();
sb->setValue(sb->maximum());
QHBoxLayout *horizontal = new QHBoxLayout;
horizontal->addWidget(logAreaMarginLabel_1);
horizontal->addWidget(logAreaMarginLabel_2);
horizontal->addWidget(logAreaMarginLabel_3);
horizontal->addWidget(clearbutton);
QVBoxLayout *logAreaLayout = new QVBoxLayout;
logAreaLayout->addWidget(logTextEdit);
logAreaLayout->addLayout(horizontal);
QVBoxLayout *mainLayout = new QVBoxLayout;
mainLayout->addLayout(logAreaLayout);
mainLayout->addStretch(1);
setLayout(mainLayout);
}
extern bool isLiteral(unsigned char c);
void LocalTab::receive_ver_inf(struct gap_read_ver_req_cmp_evt versionInfo)
{
}
void LocalTab::receive_bdaddr_inf(gap_read_bdaddr_req_cmp_evt addrInfo)
{
}
void LocalTab::receive_userGenericSet(S_GENERIC setGenericInfo)
{
}
void LocalTab::receive_userModeSet(struct S_DISCOVERING_MODE userModeSetInfo)
{
}
void LocalTab::receive_inqInf(struct gap_dev_inq_result_rep inqInf)
{
}
void LocalTab::receive_app_env(struct app_env_tag *appenvInfo)
{
}
void LocalTab::receive_userConnectSet(struct CONNECTINFO userConnectSetInfo)
{
}
void LocalTab::receive_conn_inf(struct gap_le_create_conn_req_cmp_evt connInfo)
{
}
void LocalTab::receive_connectExcpMsg(QString str)
{
}
void LocalTab::receive_dev_rec(app_dev_record devrecInfo)
{
}
void LocalTab::receive_userServiceDiscoverySet(SERVICE_DISCOVERY serviceInfo)
{
}
void LocalTab::receive_userCharDiscoverySet(CHAR_DISCOVERY charInfo)
{
}
void LocalTab::receive_userReadCharSet(READ_CHAR readCharInfo)
{
}
void LocalTab::receive_userWriteCharSet(WRITE_CHAR writeCharInfo)
{
}
void LocalTab::receive_svc_rec(gatt_svc_rec svcrecInfo)
{
}
void LocalTab::receive_char_inf(gatt_disc_char_rec charinfInfo)
{
}
#define BLE_LENGTH_MAX 1
void LocalTab::receive_exceptionMsg(const QString msg)
{
}
//extern volatile STATE state_message;
void LocalTab::receive_rem_inf(struct rem_info remInfo)
{
}
void LocalTab::receive_call_api_inf(QString str)
{
}
void LocalTab::clear()
{
logTextEdit->clear();
}
void LocalTab::receive_uart_opened(int port, int baudrate, int status)
{
}
void LocalTab::rx_raw_data_display(cmd_buf *cb)
{
#if 1
QString str;
QString s[512];
int len, i;
uint8_t header, packetID, cmd, param_len;
header = 0;
packetID = 0;
cmd = 0;
param_len = cb->param_len;
str.sprintf("0x%x,0x%x,0x%x,0x%x: ", header, packetID, cmd, param_len);
qDebug() << "raw display:" << str;
#if 1
for(i=0; i<param_len; i++)
{
s[i].sprintf("0x%x,", cb->param[i]);
str.append(s[i]);
}
#endif
logTextEdit->append(str);
#endif
QScrollBar *sbar = logTextEdit->verticalScrollBar();
sbar->setValue(sbar->maximum());
}
void LocalTab::ota_display(QString otaStr)
{
}