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
7f464c41
Commit
7f464c41
authored
Feb 11, 2022
by
黄振令
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
1.nx5编译不过问题
parent
56e549ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
187 additions
and
184 deletions
+187
-184
common/hal/kk_product.h
common/hal/kk_product.h
+1
-1
midware/midware/scene/kk_scene_db.h
midware/midware/scene/kk_scene_db.h
+7
-4
midware/midware/scene/kk_scene_handle.c
midware/midware/scene/kk_scene_handle.c
+179
-179
No files found.
common/hal/kk_product.h
View file @
7f464c41
...
...
@@ -133,7 +133,7 @@
#define KK_CONFIG_FILE_PATH_SUB "kk/kk_cloud_conf.json"
#ifdef CONFIG_NDK
#define KK_DEFAULT_CONFIG_FILE_PATH_SUB "kk/cloud_default_config.json"
#elif
#elif
CONFIG_A133_PLATFORM
#define KK_DEFAULT_CONFIG_FILE_PATH_SUB "kk/etc/cloud_default_config.json"
#endif
#define KK_AUTH_CONFIG_FILE_PATH_SUB "kk/auth_conf.json"
...
...
midware/midware/scene/kk_scene_db.h
View file @
7f464c41
...
...
@@ -18,7 +18,7 @@ enum{
DB_SCENEINFO_PRODUCTTYPE
,
DB_SCENEINFO_ACTIONROOMID
,
};
enum
{
DB_SCENETRIGGER_TYPE
=
0
,
DB_SCENETRIGGER_DEVICECODE
,
...
...
@@ -42,7 +42,7 @@ enum{
enum
{
DB_SCENEACTION_TYPE
=
0
,
DB_SCENEACTION_DEVICECODE
,
DB_SCENEACTION_EPNUM
,
DB_SCENEACTION_EPNUM
,
DB_SCENEACTION_PROPERTYNAME
,
DB_SCENEACTION_PROPERTYVALUE
,
DB_SCENEACTION_DELAY
,
...
...
@@ -90,18 +90,21 @@ int kk_scene_insert_scene_action(const char* type,const char* deviceCode,int epN
const
char
*
propertyValue
,
int
delay
,
const
char
*
sceneId
,
const
char
*
gwdeviceCode
);
int
kk_scene_insert_scene_invokeService
(
const
char
*
type
,
const
char
*
identifier
,
const
char
*
args
,
const
char
*
sceneId
);
int
kk_scene_insert_scene_embed
(
int
delay
,
const
char
*
executeSceneId
,
const
char
*
sceneId
);
int
kk_scene_insert_scene_timer
(
time_t
startTime
,
char
weekflag
,
const
char
*
sceneId
);
int
kk_scene_insert_scene_timer
(
time_t
startTime
,
char
weekflag
,
const
char
*
sceneId
);
int
kk_scene_insert_scene_condition
(
const
char
*
type
,
int
startTime
,
int
endTime
,
int
crossDay
,
char
repeat_days
,
const
char
*
sceneId
);
int
kk_scene_insert_scene_trigger
(
const
char
*
type
,
const
char
*
deviceCode
,
int
epNum
,
const
char
*
propertyName
,
const
char
*
compareType
,
const
char
*
compareValue
,
const
char
*
sceneId
,
int
isAnd
);
int
kk_scene_insert_scene_info
(
const
char
*
roomId
,
const
char
*
sceneName
,
int
sceneType
,
int
enable
,
const
char
*
sceneId
,
char
*
productType
,
char
*
actionRoomId
);
int
kk_scene_update_scene_enable
(
int
enable
,
const
char
*
sceneId
);
int
kk_scene_db_init
(
void
);
int
kk_scene_db_init
(
void
);
int
kk_scene_insert_panel_scene_info
(
int
bindType
,
char
*
buttonId
,
char
*
deviceCode
,
const
char
*
sceneId
,
const
char
*
roomId
,
const
char
*
productType
);
int
kk_scene_delete_quickpanel_info
(
char
*
buttonId
,
char
*
deviceCode
);
int
kk_scene_delete_panel_scene_info
(
char
*
buttonId
,
char
*
deviceCode
);
int
kk_scene_deleteall_panel_scene_info
(
char
*
deviceCode
);
int
kk_scene_update_productType
(
const
char
*
sceneId
,
char
*
productType
);
int
kk_scene_update_actionRoomId
(
const
char
*
sceneId
,
char
*
roomId
);
int
kk_scene_update_device_active
(
char
*
deviceCode
,
int
epNum
,
int
value
);
int
kk_scene_rebuild_device_active
(
char
*
deviceCode
,
int
epNum
);
#endif
midware/midware/scene/kk_scene_handle.c
View file @
7f464c41
...
...
@@ -3,12 +3,12 @@
*
*文件名称: kk_scene_handle.c
*内容摘要: 场景功能数据解析和逻辑处理
*其他说明:
*当前版本:
*其他说明:
*当前版本:
*************************************************************/
/*************************************************************
头文件引用
头文件引用
*************************************************************/
#include <stdio.h>
...
...
@@ -28,7 +28,7 @@
/*************************************************************
全局变量定义
全局变量定义
*************************************************************/
extern
int
g_timezone
;
...
...
@@ -48,7 +48,7 @@ int kk_scene_push_timer_info(time_t starttime,int repeatday,char *sceneId);
int
bodySensor_load
(
void
);
/*************************************************************
函数实现
函数实现
*************************************************************/
static
int
kk_scene_check_value_ex
(
const
char
*
compareType
,
const
char
*
compareValue1
,
const
char
*
compareValue2
)
...
...
@@ -69,15 +69,15 @@ static int kk_scene_check_value_ex(const char * compareType,const char * compare
}
else
if
(
!
strcmp
(
compareType
,
">="
)
&&
strcmp
(
compareValue1
,
compareValue2
)
>=
0
){
res
=
0
;
}
}
else
if
(
!
strcmp
(
compareType
,
"<="
)
&&
strcmp
(
compareValue1
,
compareValue2
)
<=
0
){
res
=
0
;
}
}
else
if
(
!
strcmp
(
compareType
,
"<"
)
&&
strcmp
(
compareValue1
,
compareValue2
)
<
0
){
res
=
0
;
}
}
return
res
;
}
...
...
@@ -126,7 +126,7 @@ static int kk_scene_tsl_load(void)
}
/******************************************************************************/
/* 函 数 名: kk_scene_timer_check_able */
/* 描 述: check定时场景是否有效 */
/* 描 述: check定时场景是否有效 */
/* 输入参数: mina_recmsg: 接收到的命令 */
/* 返 回 值: 返回'0'表示成功,其它返回值表示出错号 */
/******************************************************************************/
...
...
@@ -146,7 +146,7 @@ static int kk_scene_timer_check_able(char *sceneId)
}
/******************************************************************************/
/* 函 数 名: kk_scene_timer_load */
/* 描 述: 时场景定时信息加载 */
/* 描 述: 时场景定时信息加载 */
/* 输入参数: 无 */
/* 返 回 值: 返回'0'表示成功,其它返回值表示出错号 */
/******************************************************************************/
...
...
@@ -169,7 +169,7 @@ static int kk_scene_timer_load(void)
}
}
sqlite3_finalize
(
stmt
);
return
SUCCESS_RETURN
;
}
...
...
@@ -189,9 +189,9 @@ void *kk_scene_yield(void *args)
{
time_t
current_time
=
0
;
kk_scene_action_delay_t
*
actionDelayInfo
=
NULL
;
kk_scene_action_delay_t
*
pTemp
=
NULL
;
kk_scene_action_delay_t
*
pTemp
=
NULL
;
kk_scene_embed_delay_t
*
embedDelayInfo
=
NULL
;
kk_scene_embed_delay_t
*
pTempEmbed
=
NULL
;
kk_scene_embed_delay_t
*
pTempEmbed
=
NULL
;
kk_scene_timer_list_t
*
scene_timer_list
=
NULL
;
while
(
1
)
{
...
...
@@ -202,7 +202,7 @@ void *kk_scene_yield(void *args)
//INFO_PRINT("HAL_Uptimes:%ld\n",HAL_Uptimes());
continue
;
}
_kk_scene_lock
();
/*处理action delay*/
actionDelayInfo
=
p_delay_action_list
;
...
...
@@ -234,8 +234,8 @@ void *kk_scene_yield(void *args)
}
}
_kk_scene_unlock
();
sleep
(
1
);
sleep
(
1
);
_kk_scene_lock
();
/*处理场景嵌套delay*/
embedDelayInfo
=
p_delay_embed_list
;
...
...
@@ -263,11 +263,11 @@ void *kk_scene_yield(void *args)
}
_kk_scene_unlock
();
sleep
(
1
);
/*******定时模式**********/
_kk_scene_lock
();
scene_timer_list
=
p_scene_timer_list
;
while
(
scene_timer_list
){
while
(
scene_timer_list
){
INFO_PRINT
(
"scene_timer_list->starttime:%ld
\n
"
,
scene_timer_list
->
starttime
);
INFO_PRINT
(
"current_time %ld
\n
"
,
current_time
);
if
(
scene_timer_list
->
starttime
!=
0
&&
current_time
>=
scene_timer_list
->
starttime
){
...
...
@@ -329,7 +329,7 @@ int kk_scene_init(void)
static
int
kk_scene_action_info_add
(
kk_scene_action_info_ex_t
**
head
,
kk_scene_action_detail_t
detail
)
{
kk_scene_action_info_ex_t
*
ptr
,
*
pre
;
ptr
=
pre
=
*
head
;
while
(
ptr
!=
NULL
){
...
...
@@ -366,7 +366,7 @@ static int kk_scene_action_info_add(kk_scene_action_info_ex_t **head,kk_scene_ac
int
kk_scene_action_add
(
const
char
*
gwdeviceCode
,
const
char
*
sceneId
,
kk_scene_action_detail_t
detail
)
{
kk_scene_action_t
*
ptr
,
*
pre
;
ptr
=
pre
=
p_kk_scene_action
;
if
(
gwdeviceCode
==
NULL
||
sceneId
==
NULL
){
return
FAIL_RETURN
;
...
...
@@ -382,7 +382,7 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
ptr
=
(
kk_scene_action_t
*
)
malloc
(
sizeof
(
kk_scene_action_t
));
if
(
ptr
==
NULL
){
return
FAIL_RETURN
;
}
}
//printf("kk_scene_action_add add:%p\n",ptr);
memset
(
ptr
,
0
,
sizeof
(
kk_scene_action_t
));
...
...
@@ -412,7 +412,7 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
kk_scene_action_info_ex_t
*
actionTemp
=
NULL
;
kk_scene_action_info_ex_t
*
ptemp
=
NULL
;
ptr
=
p_kk_scene_action
;
while
(
ptr
){
pnext
=
ptr
->
next
;
actionTemp
=
ptr
->
actionInfo
;
...
...
@@ -429,7 +429,7 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
ptr
=
pnext
;
}
p_kk_scene_action
=
NULL
;
return
SUCCESS_RETURN
;
}
...
...
@@ -444,11 +444,11 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
static
void
kk_scene_delete
(
char
*
sceneId
,
int
isforword
)
{
kk_scene_remove_timer_info
(
sceneId
,
1
);
kk_scene_delete_scene_timing
(
sceneId
);
kk_scene_delete_scene_timing
(
sceneId
);
kk_scene_delete_scene_embed
(
sceneId
);
kk_scene_delete_scene_info
(
sceneId
);
kk_scene_delete_scene_trigger
(
sceneId
);
kk_scene_delete_scene_condition
(
sceneId
);
kk_scene_delete_scene_condition
(
sceneId
);
kk_scene_delete_scene_action
(
sceneId
,
isforword
);
kk_scene_delete_scene_invokeservice
(
sceneId
);
}
...
...
@@ -463,7 +463,7 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
int
kk_scene_delete_send_to_gw
(
const
char
*
sceneId
)
{
char
gwdevice
[
5
][
DEVICE_CODE_MAXLEN
]
=
{
0
};
sqlite3_stmt
*
stmt
;
sqlite3_stmt
*
stmt
;
char
*
sqlCmd
=
NULL
;
char
*
gwdeviceCode
=
NULL
;
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
...
...
@@ -471,12 +471,12 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
int
res
=
0
;
cJSON
*
root
;
char
*
out
=
NULL
;
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneActionInfo WHERE sceneId = '%s'"
,
sceneId
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
next:
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
next:
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
gwdeviceCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_GWDEVICECODE
);
if
(
kk_subDev_check_scene_support
(
gwdeviceCode
)
==
1
){
for
(
idx
=
0
;
idx
<
num
;
idx
++
){
...
...
@@ -492,14 +492,14 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
cJSON_AddStringToObject
(
root
,
MSG_SCENE_SCENEID
,
sceneId
);
out
=
cJSON_Print
(
root
);
res
=
kk_msg_execute_scene_delete
(
out
,
gwdeviceCode
);
cJSON_Delete
(
root
);
free
(
out
);
cJSON_Delete
(
root
);
free
(
out
);
}
}
sqlite3_finalize
(
stmt
);
sqlite3_free
(
sqlCmd
);
return
res
;
}
/************************************************************
*功能描述:发送场景action信息给网关,在添加场景时调用
...
...
@@ -523,7 +523,7 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
}
while
(
ptr
){
root
=
cJSON_CreateObject
();
array
=
cJSON_CreateArray
();
array
=
cJSON_CreateArray
();
cJSON_AddStringToObject
(
root
,
MSG_SCENE_SCENEID
,
ptr
->
sceneId
);
ptmp
=
ptr
->
actionInfo
;
while
(
ptr
->
actionInfo
){
...
...
@@ -546,7 +546,7 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
cJSON_AddStringToObject
(
info
,
MSG_SCENE_PROPERTYVALUE
,
ptr
->
actionInfo
->
info
.
propertyValue
);
//}
}
cJSON_AddNumberToObject
(
info
,
MSG_SCENE_DELAY
,
ptr
->
actionInfo
->
info
.
delay
);
cJSON_AddNumberToObject
(
info
,
MSG_SCENE_EPNUM
,
ptr
->
actionInfo
->
info
.
epNum
);
cJSON_AddItemToArray
(
array
,
info
);
...
...
@@ -557,7 +557,7 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
out
=
cJSON_Print
(
root
);
//printf("out:%s\n",out);
kk_msg_execute_scene_set
(
out
,
ptr
->
gwdeviceCode
,
isUpdate
);
cJSON_Delete
(
root
);
cJSON_Delete
(
root
);
free
(
out
);
ptr
=
ptr
->
next
;
}
...
...
@@ -582,13 +582,13 @@ int kk_scene_action_add(const char *gwdeviceCode,const char *sceneId,kk_scene_ac
if
(
action
==
NULL
||
gwdeviceCode
==
NULL
||
sceneId
==
NULL
){
return
INVALID_PARAMETER
;
}
cJSON
*
root
=
cJSON_CreateObject
();
cJSON
*
root
=
cJSON_CreateObject
();
cJSON_AddStringToObject
(
root
,
MSG_SCENE_SCENEID
,
sceneId
);
cJSON_AddItemToObject
(
root
,
MSG_SCENE_ACTIONS
,
action
);
cJSON_AddItemToObject
(
root
,
MSG_SCENE_ACTIONS
,
action
);
out
=
cJSON_Print
(
root
);
printf
(
"kk_scene_muticontrol_info_send:%s
\n
"
,
out
);
kk_msg_execute_scene_set
(
out
,
gwdeviceCode
,
isUpdate
);
cJSON_Delete
(
root
);
cJSON_Delete
(
root
);
free
(
out
);
return
SUCCESS_RETURN
;
}
...
...
@@ -705,7 +705,7 @@ int bodySensor_find(const char *deviceCode,int ep)
}
ptr
=
ptr
->
next
;
}
return
0
;
}
...
...
@@ -718,7 +718,7 @@ int bodySensor_load(void)
char
*
propertyName
=
NULL
;
char
*
deviceCode
=
NULL
;
char
*
compareValue
=
NULL
;
int
epNum
=
0
;
int
sceneType
=
0
,
isEnable
=
0
;
sqlite3_stmt
*
stmt
;
...
...
@@ -789,14 +789,14 @@ void BodySensorNoActive_report(char *deviceCode,int noAct)
char
buf
[
256
]
=
{
0
};
char
val
[
12
]
=
{
0
};
char
msgId
[
32
]
=
{
0
};
dm_mgr_dev_node_t
*
node
=
NULL
;
dm_mgr_dev_node_t
*
node
=
NULL
;
int
res
=
dm_mgr_get_device_by_devicecode
(
deviceCode
,
&
node
);
if
(
res
!=
SUCCESS_RETURN
){
return
;
}
cJSON
*
payload
=
cJSON_CreateObject
();
cJSON
*
params
=
cJSON_CreateObject
();
cJSON_AddStringToObject
(
payload
,
"method"
,
"thing.event.property.post"
);
iotx_report_id
(
msgId
);
...
...
@@ -818,7 +818,7 @@ void BodySensorNoActive_report(char *deviceCode,int noAct)
cJSON_AddStringToObject
(
info
,
MSG_DEVICE_CODE_STR
,
node
->
deviceCode
);
cJSON_AddStringToObject
(
info
,
MSG_PRODUCT_CODE_STR
,
node
->
productCode
);
char
*
infff
=
cJSON_Print
(
info
);
char
*
payload11
=
cJSON_Print
(
payload
);
kk_sendData2app
(
infff
,
payload11
,
0
);
free
(
payload11
);
...
...
@@ -831,16 +831,16 @@ void BodySensorNoActive_report(char *deviceCode,int noAct)
int
BodySensorTrigger_check
(
void
)
{
BodySensorNoActive
*
ptr
=
NULL
;
time_t
cur_time
=
time
(
NULL
);
ptr
=
pBodySensor
;
while
(
ptr
){
if
(
ptr
->
report_time
!=
0
&&
cur_time
>=
ptr
->
report_time
){
ptr
->
report_time
=
0
;
DEBUG_PRINT
(
"
\n\n
-------BodySensorNoActive report----------->
\n\n
"
);
kk_scene_query_body_sensor_trigger_info
(
ptr
->
deviceCode
,
ptr
->
scene_id
);
//上报
BodySensorNoActive_report
(
ptr
->
deviceCode
,
ptr
->
noActive_time
);
}
...
...
@@ -858,7 +858,7 @@ int BodySensorTrigger_report(const char *deviceCode,int ep,cJSON *param)
item
->
valueint
!=
1
){
return
0
;
}
while
(
ptr
){
if
(
!
strcmp
(
ptr
->
deviceCode
,
deviceCode
)){
if
(
ptr
->
noActive_time
){
...
...
@@ -869,7 +869,7 @@ int BodySensorTrigger_report(const char *deviceCode,int ep,cJSON *param)
}
ptr
->
alarm_time
=
time
(
NULL
);
ptr
->
report_time
=
ptr
->
alarm_time
+
(
ptr
->
noActive_time
*
60
);
INFO_PRINT
(
"
\n\n
ptr->alarm_time=%d,ptr->report_time=%d
\n\n
"
,
ptr
->
alarm_time
,
ptr
->
report_time
);
}
else
{
INFO_PRINT
(
"
\n\n
------------------>BodySensorNoActive time 0
\n\n
"
);
...
...
@@ -900,12 +900,12 @@ static int kk_scene_parse_trigger_detail(const char *type,const cJSON *item,cons
cJSON
*
compareValue
;
char
propertyNameBuf
[
64
]
=
{
0
};
int
ep
;
dm_mgr_dev_node_t
*
node
=
NULL
;
dm_mgr_dev_node_t
*
node
=
NULL
;
if
(
type
==
NULL
||
item
==
NULL
||
sceneId
==
NULL
){
return
INVALID_PARAMETER
;
}
deviceCode
=
cJSON_GetObjectItem
(
item
,
MSG_DEVICE_CODE_STR
);
if
(
deviceCode
==
NULL
)
return
FAIL_RETURN
;
if
(
deviceCode
==
NULL
)
return
FAIL_RETURN
;
epNum
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_EPNUM
);
if
(
epNum
==
NULL
){
ep
=
1
;
...
...
@@ -916,13 +916,13 @@ static int kk_scene_parse_trigger_detail(const char *type,const cJSON *item,cons
ep
=
atoi
(
epNum
->
valuestring
);
}
}
propertyName
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_PROPERTYNAME
);
if
(
propertyName
==
NULL
)
return
FAIL_RETURN
;
compareType
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_COMPARETYPE
);
if
(
compareType
==
NULL
)
return
FAIL_RETURN
;
compareValue
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_COMPAREVALUE
);
if
(
compareValue
==
NULL
)
return
FAIL_RETURN
;
if
(
compareValue
==
NULL
)
return
FAIL_RETURN
;
if
(
!
strcmp
(
propertyName
->
valuestring
,
"BodySensorNoActive"
)){
if
(
!
strcmp
(
compareValue
->
valuestring
,
"0"
)){
...
...
@@ -938,32 +938,32 @@ static int kk_scene_parse_trigger_detail(const char *type,const cJSON *item,cons
if
(
res
!=
SUCCESS_RETURN
)
{
ERROR_PRINT
(
"kk_scene_parse_scene_trigger fail!!!
\n
"
);
return
res
;
}
}
if
(
strcmp
(
node
->
productCode
,
"3098"
)
==
0
){
//风机盘管多合一默认处理第一路
if
(
strstr
(
propertyName
->
valuestring
,
"_"
)
==
NULL
){
sprintf
(
propertyNameBuf
,
"%s_%d"
,
propertyName
->
valuestring
,
1
);
ep
=
1
;
ep
=
1
;
}
else
{
memcpy
(
propertyNameBuf
,
propertyName
->
valuestring
,
strlen
(
propertyName
->
valuestring
));
}
}
else
if
(
strcmp
(
node
->
productCode
,
"3097"
)
==
0
){
//地暖多合一默认处理第二路
if
(
strstr
(
propertyName
->
valuestring
,
"_"
)
==
NULL
){
sprintf
(
propertyNameBuf
,
"%s_%d"
,
propertyName
->
valuestring
,
2
);
ep
=
2
;
sprintf
(
propertyNameBuf
,
"%s_%d"
,
propertyName
->
valuestring
,
2
);
ep
=
2
;
}
else
{
memcpy
(
propertyNameBuf
,
propertyName
->
valuestring
,
strlen
(
propertyName
->
valuestring
));
}
}
else
if
(
strcmp
(
node
->
productCode
,
"3099"
)
==
0
){
//新风多合一默认处理第三路
if
(
strstr
(
propertyName
->
valuestring
,
"_"
)
==
NULL
){
sprintf
(
propertyNameBuf
,
"%s_%d"
,
propertyName
->
valuestring
,
3
);
ep
=
3
;
sprintf
(
propertyNameBuf
,
"%s_%d"
,
propertyName
->
valuestring
,
3
);
ep
=
3
;
}
else
{
memcpy
(
propertyNameBuf
,
propertyName
->
valuestring
,
strlen
(
propertyName
->
valuestring
));
}
}
else
if
(
strcmp
(
node
->
productCode
,
"3095"
)
==
0
){
//线控器多合一默认处理第一路
if
(
strstr
(
propertyName
->
valuestring
,
"_"
)
==
NULL
){
sprintf
(
propertyNameBuf
,
"%s_%d"
,
propertyName
->
valuestring
,
1
);
ep
=
1
;
sprintf
(
propertyNameBuf
,
"%s_%d"
,
propertyName
->
valuestring
,
1
);
ep
=
1
;
}
else
{
memcpy
(
propertyNameBuf
,
propertyName
->
valuestring
,
strlen
(
propertyName
->
valuestring
));
}
...
...
@@ -1002,7 +1002,7 @@ int kk_scene_parse_scene_trigger(const cJSON* str,const char *sceneId)
}
triggers
=
cJSON_GetObjectItem
(
str
,
MSG_SCENE_TRIGGERS
);
if
(
triggers
==
NULL
)
return
FAIL_RETURN
;
if
(
triggers
==
NULL
)
return
FAIL_RETURN
;
items
=
cJSON_GetObjectItem
(
triggers
,
MSG_SCENE_ITEMS
);
if
(
items
==
NULL
)
return
FAIL_RETURN
;
item
=
items
->
child
;
...
...
@@ -1027,7 +1027,7 @@ int kk_scene_parse_scene_trigger(const cJSON* str,const char *sceneId)
kk_scene_insert_scene_timer
(
newStart
,
weekflag
,
sceneId
);
kk_scene_push_timer_info
(
newStart
,
weekflag
,(
char
*
)
sceneId
);
}
item
=
item
->
next
;
item
=
item
->
next
;
}
INFO_PRINT
(
"kk_scene_parse_scene_trigger success!!!
\n
"
);
return
SUCCESS_RETURN
;
...
...
@@ -1074,7 +1074,7 @@ static int kk_scene_parse_repeatday(cJSON *repeatday)
else
{
char
*
tmp
=
repeatday
->
valuestring
;
char
*
ptmp
=
NULL
;
char
weekStr
[
4
]
=
{
0
};
char
weekStr
[
4
]
=
{
0
};
while
(
1
){
memset
(
weekStr
,
0x0
,
sizeof
(
weekStr
));
ptmp
=
strstr
(
tmp
,
","
);
...
...
@@ -1095,7 +1095,7 @@ static int kk_scene_parse_repeatday(cJSON *repeatday)
}
INFO_PRINT
(
"kk_scene_parse_repeatday weekflag:%d!!!
\n
"
,
weekflag
);
return
weekflag
;
}
/************************************************************
*功能描述:移除定时信息
...
...
@@ -1201,7 +1201,7 @@ int kk_scene_parse_scene_condition(const cJSON* str,const char *sceneId)
}
conditon
=
cJSON_GetObjectItem
(
str
,
MSG_SCENE_CONDITIONS
);
if
(
conditon
==
NULL
)
return
FAIL_RETURN
;
if
(
conditon
==
NULL
)
return
FAIL_RETURN
;
items
=
cJSON_GetObjectItem
(
conditon
,
MSG_SCENE_ITEMS
);
if
(
items
==
NULL
)
return
FAIL_RETURN
;
...
...
@@ -1213,7 +1213,7 @@ int kk_scene_parse_scene_condition(const cJSON* str,const char *sceneId)
startTime
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_STARTTIME
);
if
(
startTime
==
NULL
)
return
FAIL_RETURN
;
endTime
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_ENDTIME
);
if
(
endTime
==
NULL
)
return
FAIL_RETURN
;
if
(
endTime
==
NULL
)
return
FAIL_RETURN
;
repeatday
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_REPEATDAYS
);
if
(
repeatday
==
NULL
)
return
FAIL_RETURN
;
weekflag
=
kk_scene_parse_repeatday
(
repeatday
);
...
...
@@ -1223,7 +1223,7 @@ int kk_scene_parse_scene_condition(const cJSON* str,const char *sceneId)
if
(
res
!=
SUCCESS_RETURN
){
INFO_PRINT
(
"kk_scene_insert_scene_condition fail!!!
\n
"
);
return
res
;
}
}
}
else
if
(
!
strcmp
(
"trigger/thing/property"
,
type
->
valuestring
)){
kk_scene_parse_trigger_detail
(
type
->
valuestring
,
item
,
sceneId
,
1
);
...
...
@@ -1247,7 +1247,7 @@ int kk_scene_parse_scene_condition(const cJSON* str,const char *sceneId)
*其他说明:
*************************************************************/
static
int
_kk_scene_LightStripSpecialAction_handle
(
cJSON
*
propertyValue
,
char
*
deviceCode
,
int
ep
,
int
idelay
,
char
*
sceneId
,
char
*
fatherDeviceCode
)
{
{
kk_scene_action_detail_t
info
=
{
0
};
cJSON
*
Brightness
=
cJSON_GetObjectItem
(
propertyValue
,
"Brightness"
);
if
(
Brightness
!=
NULL
&&
Brightness
->
type
==
cJSON_Number
){
...
...
@@ -1256,7 +1256,7 @@ static int _kk_scene_LightStripSpecialAction_handle(cJSON* propertyValue,char *d
memcpy
(
info
.
deviceCode
,
deviceCode
,
strlen
(
deviceCode
));
info
.
epNum
=
ep
;
info
.
delay
=
idelay
;
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
}
memset
(
&
info
,
0x0
,
sizeof
(
kk_scene_action_detail_t
));
cJSON
*
WhiteBrightness
=
cJSON_GetObjectItem
(
propertyValue
,
"WhiteBrightness"
);
...
...
@@ -1266,14 +1266,14 @@ static int _kk_scene_LightStripSpecialAction_handle(cJSON* propertyValue,char *d
memcpy
(
info
.
deviceCode
,
deviceCode
,
strlen
(
deviceCode
));
info
.
epNum
=
ep
;
info
.
delay
=
idelay
;
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
}
else
if
(
WhiteBrightness
!=
NULL
&&
WhiteBrightness
->
type
==
cJSON_String
){
memcpy
(
info
.
propertyValue
,
WhiteBrightness
->
valuestring
,
strlen
(
WhiteBrightness
->
valuestring
));
memcpy
(
info
.
propertyName
,
"WhiteBrightness"
,
strlen
(
"WhiteBrightness"
));
memcpy
(
info
.
deviceCode
,
deviceCode
,
strlen
(
deviceCode
));
info
.
epNum
=
ep
;
info
.
delay
=
idelay
;
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
}
memset
(
&
info
,
0x0
,
sizeof
(
kk_scene_action_detail_t
));
cJSON
*
RGBColor
=
cJSON_GetObjectItem
(
propertyValue
,
"RGBColor"
);
...
...
@@ -1304,8 +1304,8 @@ static int _kk_scene_LightStripSpecialAction_handle(cJSON* propertyValue,char *d
memcpy
(
info
.
deviceCode
,
deviceCode
,
strlen
(
deviceCode
));
info
.
epNum
=
ep
;
info
.
delay
=
idelay
;
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
free
(
str
);
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
free
(
str
);
cJSON_Delete
(
rgb
);
}
else
if
(
RGBColor
!=
NULL
&&
RGBColor
->
type
==
cJSON_Array
){
cJSON
*
rgb
=
cJSON_CreateObject
();
...
...
@@ -1316,22 +1316,22 @@ static int _kk_scene_LightStripSpecialAction_handle(cJSON* propertyValue,char *d
cJSON
*
green
=
cJSON_GetArrayItem
(
RGBColor
,
1
);
if
(
green
!=
NULL
){
cJSON_AddNumberToObject
(
rgb
,
"Green"
,
green
->
valueint
);
}
}
cJSON
*
blue
=
cJSON_GetArrayItem
(
RGBColor
,
2
);
if
(
blue
!=
NULL
){
cJSON_AddNumberToObject
(
rgb
,
"Blue"
,
blue
->
valueint
);
}
}
char
*
str
=
cJSON_PrintUnformatted
(
rgb
);
memcpy
(
info
.
propertyValue
,
str
,
strlen
(
str
));
memcpy
(
info
.
propertyName
,
"RGBColor"
,
strlen
(
"RGBColor"
));
memcpy
(
info
.
deviceCode
,
deviceCode
,
strlen
(
deviceCode
));
info
.
epNum
=
ep
;
info
.
delay
=
idelay
;
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
free
(
str
);
kk_scene_action_add
(
fatherDeviceCode
,
sceneId
,
info
);
free
(
str
);
cJSON_Delete
(
rgb
);
}
return
SUCCESS_RETURN
;
}
return
SUCCESS_RETURN
;
}
int
kk_scene_parse_scene_action
(
const
cJSON
*
str
,
const
char
*
sceneId
,
int
isUpdate
)
{
...
...
@@ -1357,8 +1357,8 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
char
propertyValueStr
[
DEVICE_PROPERTY_VALUE_MAX
]
=
{
0
};
printf
(
"----->kk_scene_parse_scene_action
\r\n
"
);
dm_mgr_dev_node_t
*
node
=
NULL
;
dm_mgr_dev_node_t
*
node
=
NULL
;
if
(
str
==
NULL
||
sceneId
==
NULL
){
ERROR_PRINT
(
"kk_scene_parse_scene_action failed
\n
"
);
return
INVALID_PARAMETER
;
...
...
@@ -1381,7 +1381,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
delay
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_DELAY
);
if
(
delay
==
NULL
)
return
FAIL_RETURN
;
exeucteSceneId
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_SCENEID
);
if
(
exeucteSceneId
==
NULL
)
return
FAIL_RETURN
;
if
(
exeucteSceneId
==
NULL
)
return
FAIL_RETURN
;
kk_scene_insert_scene_embed
(
delay
->
valueint
,
exeucteSceneId
->
valuestring
,
sceneId
);
}
else
if
(
!
strcmp
(
typeStr
,
"action/thing/invokeService"
)){
//场景服务,包含场景使能等
...
...
@@ -1390,8 +1390,8 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
arg
=
cJSON_GetObjectItem
(
item
,
MSG_COMMON_ARGS
);
if
(
arg
==
NULL
)
return
FAIL_RETURN
;
argStr
=
cJSON_PrintUnformatted
(
arg
);
kk_scene_insert_scene_invokeService
(
typeStr
,
identifier
->
valuestring
,
argStr
,
sceneId
);
free
(
argStr
);
kk_scene_insert_scene_invokeService
(
typeStr
,
identifier
->
valuestring
,
argStr
,
sceneId
);
free
(
argStr
);
}
else
{
...
...
@@ -1399,7 +1399,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
propertyName
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_PROPERTYNAME
);
if
(
propertyName
==
NULL
)
return
FAIL_RETURN
;
propertyValue
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_PROPERTYVALUE
);
if
(
propertyValue
==
NULL
)
return
FAIL_RETURN
;
if
(
propertyValue
==
NULL
)
return
FAIL_RETURN
;
productType
=
cJSON_GetObjectItem
(
item
,
MSG_PRODUCT_TYPE_STR
);
roomId
=
cJSON_GetObjectItem
(
item
,
MSG_AREA_ROOM_CCUROOMID
);
if
(
productType
!=
NULL
){
...
...
@@ -1424,7 +1424,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
}
else
{
deviceCode
=
cJSON_GetObjectItem
(
item
,
MSG_DEVICE_CODE_STR
);
if
(
deviceCode
==
NULL
)
return
FAIL_RETURN
;
if
(
deviceCode
==
NULL
)
return
FAIL_RETURN
;
epNum
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_EPNUM
);
if
(
epNum
==
NULL
){
iepnum
=
1
;
...
...
@@ -1437,12 +1437,12 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
}
delay
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_DELAY
);
if
(
delay
==
NULL
)
return
FAIL_RETURN
;
int
idelay
=
delay
->
valueint
;
int
idelay
=
delay
->
valueint
;
res
=
dm_mgr_get_device_by_devicecode
(
deviceCode
->
valuestring
,
&
node
);
if
(
res
!=
SUCCESS_RETURN
)
{
item
=
item
->
next
;
continue
;
}
}
memset
(
propertyValueStr
,
0x0
,
sizeof
(
propertyValueStr
));
if
(
propertyValue
->
type
==
cJSON_Number
){
snprintf
(
propertyValueStr
,
sizeof
(
propertyValueStr
),
"%d"
,
propertyValue
->
valueint
);
...
...
@@ -1455,7 +1455,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
free
(
str
);
}
else
if
(
propertyValue
->
type
==
cJSON_String
){
memcpy
(
propertyValueStr
,
propertyValue
->
valuestring
,
strlen
(
propertyValue
->
valuestring
));
}
}
if
(
strcmp
(
propertyName
->
valuestring
,
"ArmingState"
)
==
0
){
ArmingStateFlag
=
1
;
}
...
...
@@ -1482,7 +1482,7 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
memcpy
(
info
.
propertyValue
,
propertyValueStr
,
strlen
(
propertyValueStr
));
info
.
epNum
=
iepnum
;
info
.
delay
=
idelay
;
if
(
strcmp
(
propertyName
->
valuestring
,
"LightStripSpecialAction"
)
!=
0
){
kk_scene_action_add
(
node
->
fatherDeviceCode
,
sceneId
,
info
);
}
...
...
@@ -1494,11 +1494,11 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
res
=
kk_scene_insert_scene_action
(
typeStr
,
node
->
deviceCode
,
iepnum
,
propertyName
->
valuestring
,
propertyValueStr
,
idelay
,
sceneId
,
node
->
fatherDeviceCode
);
}
if
(
res
!=
SUCCESS_RETURN
){
INFO_PRINT
(
"kk_scene_insert_scene_action fail!!!
\n
"
);
return
res
;
}
}
}
}
item
=
item
->
next
;
...
...
@@ -1522,10 +1522,10 @@ int kk_scene_parse_scene_action(const cJSON* str,const char *sceneId,int isUpdat
int
kk_scene_parse_scene_muticontrol
(
const
cJSON
*
str
,
const
char
*
sceneId
,
int
isUpdate
){
int
res
=
0
;
cJSON
*
type
=
NULL
;
cJSON
*
deviceCode
=
NULL
;
cJSON
*
deviceCode
=
NULL
;
cJSON
*
epNum
=
NULL
;
//cJSON *arrayParam = NULL;
dm_mgr_dev_node_t
*
node
=
NULL
;
dm_mgr_dev_node_t
*
node
=
NULL
;
if
(
str
==
NULL
){
ERROR_PRINT
(
"kk_scene_parse_scene_muticontrol failed
\n
"
);
return
INVALID_PARAMETER
;
...
...
@@ -1544,7 +1544,7 @@ int kk_scene_parse_scene_muticontrol(const cJSON* str,const char *sceneId,int is
if
(
deviceCode
==
NULL
)
return
FAIL_RETURN
;
cJSON_AddStringToObject
(
arrayParam
,
MSG_DEVICE_CODE_STR
,
deviceCode
->
valuestring
);
epNum
=
cJSON_GetObjectItem
(
item
,
MSG_SCENE_EPNUM
);
if
(
epNum
==
NULL
)
return
FAIL_RETURN
;
if
(
epNum
==
NULL
)
return
FAIL_RETURN
;
cJSON_AddNumberToObject
(
arrayParam
,
MSG_SCENE_EPNUM
,
atoi
(
epNum
->
valuestring
));
res
=
dm_mgr_get_device_by_devicecode
(
deviceCode
->
valuestring
,
&
node
);
if
(
res
!=
SUCCESS_RETURN
)
{
...
...
@@ -1554,7 +1554,7 @@ int kk_scene_parse_scene_muticontrol(const cJSON* str,const char *sceneId,int is
cJSON_AddItemToArray
(
array
,
arrayParam
);
//break;
kk_scene_insert_scene_action
(
type
->
valuestring
,
deviceCode
->
valuestring
,
atoi
(
epNum
->
valuestring
),
""
,
""
,
0
,
sceneId
,
node
->
fatherDeviceCode
);
""
,
""
,
0
,
sceneId
,
node
->
fatherDeviceCode
);
}
item
=
item
->
next
;
...
...
@@ -1585,7 +1585,7 @@ int kk_scene_parse_addscene(const cJSON* args,char *sceneId,int isUpdate,const c
return
INVALID_PARAMETER
;
}
cJSON
*
room_id
=
cJSON_GetObjectItem
(
args
,
MSG_AREA_ROOM_CCUROOMID
);
if
(
room_id
==
NULL
)
if
(
room_id
==
NULL
)
{
INFO_PRINT
(
"NOT Contain the room info
\n
"
);
}
...
...
@@ -1594,14 +1594,14 @@ int kk_scene_parse_addscene(const cJSON* args,char *sceneId,int isUpdate,const c
cJSON
*
sceneType
=
cJSON_GetObjectItem
(
args
,
MSG_SCENE_SCENCTYPE
);
if
(
sceneType
==
NULL
)
return
FAIL_RETURN
;
cJSON
*
enable
=
cJSON_GetObjectItem
(
args
,
MSG_SCENE_ENABLE
);
if
(
enable
==
NULL
)
return
FAIL_RETURN
;
if
(
enable
==
NULL
)
return
FAIL_RETURN
;
if
(
!
isUpdate
){
kk_tsl_t
*
pSceneShadow
=
NULL
;
HAL_GetTime_s
(
sceneId
);
//use time to create the sceneId
pSceneShadow
=
kk_scene_shadow
();
if
(
pSceneShadow
!=
NULL
){
kk_tsl_set_value
(
kk_tsl_set_event_output_value
,
pSceneShadow
,
MSG_SCENE_ADDNOTIFICATION_SCENEID
,
NULL
,
sceneId
);
dm_msg_scene_event_post
(
MSG_SCENE_ADDNOTIFICATION
,
pSceneShadow
,
msgId
);
dm_msg_scene_event_post
(
MSG_SCENE_ADDNOTIFICATION
,
pSceneShadow
,
msgId
);
}
}
...
...
@@ -1621,7 +1621,7 @@ int kk_scene_parse_addscene(const cJSON* args,char *sceneId,int isUpdate,const c
if
(
res
!=
SUCCESS_RETURN
){
INFO_PRINT
(
"kk_scene_insert_scene_info fail!!!
\n
"
);
return
res
;
}
}
res
=
kk_scene_parse_scene_trigger
(
args
,
sceneId
);
if
(
res
!=
SUCCESS_RETURN
){
...
...
@@ -1632,14 +1632,14 @@ int kk_scene_parse_addscene(const cJSON* args,char *sceneId,int isUpdate,const c
if
(
res
!=
SUCCESS_RETURN
){
ERROR_PRINT
(
"kk_scene_parse_scene_condition failed
\n
"
);
//return FAIL_RETURN;
}
}
res
=
kk_scene_parse_scene_action
(
args
,
sceneId
,
isUpdate
);
if
(
res
!=
SUCCESS_RETURN
){
ERROR_PRINT
(
"kk_scene_parse_scene_action failed
\n
"
);
kk_scene_delete
(
sceneId
,
0
);
return
FAIL_RETURN
;
}
}
}
return
SUCCESS_RETURN
;
}
...
...
@@ -1679,7 +1679,7 @@ int kk_scene_parse_deletescene(char *sceneId)
return
INVALID_PARAMETER
;
}
bodySensor_delete
(
atoi
(
sceneId
));
kk_scene_delete
(
sceneId
,
1
);
kk_scene_delete
(
sceneId
,
1
);
return
SUCCESS_RETURN
;
}
/************************************************************
...
...
@@ -1692,12 +1692,12 @@ int kk_scene_parse_deletescene(char *sceneId)
*************************************************************/
int
kk_scene_get_scene_info
(
const
char
*
sceneId
,
int
*
sceneType
,
int
*
enable
)
{
{
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
sqlite3_stmt
*
stmt
;
int
res
=
FAIL_RETURN
;
char
*
sqlCmd
=
NULL
;
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneInfo WHERE sceneId = '%s'"
,
sceneId
);
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneInfo WHERE sceneId = '%s'"
,
sceneId
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
*
sceneType
=
sqlite3_column_int
(
stmt
,
DB_SCENEINFO_SCENETYPE
);
...
...
@@ -1705,7 +1705,7 @@ int kk_scene_get_scene_info(const char* sceneId,int *sceneType,int *enable)
res
=
SUCCESS_RETURN
;
}
sqlite3_finalize
(
stmt
);
sqlite3_free
(
sqlCmd
);
sqlite3_free
(
sqlCmd
);
return
res
;
}
/************************************************************
...
...
@@ -1718,13 +1718,13 @@ int kk_scene_get_scene_info(const char* sceneId,int *sceneType,int *enable)
*************************************************************/
int
kk_scene_get_quickpanel_info
(
const
char
*
buttonId
,
char
*
deviceCode
,
char
*
sceneId
,
int
*
bindType
)
{
{
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
sqlite3_stmt
*
stmt
;
int
res
=
FAIL_RETURN
;
char
*
pSceneId
=
NULL
;
char
*
sqlCmd
=
NULL
;
sqlCmd
=
sqlite3_mprintf
(
"select * from QuickPanelScene where buttonId = '%s' and deviceCode = '%s'"
,
buttonId
,
deviceCode
);
sqlCmd
=
sqlite3_mprintf
(
"select * from QuickPanelScene where buttonId = '%s' and deviceCode = '%s'"
,
buttonId
,
deviceCode
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
pSceneId
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_QUICKPANEL_SCENEID
);
...
...
@@ -1733,7 +1733,7 @@ int kk_scene_get_quickpanel_info(const char* buttonId,char *deviceCode,char *sce
res
=
SUCCESS_RETURN
;
}
sqlite3_finalize
(
stmt
);
sqlite3_free
(
sqlCmd
);
sqlite3_free
(
sqlCmd
);
return
res
;
}
/************************************************************
...
...
@@ -1782,9 +1782,9 @@ static int kk_scene_update_starttime(kk_scene_timer_list_t *pInfo,time_t current
if
(
curWeek
&
pInfo
->
repeatday
){
pInfo
->
starttime
=
pInfo
->
starttime
+
86400
*
i
;
return
SUCCESS_RETURN
;
}
}
}
}
return
FAIL_RETURN
;
...
...
@@ -1810,7 +1810,7 @@ static time_t kk_scene_creat_new_starttime(time_t starttime,time_t current)
min
=
starttime
%
3600
/
60
;
INFO_PRINT
(
"[hour:%d][min:%d]
\n
"
,
hour
,
min
);
struct
tm
*
c
=
localtime
(
&
current
);
struct
tm
*
c
=
localtime
(
&
current
);
c
->
tm_hour
=
hour
;
c
->
tm_min
=
min
;
c
->
tm_sec
=
0
;
...
...
@@ -1839,7 +1839,7 @@ static time_t kk_scene_creat_timer_starttime(int week,int starttime,time_t curre
startNew
=
starttime
+
g_timezone
*
3600
;
startNew
=
(
startNew
-
86400
)
>=
0
?
(
startNew
-
86400
)
:
startNew
;
INFO_PRINT
(
"kk_scene_creat_timer_starttime:%d
\n
"
,
startNew
);
/*today is not repeat day*/
if
((
week
>
0
)
&&
(
!
(
week
&
(
1
<<
(
curWeek
-
1
)))))
{
...
...
@@ -1852,11 +1852,11 @@ static time_t kk_scene_creat_timer_starttime(int week,int starttime,time_t curre
}
if
(
curWeek
&
week
){
newTime
=
current
+
86400
*
i
;
res
=
kk_scene_creat_new_starttime
(
startNew
,
newTime
);
}
else
{
res
=
kk_scene_creat_new_starttime
(
startNew
,
current
);
}
}
}
}
else
...
...
@@ -1883,25 +1883,25 @@ int kk_scene_check_trigger_condition(const char *sceneId)
char
*
compareValue
=
NULL
;
int
conditionFlag
=
0
;
int
sceneType
=
0
,
isEnable
=
0
;
sqlite3_stmt
*
stmt
;
sqlite3_stmt
*
stmt
;
char
currentValue
[
64
]
=
{
0
};
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
res
=
kk_scene_get_scene_info
(
sceneId
,
&
sceneType
,
&
isEnable
);
if
(
res
!=
SUCCESS_RETURN
||
isEnable
!=
1
){
INFO_PRINT
(
"kk_scene_check_trigger_condition isEnable:%d
\n
"
,
isEnable
);
INFO_PRINT
(
"kk_scene_check_trigger_condition isEnable:%d
\n
"
,
isEnable
);
return
FAIL_RETURN
;
}
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneTriggerInfo WHERE sceneId = '%s' and isAnd = '%d'"
,
sceneId
,
1
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
conditionFlag
=
1
;
pdeviceCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENETRIGGER_DEVICECODE
);
identifier
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENETRIGGER_PROPERTYNAME
);
compareType
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENETRIGGER_COMPARETYPE
);
compareValue
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENETRIGGER_COMPAREVALUE
);
kk_property_db_get_value_directly
(
pdeviceCode
,
identifier
,
currentValue
);
kk_property_db_get_value_directly
(
pdeviceCode
,
identifier
,
currentValue
);
INFO_PRINT
(
"currentValue:%s
\n
"
,
currentValue
);
res
=
kk_scene_check_value_ex
(
compareType
,
currentValue
,
compareValue
);
INFO_PRINT
(
"kk_scene_check_value_ex:res:%d
\n
"
,
res
);
...
...
@@ -1916,7 +1916,7 @@ int kk_scene_check_trigger_condition(const char *sceneId)
if
(
conditionFlag
==
0
){
res
=
SUCCESS_RETURN
;
}
INFO_PRINT
(
"kk_scene_check_trigger_condition:res:%d
\n
"
,
res
);
INFO_PRINT
(
"kk_scene_check_trigger_condition:res:%d
\n
"
,
res
);
return
res
;
}
...
...
@@ -1938,7 +1938,7 @@ int kk_scene_check_condition(const char *sceneId)
int
duration
=
0
;
int
crossDay
=
0
;
int
conditionFlag
=
0
;
sqlite3_stmt
*
stmt
;
sqlite3_stmt
*
stmt
;
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
time_t
current
=
HAL_GetTime
();
curWeek
=
kk_scene_date_to_week
(
current
);
...
...
@@ -2050,7 +2050,7 @@ static int kk_scene_check_value(const char * compareType,const char * compareVal
dvalue
=
atof
(
compareValue
);
ditemValue
=
item
->
valuedouble
;
type
=
1
;
break
;
break
;
case
KK_TSL_DATA_TYPE_TEXT
:
case
KK_TSL_DATA_TYPE_DATE
:
type
=
2
;
//字串
...
...
@@ -2065,57 +2065,57 @@ static int kk_scene_check_value(const char * compareType,const char * compareVal
}
else
if
(
!
strcmp
(
compareType
,
">="
)
&&
strcmp
(
item
->
valuestring
,
compareValue
)
>=
0
){
res
=
0
;
}
}
else
if
(
!
strcmp
(
compareType
,
"<="
)
&&
strcmp
(
item
->
valuestring
,
compareValue
)
<=
0
){
res
=
0
;
}
}
else
if
(
!
strcmp
(
compareType
,
"<"
)
&&
strcmp
(
item
->
valuestring
,
compareValue
)
<
0
){
res
=
0
;
}
}
}
else
if
(
type
==
1
){
if
(
!
strcmp
(
compareType
,
"="
)){
if
(
ditemValue
==
dvalue
)
if
(
ditemValue
==
dvalue
)
res
=
0
;
}
else
if
(
!
strcmp
(
compareType
,
">"
)){
if
(
ditemValue
>
dvalue
)
if
(
ditemValue
>
dvalue
)
res
=
0
;
}
else
if
(
!
strcmp
(
compareType
,
">="
)){
if
(
ditemValue
>=
dvalue
)
if
(
ditemValue
>=
dvalue
)
res
=
0
;
}
else
if
(
!
strcmp
(
compareType
,
"<="
)){
if
(
ditemValue
<=
dvalue
)
if
(
ditemValue
<=
dvalue
)
res
=
0
;
}
else
if
(
!
strcmp
(
compareType
,
"<"
)){
if
(
ditemValue
<
dvalue
)
if
(
ditemValue
<
dvalue
)
res
=
0
;
}
}
}
else
{
if
(
!
strcmp
(
compareType
,
"="
)){
if
(
itemValue
==
ivalue
)
if
(
itemValue
==
ivalue
)
res
=
0
;
}
else
if
(
!
strcmp
(
compareType
,
">"
)){
if
(
itemValue
>
ivalue
)
if
(
itemValue
>
ivalue
)
res
=
0
;
}
else
if
(
!
strcmp
(
compareType
,
">="
)){
if
(
itemValue
>=
ivalue
)
if
(
itemValue
>=
ivalue
)
res
=
0
;
}
else
if
(
!
strcmp
(
compareType
,
"<="
)){
if
(
itemValue
<=
ivalue
)
if
(
itemValue
<=
ivalue
)
res
=
0
;
}
else
if
(
!
strcmp
(
compareType
,
"<"
)){
if
(
itemValue
<
ivalue
)
if
(
itemValue
<
ivalue
)
res
=
0
;
}
}
}
return
res
;
...
...
@@ -2131,7 +2131,7 @@ static int kk_scene_check_value(const char * compareType,const char * compareVal
static
void
kk_scene_send_action_msg
(
kk_scene_action_info_t
*
pInfo
)
{
int
ivalue
=
0
;
double
dvalue
=
0
;
double
dvalue
=
0
;
int
valueType
=
0
;
if
(
pInfo
==
NULL
){
return
;
...
...
@@ -2153,7 +2153,7 @@ static void kk_scene_send_action_msg(kk_scene_action_info_t *pInfo)
if
(
strstr
(
pInfo
->
propertyName
,
"PowerSwitch"
)
!=
NULL
&&
\
!
strcmp
(
pInfo
->
propertyValue
,
"10"
)){
kk_property_db_get_value
(
pInfo
->
deviceCode
,
pInfo
->
propertyName
,
&
ivalue
);
ivalue
=
!
ivalue
;
ivalue
=
!
ivalue
;
}
else
{
ivalue
=
atoi
(
pInfo
->
propertyValue
);
...
...
@@ -2170,10 +2170,10 @@ static void kk_scene_send_action_msg(kk_scene_action_info_t *pInfo)
cJSON_AddStringToObject
(
root
,
pInfo
->
propertyName
,
pInfo
->
propertyValue
);
break
;
}
char
*
out
=
cJSON_Print
(
root
);
kk_msg_execute_property_set
(
pInfo
->
productCode
,
pInfo
->
deviceCode
,
out
,
pInfo
->
fatherdeviceCode
);
cJSON_Delete
(
root
);
cJSON_Delete
(
root
);
free
(
out
);
free
(
pInfo
);
return
;
...
...
@@ -2197,7 +2197,7 @@ static int kk_scene_push_action_list(kk_scene_action_info_t *actionInfo,int dela
while
(
ptr
){
ptemp
=
ptr
;
ptr
=
ptr
->
next
;
}
}
ptr
=
malloc
(
sizeof
(
kk_scene_action_delay_t
));
if
(
ptr
==
NULL
)
{
return
MEMORY_NOT_ENOUGH
;
...
...
@@ -2227,11 +2227,11 @@ static int kk_scene_push_action_list(kk_scene_action_info_t *actionInfo,int dela
static
int
kk_scene_start_action
(
const
char
*
deviceCode
,
const
char
*
propertyName
,
const
char
*
valueS
,
int
delay
)
{
int
res
=
0
;
INFO_PRINT
(
"[%s][%d]kk_scene_start_action called
\n
"
,
__FUNCTION__
,
__LINE__
);
dm_mgr_dev_node_t
*
node
=
NULL
;
kk_scene_action_info_t
*
actionInfo
=
NULL
;
if
(
deviceCode
==
NULL
||
propertyName
==
NULL
||
valueS
==
NULL
){
ERROR_PRINT
(
"[%d]kk_scene_send_action fail!!!
\n
"
,
__LINE__
);
return
INVALID_PARAMETER
;
...
...
@@ -2242,7 +2242,7 @@ static int kk_scene_start_action(const char *deviceCode,const char *propertyName
}
actionInfo
=
malloc
(
sizeof
(
kk_scene_action_info_t
));
if
(
actionInfo
==
NULL
)
{
return
MEMORY_NOT_ENOUGH
;
return
MEMORY_NOT_ENOUGH
;
}
memset
(
actionInfo
,
0x0
,
sizeof
(
kk_scene_action_info_t
));
memcpy
(
actionInfo
->
deviceCode
,
deviceCode
,
strlen
(
deviceCode
));
...
...
@@ -2274,14 +2274,14 @@ int kk_scene_execute_action(const char* sceneId,char *msgId)
int
res
=
FAIL_RETURN
;
char
*
deviceCode
=
NULL
;
char
*
propertyName
=
NULL
;
char
*
propertyValue
=
NULL
;
char
*
propertyValue
=
NULL
;
char
*
gwdeviceCode
=
NULL
;
int
delay
=
0
;
char
*
sqlCmd
=
NULL
;
//
char
gwdevice
[
5
][
DEVICE_CODE_MAXLEN
]
=
{
0
};
int
idx
=
0
,
num
=
0
;
sqlite3_stmt
*
stmt
;
sqlite3_stmt
*
stmt
;
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
INFO_PRINT
(
"[%s][%d] kk_scene_execute_action now!!!
\n
"
,
__FUNCTION__
,
__LINE__
);
//嵌套场景处理
...
...
@@ -2318,7 +2318,7 @@ next:
deviceCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_DEVICECODE
);
propertyName
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_PROPERTYNAME
);
propertyValue
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_PROPERTYVALUE
);
delay
=
sqlite3_column_int
(
stmt
,
DB_SCENEACTION_DELAY
);
delay
=
sqlite3_column_int
(
stmt
,
DB_SCENEACTION_DELAY
);
res
=
kk_scene_start_action
(
deviceCode
,
propertyName
,
propertyValue
,
delay
);
}
}
...
...
@@ -2374,15 +2374,15 @@ static int kk_scene_embed_find(const char *sceneId)
int
find
=
0
;
char
*
sqlCmd
=
NULL
;
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
sqlite3_stmt
*
stmt
;
sqlite3_stmt
*
stmt
;
int
delay
=
0
;
char
*
executeSceneId
=
NULL
;
if
(
sceneId
==
NULL
){
return
INVALID_PARAMETER
;
}
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneEmbedInfo WHERE sceneId= '%s'"
,
sceneId
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
INFO_PRINT
(
"kk_scene_embed_find:%s
\n
"
,
sceneId
);
find
=
1
;
...
...
@@ -2395,9 +2395,9 @@ static int kk_scene_embed_find(const char *sceneId)
else
{
kk_scene_execute_action
(
executeSceneId
,
NULL
);
}
}
}
sqlite3_finalize
(
stmt
);
sqlite3_free
(
sqlCmd
);
sqlite3_free
(
sqlCmd
);
return
find
;
}
/************************************************************
...
...
@@ -2440,14 +2440,14 @@ static int kk_scene_invokeService_find(const char *sceneId)
int
find
=
0
;
char
*
sqlCmd
=
NULL
;
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
sqlite3_stmt
*
stmt
;
sqlite3_stmt
*
stmt
;
char
*
identifier
=
NULL
;
char
*
args
=
NULL
;
if
(
sceneId
==
NULL
){
return
INVALID_PARAMETER
;
}
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneInvokeService WHERE sceneId= '%s'"
,
sceneId
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
find
=
1
;
INFO_PRINT
(
"kk_scene_invokeService_find:%s
\n
"
,
sceneId
);
...
...
@@ -2458,9 +2458,9 @@ static int kk_scene_invokeService_find(const char *sceneId)
kk_scene_enableScene_handle
(
args
);
break
;
}
}
}
sqlite3_finalize
(
stmt
);
sqlite3_free
(
sqlCmd
);
sqlite3_free
(
sqlCmd
);
return
find
;
}
/************************************************************
...
...
@@ -2500,9 +2500,9 @@ int kk_scene_query_trigger_info(const char *deviceCode,cJSON *param)
propertyValueType
=
kk_dm_get_property_type
(
deviceCode
,
identifier
);
res
=
kk_scene_check_value
(
compareType
,
compareValue
,
item
,
propertyValueType
);
if
(
res
==
SUCCESS_RETURN
){
INFO_PRINT
(
"[%d]kk_scene_check_condition enter!!!
\n
"
,
__LINE__
);
res
=
kk_scene_check_condition
(
sceneId
);
if
(
res
==
SUCCESS_RETURN
){
...
...
@@ -2575,7 +2575,7 @@ void kk_scene_execute_event_post(const char* sceneId,const char *msgId)
if
(
msgId
==
NULL
){
//sprintf(msgIdbuf,"%d",iotx_report_id());
iotx_report_id
(
msgIdbuf
);
//sprintf(msgId,"%d",iotx_report_id());
//sprintf(msgId,"%d",iotx_report_id());
}
else
{
...
...
@@ -2594,7 +2594,7 @@ static int kk_quickpanel_pro_get(const char* sceneId,char *propertyValue)
int
res
=
FAIL_RETURN
;
char
*
sqlCmd
=
NULL
;
char
*
pPropertyValue
=
NULL
;
sqlite3_stmt
*
stmt
;
sqlite3_stmt
*
stmt
;
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneActionInfo WHERE sceneId = '%s'"
,
sceneId
);
...
...
@@ -2628,7 +2628,7 @@ int kk_scene_execute_quickpanel(const char *buttonId,char *deviceCode)
char
provalue
[
4
]
=
{
0
};
kk_quickpanel_pro_get
(
sceneId
,
provalue
);
kk_service_arming_set
(
provalue
);
}
else
{
kk_scene_execute_action
(
sceneId
,
NULL
);
}
...
...
@@ -2655,28 +2655,28 @@ static int _kk_rebuild_device_active(char *sceneid)
int
epNum
=
0
;
int
isMuti
=
0
;
int
count
=
0
;
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneActionInfo WHERE sceneid = '%s' and active = '%d'"
,
sceneid
,
1
);
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneActionInfo WHERE sceneid = '%s' and active = '%d'"
,
sceneid
,
1
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
cJSON
*
array
=
cJSON_CreateArray
();
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
count
++
;
pSceneType
=
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_TYPE
);
pDeviceCode
=
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_DEVICECODE
);
pSceneType
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_TYPE
);
pDeviceCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_DEVICECODE
);
epNum
=
sqlite3_column_int
(
stmt
,
DB_SCENEACTION_EPNUM
);
gwDeviceCode
=
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_GWDEVICECODE
);
gwDeviceCode
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_GWDEVICECODE
);
if
(
strcmp
(
pSceneType
,
"action/thing/group"
)
==
0
){
cJSON
*
arrayParam
=
cJSON_CreateObject
();
cJSON_AddStringToObject
(
arrayParam
,
MSG_SCENE_TYPE
,
pSceneType
);
cJSON_AddStringToObject
(
arrayParam
,
MSG_DEVICE_CODE_STR
,
pDeviceCode
);
cJSON_Add
String
ToObject
(
arrayParam
,
MSG_SCENE_EPNUM
,
epNum
);
cJSON_Add
Number
ToObject
(
arrayParam
,
MSG_SCENE_EPNUM
,
epNum
);
isMuti
=
1
;
cJSON_AddItemToArray
(
array
,
arrayParam
);
}
else
{
kk_scene_action_detail_t
info
=
{
0
};
char
*
propertyName
=
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_PROPERTYNAME
);
char
*
propertyValueStr
=
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_PROPERTYVALUE
);
char
*
propertyName
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_PROPERTYNAME
);
char
*
propertyValueStr
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_PROPERTYVALUE
);
int
idelay
=
sqlite3_column_int
(
stmt
,
DB_SCENEACTION_DELAY
);
memcpy
(
info
.
deviceCode
,
pDeviceCode
,
strlen
(
pDeviceCode
));
memcpy
(
info
.
propertyName
,
propertyName
,
strlen
(
propertyName
));
...
...
@@ -2697,9 +2697,9 @@ static int _kk_rebuild_device_active(char *sceneid)
_kk_scene_LightStripSpecialAction_handle
(
propertyValueJson
,
pDeviceCode
,
epNum
,
idelay
,(
char
*
)
sceneid
,
gwDeviceCode
);
cJSON_Delete
(
propertyValueJson
);
}
}
}
}
}
}
if
(
count
==
0
){
//全部移到待分配
kk_scene_delete_send_to_gw
(
sceneid
);
}
else
{
...
...
@@ -2710,7 +2710,7 @@ static int _kk_rebuild_device_active(char *sceneid)
}
}
sqlite3_free
(
sqlCmd
);
sqlite3_finalize
(
stmt
);
sqlite3_finalize
(
stmt
);
return
0
;
}
int
kk_scene_rebuild_device_active
(
char
*
deviceCode
,
int
epNum
)
...
...
@@ -2722,14 +2722,14 @@ int kk_scene_rebuild_device_active(char *deviceCode,int epNum)
char
*
scene_id
=
NULL
;
kk_scene_ctx_t
*
ctx
=
_kk_scene_get_ctx
();
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneActionInfo WHERE deviceCode = '%s' and epNum= '%d'"
,
deviceCode
,
epNum
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
sqlCmd
=
sqlite3_mprintf
(
"select * from SceneActionInfo WHERE deviceCode = '%s' and epNum= '%d'"
,
deviceCode
,
epNum
);
sqlite3_prepare_v2
(
ctx
->
pDb
,
sqlCmd
,
strlen
(
sqlCmd
),
&
stmt
,
NULL
);
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
scene_id
=
(
char
*
)
sqlite3_column_text
(
stmt
,
DB_SCENEACTION_SCENEID
);
_kk_rebuild_device_active
(
scene_id
);
usleep
(
100
*
1000
);
}
sqlite3_free
(
sqlCmd
);
sqlite3_finalize
(
stmt
);
sqlite3_finalize
(
stmt
);
return
SUCCESS_RETURN
;
}
\ No newline at end of file
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