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
728f1529
Commit
728f1529
authored
Feb 16, 2022
by
chen.weican
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】修改不同的ccuid,网关topoadd后数据不对应的BUG
【提交人】陈伟灿
parent
13e09dd3
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
36 additions
and
1 deletion
+36
-1
midware/midware/dm/kk_dm_mng.c
midware/midware/dm/kk_dm_mng.c
+7
-0
midware/midware/dm/kk_sub_db.c
midware/midware/dm/kk_sub_db.c
+28
-0
midware/midware/dm/kk_sub_db.h
midware/midware/dm/kk_sub_db.h
+1
-0
midware/midware/midware.c
midware/midware/midware.c
+0
-1
No files found.
midware/midware/dm/kk_dm_mng.c
View file @
728f1529
...
@@ -262,6 +262,13 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA
...
@@ -262,6 +262,13 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA
if
(
mac
!=
NULL
)
{
if
(
mac
!=
NULL
)
{
memcpy
(
node
->
mac
,
mac
,
strlen
(
mac
));
memcpy
(
node
->
mac
,
mac
,
strlen
(
mac
));
}
}
if
(
dev_type
==
KK_DM_DEVICE_GATEWAY
&&
fatherDeviceCode
!=
NULL
)
{
if
(
strcmp
(
node
->
fatherDeviceCode
,
fatherDeviceCode
)
!=
0
){
memset
(
node
->
fatherDeviceCode
,
0x0
,
sizeof
(
node
->
fatherDeviceCode
));
memcpy
(
node
->
fatherDeviceCode
,
fatherDeviceCode
,
strlen
(
fatherDeviceCode
));
kk_subDev_update_fatherDeviceCode
(
fatherDeviceCode
,
deviceCode
);
}
}
return
TSL_ALREADY_EXIST
;
return
TSL_ALREADY_EXIST
;
}
}
...
...
midware/midware/dm/kk_sub_db.c
View file @
728f1529
...
@@ -375,7 +375,35 @@ int kk_subDev_update_productType(char *productType,const char *deviceCode)
...
@@ -375,7 +375,35 @@ int kk_subDev_update_productType(char *productType,const char *deviceCode)
//_kk_subDb_unlock();
//_kk_subDb_unlock();
return
SUCCESS_RETURN
;
return
SUCCESS_RETURN
;
}
}
/************************************************************
*功能描述:更新设备类型
*输入参数:deviceCode:设备deviceCode
productType:设备类型
*输出参数:无
*返 回 值:0:成功;其他:失败
*其他说明:
*************************************************************/
int
kk_subDev_update_fatherDeviceCode
(
char
*
fatherDeviceCode
,
const
char
*
deviceCode
)
{
char
*
sqlCmd
=
NULL
;
int
rc
=
0
;
char
*
zErrMsg
=
0
;
kk_subDb_ctx_t
*
ctx
=
_kk_subDb_get_ctx
();
//_kk_subDb_lock();
sqlCmd
=
sqlite3_mprintf
(
"UPDATE SubDeviceInfo SET fatherDeviceCode='%s' WHERE deviceCode= '%s'"
,
fatherDeviceCode
,
deviceCode
);
INFO_PRINT
(
"kk_subDev_update_fatherDeviceCode sqlCmd:%s
\n
"
,
sqlCmd
);
rc
=
sqlite3_exec
(
ctx
->
pDb
,
sqlCmd
,
NULL
,
NULL
,
&
zErrMsg
);
if
(
rc
!=
SQLITE_OK
){
ERROR_PRINT
(
"SQL error: %s
\n
"
,
zErrMsg
);
sqlite3_free
(
zErrMsg
);
}
else
{
//INFO_PRINT("Table updata data successfully\n");
}
sqlite3_free
(
sqlCmd
);
//_kk_subDb_unlock();
return
SUCCESS_RETURN
;
}
/************************************************************
/************************************************************
*功能描述:更新设备注册标记
*功能描述:更新设备注册标记
*输入参数:deviceCode:设备deviceCode
*输入参数:deviceCode:设备deviceCode
...
...
midware/midware/dm/kk_sub_db.h
View file @
728f1529
...
@@ -44,6 +44,7 @@ int kk_get_screenDev_list(ScreenDevInfo_t*list);
...
@@ -44,6 +44,7 @@ int kk_get_screenDev_list(ScreenDevInfo_t*list);
int
kk_get_screenDev_info
(
ScreenDevInfo_t
*
devInfo
,
char
*
serialId
);
int
kk_get_screenDev_info
(
ScreenDevInfo_t
*
devInfo
,
char
*
serialId
);
int
kk_subDev_getDeviceCodes_byProductType
(
DeviceCode_t
*
list
,
char
*
type
);
int
kk_subDev_getDeviceCodes_byProductType
(
DeviceCode_t
*
list
,
char
*
type
);
int
kk_indoor_air_action_add
(
char
*
propertyValue
,
char
*
deviceCode
,
int
delay
,
char
*
gwDeviceCode
,
char
*
sceneId
,
char
*
type
,
int
epnum
);
int
kk_indoor_air_action_add
(
char
*
propertyValue
,
char
*
deviceCode
,
int
delay
,
char
*
gwDeviceCode
,
char
*
sceneId
,
char
*
type
,
int
epnum
);
int
kk_subDev_update_fatherDeviceCode
(
char
*
fatherDeviceCode
,
const
char
*
deviceCode
);
enum
{
enum
{
DB_SUB_IDX
=
0
,
DB_SUB_IDX
=
0
,
DB_SUB_ONLINE
,
DB_SUB_ONLINE
,
...
...
midware/midware/midware.c
View file @
728f1529
...
@@ -1527,7 +1527,6 @@ void kk_platMsg_handle(void* data, char* chalMark){
...
@@ -1527,7 +1527,6 @@ void kk_platMsg_handle(void* data, char* chalMark){
if
(
res
<
SUCCESS_RETURN
)
{
if
(
res
<
SUCCESS_RETURN
)
{
goto
error
;
goto
error
;
}
}
printf
(
"--------------------------------------->11111111111111111111113333
\n
"
);
dm_mgr_update_timestamp_by_devicecode
(
node
->
deviceCode
,
0
);
dm_mgr_update_timestamp_by_devicecode
(
node
->
deviceCode
,
0
);
dm_mgr_set_dev_onoffline
(
node
,
1
);
dm_mgr_set_dev_onoffline
(
node
,
1
);
//kk_ipc_send(IPC_MID2APP,data,strlen(data)+1);
//kk_ipc_send(IPC_MID2APP,data,strlen(data)+1);
...
...
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