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
4717f7e5
Commit
4717f7e5
authored
Sep 18, 2021
by
chen.weican
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】去掉默认的ccuid
【提交人】陈伟灿
parent
128c5cb4
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
23 additions
and
10 deletions
+23
-10
VERSION
VERSION
+1
-1
application/kcloud/kcloud_main.c
application/kcloud/kcloud_main.c
+9
-3
application/klansdk/kk_lan_ctrl.c
application/klansdk/kk_lan_ctrl.c
+1
-0
application/klansdk/kk_lan_main.c
application/klansdk/kk_lan_main.c
+1
-1
midware/midware/midware.c
midware/midware/midware.c
+9
-3
opcodeMapCfg/device_3091.json
opcodeMapCfg/device_3091.json
+1
-1
opcodeMapCfg/device_3092.json
opcodeMapCfg/device_3092.json
+1
-1
No files found.
VERSION
View file @
4717f7e5
1.1.0
\ No newline at end of file
1.2.0
\ No newline at end of file
application/kcloud/kcloud_main.c
View file @
4717f7e5
...
...
@@ -41,7 +41,7 @@ static int _setDevice_Code(_IN_ char *device_code,int len)
strncpy
(
s_ccuid
,
device_code
,
len
);
return
len
;
}
static
void
KK_Ccuid_init
(
void
)
static
int
KK_Ccuid_init
(
void
)
{
uint8_t
ccuid
[
DEVICE_CODE_LEN
]
=
{
0
};
uint8_t
ccuidTmp
[
DEVICE_CODE_LEN
]
=
{
0
};
...
...
@@ -52,8 +52,10 @@ static void KK_Ccuid_init(void)
sprintf
(
ccuidTmp
,
"CCU_%s"
,
ccuid
);
_setDevice_Code
(
ccuidTmp
,
strlen
(
ccuidTmp
)
-
1
);
//减一是因为最后有一个换行
}
else
{
_setDevice_Code
(
KK_CCU_ID
,
strlen
(
KK_CCU_ID
));
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
return
-
1
;
}
return
0
;
}
static
int
mqtt_start
(
void
)
{
...
...
@@ -99,7 +101,11 @@ int main(int argc, char* argv[])
int
rc
=
0
;
openlog
(
"kcloud"
,
LOG_PID
,
LOG_USER
);
/*set the callback to get the device date to cloud*/
KK_Ccuid_init
();
rc
=
KK_Ccuid_init
();
if
(
rc
==
-
1
){
ERROR_PRINT
(
"CCUID GET FAIL!!!!!!!!!!!
\n
"
);
return
0
;
}
kk_ipc_init
(
IPC_APP2MID
,(
ipc_cb
*
)
KK_Data_FromDev
,
NULL
,
NULL
);
kk_info_report_start
();
again:
...
...
application/klansdk/kk_lan_ctrl.c
View file @
4717f7e5
...
...
@@ -276,6 +276,7 @@ int kk_lan_ctrl_ack(cJSON * nodeId,cJSON * opcode,cJSON * arg)
cJSON_AddItemToObject
(
msg
,
"opcode"
,
tmp_opcode
);
cJSON_AddStringToObject
(
msg
,
"status"
,
"success"
);
cJSON_AddItemToObject
(
msg
,
"arg"
,
tmp_arg
);
//cJSON_AddStringToObject(msg, "ack", "true");
}
send_msg_to_module
(
msg
);
...
...
application/klansdk/kk_lan_main.c
View file @
4717f7e5
...
...
@@ -63,7 +63,7 @@ static void kk_lan_ccuid_init(void)
sprintf
((
char
*
)
ccuidTmp
,
"CCU_%s"
,
ccuid
);
_setDevice_Code
((
char
*
)
ccuidTmp
,
strlen
((
char
*
)
ccuidTmp
)
-
1
);
}
else
{
_setDevice_Code
(
KK_CCU_ID
,
strlen
(
KK_CCU_ID
));
//
_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
}
}
...
...
midware/midware/midware.c
View file @
4717f7e5
...
...
@@ -100,7 +100,7 @@ static int _setDevice_Code(_IN_ char *device_code,int len)
strncpy
(
s_ccuid
,
device_code
,
len
);
return
len
;
}
static
void
HAL_Ccuid_init
(
void
)
static
int
HAL_Ccuid_init
(
void
)
{
uint8_t
ccuid
[
DEVICE_CODE_LEN
]
=
{
0
};
uint8_t
ccuidTmp
[
DEVICE_CODE_LEN
]
=
{
0
};
...
...
@@ -111,8 +111,10 @@ static void HAL_Ccuid_init(void)
sprintf
(
ccuidTmp
,
"CCU_%s"
,
ccuid
);
_setDevice_Code
(
ccuidTmp
,
strlen
(
ccuidTmp
)
-
1
);
}
else
{
_setDevice_Code
(
KK_CCU_ID
,
strlen
(
KK_CCU_ID
));
//_setDevice_Code(KK_CCU_ID,strlen(KK_CCU_ID));
return
-
1
;
}
return
0
;
}
/************************************************************
*功能描述:过滤不需要下发给网关的消息
...
...
@@ -1357,7 +1359,11 @@ int main(const int argc, const char **argv)
openlog
(
"midware"
,
LOG_PID
,
LOG_USER
);
memset
(
mid_ctx
,
0
,
sizeof
(
mid_ctx_t
));
HAL_Ccuid_version
();
HAL_Ccuid_init
();
res
=
HAL_Ccuid_init
();
if
(
res
==
-
1
){
ERROR_PRINT
(
"CCUID GET FAIL!!!!!!!!!!!
\n
"
);
return
0
;
}
kk_sqlite_init
();
kk_tsl_api_init
();
kk_ipc_init
(
IPC_MID2APP
,
mid_cb
,
NULL
,
NULL
);
...
...
opcodeMapCfg/device_3091.json
View file @
4717f7e5
{
"productCode"
:
"3091"
,
"operateType"
:
"5
01
"
,
"operateType"
:
"5
12
"
,
"channel"
:
1
,
"syn_type"
:
1
,
"syn_opcode"
:
"DIMMABLE_LIGHT_STATUS"
,
...
...
opcodeMapCfg/device_3092.json
View file @
4717f7e5
{
"productCode"
:
"3092"
,
"operateType"
:
"5
01
"
,
"operateType"
:
"5
12
"
,
"channel"
:
2
,
"syn_type"
:
1
,
"syn_opcode"
:
"DIMMABLE_LIGHT_STATUS"
,
...
...
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