Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
K
k-sdk
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陈伟灿
k-sdk
Commits
15537303
Commit
15537303
authored
Aug 31, 2020
by
黄振令
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】网关与主机未连接,去发送tcp,增加保护
【提交人】huang.zhenling
parent
1ed830cc
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
common/api/tcp_channel.c
common/api/tcp_channel.c
+3
-3
platform/zigbee/app/builder/Z3GatewayHost/libapi_com.so
platform/zigbee/app/builder/Z3GatewayHost/libapi_com.so
+0
-0
No files found.
common/api/tcp_channel.c
View file @
15537303
...
@@ -534,7 +534,7 @@ typedef struct {
...
@@ -534,7 +534,7 @@ typedef struct {
ipc_cb
*
cb
;
ipc_cb
*
cb
;
}
kk_tcp_client_t
;
}
kk_tcp_client_t
;
static
kk_tcp_client_t
g_client_ctrl
;
static
kk_tcp_client_t
g_client_ctrl
=
{
NULL
,
-
1
,
0
,{
0
},
0
,
NULL
}
;
static
int
_init_client
(){
static
int
_init_client
(){
memset
(
&
g_client_ctrl
,
0
,
sizeof
(
kk_tcp_client_t
));
memset
(
&
g_client_ctrl
,
0
,
sizeof
(
kk_tcp_client_t
));
...
@@ -639,7 +639,7 @@ static void loop_tcp_client_thread(void *arg){
...
@@ -639,7 +639,7 @@ static void loop_tcp_client_thread(void *arg){
int
kk_tcp_client_send
(
char
*
data
,
int
len
){
int
kk_tcp_client_send
(
char
*
data
,
int
len
){
int
ret
=
0
;
int
ret
=
0
;
int
cnt
=
0
;
int
cnt
=
0
;
if
(
data
!=
NULL
){
if
(
data
!=
NULL
&&
g_client_ctrl
.
isConnect
==
1
){
while
(
g_client_ctrl
.
sd
==
-
1
&&
cnt
<
5
){
while
(
g_client_ctrl
.
sd
==
-
1
&&
cnt
<
5
){
printf
(
"[%s] tcp don't connect, sleep 1s !!!!
\n
"
,
__FUNCTION__
);
printf
(
"[%s] tcp don't connect, sleep 1s !!!!
\n
"
,
__FUNCTION__
);
sleep
(
1
);
sleep
(
1
);
...
@@ -662,7 +662,7 @@ int kk_tcp_client_send(char* data, int len){
...
@@ -662,7 +662,7 @@ int kk_tcp_client_send(char* data, int len){
}
}
int
kk_tcp_client_init
(
char
ip
[
MAX_IP_LEN
],
int
port
,
ipc_cb
cb
)
int
kk_tcp_client_init
(
char
ip
[
MAX_IP_LEN
],
int
port
,
ipc_cb
cb
)
{
{
kk_tcp_client_deinit
();
//
kk_tcp_client_deinit();
_init_client
();
_init_client
();
g_client_ctrl
.
port
=
port
;
g_client_ctrl
.
port
=
port
;
memcpy
(
g_client_ctrl
.
ip
,
ip
,
strlen
(
ip
));
memcpy
(
g_client_ctrl
.
ip
,
ip
,
strlen
(
ip
));
...
...
platform/zigbee/app/builder/Z3GatewayHost/libapi_com.so
View file @
15537303
No preview for this file type
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment