Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
colorEagleStdio
zoompipeline
提交
fb0b744f
zoompipeline
项目概览
colorEagleStdio
/
zoompipeline
通知
181
Star
12
Fork
4
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
zoompipeline
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
fb0b744f
编写于
2月 21, 2014
作者:
丁劲犇
😸
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add an sample db. we will build it in postgresql, while using sqlite for debug.
上级
12439d47
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
79 addition
and
0 deletion
+79
-0
DatabaseMod/readme.txt
DatabaseMod/readme.txt
+1
-0
DatabaseMod/smartlink_svr.sqlite
DatabaseMod/smartlink_svr.sqlite
+0
-0
FunctionalClientTest/maindialog.cpp
FunctionalClientTest/maindialog.cpp
+49
-0
FunctionalClientTest/maindialog.h
FunctionalClientTest/maindialog.h
+1
-0
FunctionalClientTest/maindialog.ui
FunctionalClientTest/maindialog.ui
+7
-0
ZoomPipeline_FuncSvr/smartlink/st_clientnode.cpp
ZoomPipeline_FuncSvr/smartlink/st_clientnode.cpp
+8
-0
ZoomPipeline_FuncSvr/smartlink/st_clientnode.h
ZoomPipeline_FuncSvr/smartlink/st_clientnode.h
+3
-0
ZoomPipeline_FuncSvr/smartlink/st_clientnode_impdeal.cpp
ZoomPipeline_FuncSvr/smartlink/st_clientnode_impdeal.cpp
+10
-0
未找到文件。
DatabaseMod/readme.txt
0 → 100644
浏览文件 @
fb0b744f
Using FireFox Sqlite Manager Add-in to modify this db.
\ No newline at end of file
DatabaseMod/smartlink_svr.sqlite
0 → 100644
浏览文件 @
fb0b744f
文件已添加
FunctionalClientTest/maindialog.cpp
浏览文件 @
fb0b744f
...
...
@@ -4,6 +4,7 @@
#include "../ZoomPipeline_FuncSvr/smartlink/st_msg_applayer.h"
#include <QSettings>
#include <time.h>
#include <QMessageBox>
using
namespace
SmartLink
;
MainDialog
::
MainDialog
(
QWidget
*
parent
)
:
QDialog
(
parent
),
...
...
@@ -159,6 +160,43 @@ void MainDialog::on_pushButton_regisit_clicked()
//3/10 possibility to send a data block to server
client
->
SendData
(
array
);
}
void
MainDialog
::
on_pushButton_Login_clicked
()
{
saveIni
();
quint16
nMsgLen
=
sizeof
(
SMARTLINK_MSG_APP
::
tag_app_layer_header
)
+
sizeof
(
stMsg_HostLogonReq
);
QByteArray
array
(
sizeof
(
SMARTLINK_MSG
)
+
nMsgLen
-
1
,
0
);
char
*
ptr
=
array
.
data
();
SMARTLINK_MSG
*
pMsg
=
(
SMARTLINK_MSG
*
)
ptr
;
SMARTLINK_MSG_APP
*
pApp
=
(
SMARTLINK_MSG_APP
*
)(((
unsigned
char
*
)
(
ptr
))
+
sizeof
(
SMARTLINK_MSG
)
-
1
);
pMsg
->
Mark
=
0x55AA
;
pMsg
->
version
=
1
;
pMsg
->
SerialNum
=
0
;
pMsg
->
Priority
=
1
;
pMsg
->
Reserved1
=
0
;
pMsg
->
source_id
=
(
quint32
)((
quint64
)(
0xffffffff
)
&
0xffffffff
);
pMsg
->
destin_id
=
(
quint32
)((
quint64
)(
0x00000001
)
&
0xffffffff
);;
pMsg
->
data_length
=
nMsgLen
;
pMsg
->
Reserved2
=
0
;
pApp
->
header
.
AskID
=
0x01
;
pApp
->
header
.
MsgType
=
0x1001
;
pApp
->
header
.
MsgFmtVersion
=
0x01
;
QString
strSerial
=
ui
->
plainTextEdit_boxSerialNum
->
toPlainText
();
memcpy
(
pApp
->
MsgUnion
.
msg_HostLogonReq
.
HostSerialNum
,
strSerial
.
toStdString
().
c_str
(),
64
);
pApp
->
MsgUnion
.
msg_HostLogonReq
.
ID
=
ui
->
lineEdit_boxid
->
text
().
toUInt
();
//3/10 possibility to send a data block to server
client
->
SendData
(
array
);
}
//!deal one message, affect m_currentRedOffset,m_currentMessageSize,m_currentHeader
//!return bytes Used.
int
MainDialog
::
filter_message
(
const
QByteArray
&
block
,
int
offset
)
...
...
@@ -299,6 +337,17 @@ int MainDialog::deal_current_message_block()
.
arg
(
pApp
->
MsgUnion
.
msg_HostRegistRsp
.
TextInfo
)
);
}
else
if
(
pApp
->
header
.
MsgType
==
0x1801
)
{
if
(
pApp
->
MsgUnion
.
msg_HostLogonRsp
.
DoneCode
==
0
)
QMessageBox
::
information
(
this
,
tr
(
"Succeed!"
),
tr
(
"Log in succeed!"
));
else
QMessageBox
::
information
(
this
,
tr
(
"Failed!"
),
tr
(
"Log in Failed!"
));
displayMessage
(
tr
(
"Res = %1, Text = %2"
)
.
arg
(
pApp
->
MsgUnion
.
msg_HostLogonRsp
.
DoneCode
)
.
arg
(
pApp
->
MsgUnion
.
msg_HostLogonRsp
.
TextInfo
)
);
}
m_currentBlock
=
QByteArray
();
...
...
FunctionalClientTest/maindialog.h
浏览文件 @
fb0b744f
...
...
@@ -58,6 +58,7 @@ public slots:
void
on_pushButton_connect_clicked
();
void
on_pushButton_regisit_clicked
();
void
on_pushButton_Login_clicked
();
};
#endif // MAINDIALOG_H
FunctionalClientTest/maindialog.ui
浏览文件 @
fb0b744f
...
...
@@ -138,6 +138,13 @@
</property>
</widget>
</item>
<item>
<widget
class=
"QPushButton"
name=
"pushButton_Login"
>
<property
name=
"text"
>
<string>
Log in
</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
...
...
ZoomPipeline_FuncSvr/smartlink/st_clientnode.cpp
浏览文件 @
fb0b744f
...
...
@@ -11,6 +11,7 @@ st_clientNode::st_clientNode(st_client_table * pClientTable, QObject * pClientSo
m_uuid
=
0xffffffff
;
//Not Valid
m_pClientTable
=
pClientTable
;
bTermSet
=
false
;
m_bLoggedIn
=
false
;
m_last_Report
=
QDateTime
::
currentDateTime
();
memset
(
&
m_current_app_header
,
0
,
sizeof
(
SMARTLINK_MSG_APP
));
}
...
...
@@ -150,6 +151,7 @@ int st_clientNode::filter_message(const QByteArray & block, int offset)
//This Message is Over. Start a new one.
m_currentMessageSize
=
0
;
m_currentBlock
=
QByteArray
();
m_current_app_header
.
header
.
MsgType
=
0x00
;
continue
;
}
}
...
...
@@ -172,6 +174,7 @@ int st_clientNode::filter_message(const QByteArray & block, int offset)
//This Message is Over. Start a new one.
m_currentMessageSize
=
0
;
m_currentBlock
=
QByteArray
();
m_current_app_header
.
header
.
MsgType
=
0x00
;
continue
;
}
}
// end if there is more bytes to append
...
...
@@ -182,6 +185,7 @@ int st_clientNode::filter_message(const QByteArray & block, int offset)
.
arg
((
int
)(
ptrCurrData
[
0
])).
arg
((
int
)(
ptrCurrData
[
1
])));
m_currentMessageSize
=
0
;
m_currentBlock
=
QByteArray
();
m_current_app_header
.
header
.
MsgType
=
0x00
;
offset
=
blocklen
;
emit
evt_close_client
(
this
->
sock
());
...
...
@@ -218,6 +222,7 @@ int st_clientNode::deal_current_message_block()
{
emit
evt_Message
(
tr
(
"Client ID is invalid! Close client immediatly."
));
m_currentBlock
=
QByteArray
();
m_current_app_header
.
header
.
MsgType
=
0x00
;
emit
evt_close_client
(
this
->
sock
());
return
0
;
}
...
...
@@ -243,6 +248,7 @@ int st_clientNode::deal_current_message_block()
//Do Nothing
emit
evt_Message
(
tr
(
"Broadcast Message is not currently supported."
));
m_currentBlock
=
QByteArray
();
m_current_app_header
.
header
.
MsgType
=
0x00
;
}
else
if
(
m_currentHeader
.
destin_id
==
0xFFFFFFFD
)
...
...
@@ -251,6 +257,7 @@ int st_clientNode::deal_current_message_block()
//Do Nothing
emit
evt_Message
(
tr
(
"Broadcast Message is not currently supported."
));
m_currentBlock
=
QByteArray
();
m_current_app_header
.
header
.
MsgType
=
0x00
;
}
else
...
...
@@ -270,6 +277,7 @@ int st_clientNode::deal_current_message_block()
{
emit
evt_SendDataToClient
(
destin_node
->
sock
(),
m_currentBlock
);
m_currentBlock
=
QByteArray
();
m_current_app_header
.
header
.
MsgType
=
0x00
;
}
}
...
...
ZoomPipeline_FuncSvr/smartlink/st_clientnode.h
浏览文件 @
fb0b744f
...
...
@@ -80,6 +80,9 @@ protected:
QDateTime
m_last_Report
;
//log in
bool
m_bLoggedIn
;
signals:
void
evt_SendDataToClient
(
QObject
*
objClient
,
const
QByteArray
&
dtarray
);
void
evt_BroadcastData
(
QObject
*
objFromClient
,
const
QByteArray
&
dtarray
);
...
...
ZoomPipeline_FuncSvr/smartlink/st_clientnode_impdeal.cpp
浏览文件 @
fb0b744f
...
...
@@ -73,6 +73,9 @@ bool st_clientNode::RegisitNewNode()
{
reply
.
ID
=
ncurrid
;
reply
.
DoneCode
=
1
;
m_bUUIDRecieved
=
true
;
m_uuid
=
ncurrid
;
m_pClientTable
->
regisitClientUUID
(
this
);
strcpy
(
reply
.
TextInfo
,
"Re-regisit Succeed."
);
}
else
...
...
@@ -82,6 +85,9 @@ bool st_clientNode::RegisitNewNode()
{
reply
.
DoneCode
=
0
;
strcpy
(
reply
.
TextInfo
,
"First-regisit Succeed."
);
m_bUUIDRecieved
=
true
;
m_uuid
=
reply
.
ID
;
m_pClientTable
->
regisitClientUUID
(
this
);
}
else
strcpy
(
reply
.
TextInfo
,
"Equip ID resource error."
);
...
...
@@ -205,6 +211,10 @@ bool st_clientNode::LoginSvr()
{
reply
.
TextInfo
[
0
]
=
0
;
reply
.
DoneCode
=
0
;
m_bUUIDRecieved
=
true
;
m_uuid
=
ncurrid
;
m_pClientTable
->
regisitClientUUID
(
this
);
}
else
strcpy
(
reply
.
TextInfo
,
"ID Not matched."
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录