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
d6172530
Commit
d6172530
authored
Sep 18, 2020
by
陈伟灿
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'cwc' into 'master'
Cwc See merge request chenweican/k-sdk!10
parents
d4dbde19
7c5ca916
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
1158 additions
and
1160 deletions
+1158
-1160
midware/midware/dm/kk_dm_mng.c
midware/midware/dm/kk_dm_mng.c
+7
-6
midware/midware/dm/kk_linkkit.c
midware/midware/dm/kk_linkkit.c
+1
-1
midware/midware/dm/kk_property_db.c
midware/midware/dm/kk_property_db.c
+4
-4
midware/midware/dm/kk_sub_db.c
midware/midware/dm/kk_sub_db.c
+12
-10
midware/tsl/tsl_handle/kk_tsl_func.c
midware/tsl/tsl_handle/kk_tsl_func.c
+1134
-1139
No files found.
midware/midware/dm/kk_dm_mng.c
View file @
d6172530
...
...
@@ -202,7 +202,7 @@ int dm_mgr_properities_db_create(kk_tsl_t* dev_shadow,char *deviceCode,int devTy
}
}
int
dm_mgr_device_create
(
_IN_
int
dev_type
,
_IN_
char
productCode
[
PRODUCT_CODE_MAXLEN
],
_IN_
char
deviceCode
[
DEVICE_CODE_MAXLEN
],
_IN_
char
mac
[
DEVICE_MAC_MAXLEN
],
_IN_
char
fatherDeviceCode
[
DEVICE_CODE_MAXLEN
],
_OU_
int
*
devid
)
_IN_
char
mac
[
DEVICE_MAC_MAXLEN
],
_IN_
char
fatherDeviceCode
[
DEVICE_CODE_MAXLEN
],
_IN_
int
isOffline
,
_OU_
int
*
devid
)
{
int
res
=
0
;
dm_mgr_ctx
*
ctx
=
_dm_mgr_get_ctx
();
...
...
@@ -235,6 +235,7 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA
node
->
devid
=
_dm_mgr_next_devid
();
node
->
dev_type
=
dev_type
;
node
->
dev_shadow
=
NULL
;
node
->
isOffline
=
isOffline
;
if
(
productCode
!=
NULL
)
{
memcpy
(
node
->
productCode
,
productCode
,
strlen
(
productCode
));
}
...
...
@@ -247,7 +248,7 @@ int dm_mgr_device_create(_IN_ int dev_type,_IN_ char productCode[PRODUCT_CODE_MA
if
(
dev_type
!=
KK_DM_DEVICE_CCU
&&
fatherDeviceCode
!=
NULL
)
{
memcpy
(
node
->
fatherDeviceCode
,
fatherDeviceCode
,
strlen
(
fatherDeviceCode
));
}
node
->
timestamp
=
HAL_UptimeMs
()
;
node
->
timestamp
=
0
;
//node->dev_status = IOTX_DM_DEV_STATUS_AUTHORIZED;
tsl_str
=
kk_load_json
(
productCode
,
dev_type
);
if
(
tsl_str
!=
NULL
)
...
...
@@ -402,7 +403,7 @@ int dm_mgr_check_heartbeat_timeout(uint64_t timestamp)
//return DEVICE_HEARTBEAT_TIMEOUT;
}
else
{
if
(
search_node
->
isOffline
==
1
)
{
//need send online
if
(
search_node
->
isOffline
==
1
&&
search_node
->
timestamp
!=
0
)
{
//need send online
INFO_PRINT
(
"---------->dev online again,send online
\n
"
);
search_node
->
isOffline
=
0
;
iotx_dm_dev_online
(
search_node
->
devid
);
...
...
@@ -473,7 +474,7 @@ int dm_mgr_init(void)
HAL_Get_mac
(
mac
);
res
=
dm_mgr_device_create
(
KK_DM_DEVICE_CCU
,
KK_DM_CCU_DEVICE_PRODUCT_CODE
,
"CCU_66666"
,
mac
,
""
,
&
devId
);
res
=
dm_mgr_device_create
(
KK_DM_DEVICE_CCU
,
KK_DM_CCU_DEVICE_PRODUCT_CODE
,
"CCU_66666"
,
mac
,
""
,
0
,
&
devId
);
if
(
res
!=
SUCCESS_RETURN
)
{
goto
ERROR
;
}
...
...
@@ -1340,10 +1341,10 @@ int dm_mgr_ota_report_version(_IN_ int devid, char *version)
int
dm_mgr_subdev_create
(
int
devtype
,
_IN_
char
productCode
[
PRODUCT_CODE_MAXLEN
],
_IN_
char
deviceCode
[
DEVICE_CODE_MAXLEN
],
_IN_
char
mac
[
DEVICE_MAC_MAXLEN
],
_IN_
char
fatherDeviceCode
[
DEVICE_CODE_MAXLEN
],
_OU_
int
*
devid
){
_IN_
char
mac
[
DEVICE_MAC_MAXLEN
],
_IN_
char
fatherDeviceCode
[
DEVICE_CODE_MAXLEN
],
_IN_
int
isOffline
,
_OU_
int
*
devid
){
int
res
=
0
;
res
=
dm_mgr_device_create
(
devtype
,
productCode
,
deviceCode
,
mac
,
fatherDeviceCode
,
devid
);
res
=
dm_mgr_device_create
(
devtype
,
productCode
,
deviceCode
,
mac
,
fatherDeviceCode
,
isOffline
,
devid
);
if
(
TSL_ALREADY_EXIST
==
res
)
{
ERROR_PRINT
(
"SUBDEV ALREADY EXIST!!!
\n
"
);
...
...
midware/midware/dm/kk_linkkit.c
View file @
d6172530
...
...
@@ -1732,7 +1732,7 @@ int kk_mid_subdev_add(int devType, char productCode[PRODUCT_CODE_MAXLEN], char d
int
res
=
0
;
int
devid
=
0
;
res
=
dm_mgr_subdev_create
(
devType
,
productCode
,
deviceCode
,
mac
,
fatherDeviceCode
,
&
devid
);
res
=
dm_mgr_subdev_create
(
devType
,
productCode
,
deviceCode
,
mac
,
fatherDeviceCode
,
0
,
&
devid
);
if
(
res
!=
SUCCESS_RETURN
&&
TSL_ALREADY_EXIST
!=
res
)
{
ERROR_PRINT
(
"subdev create Failed
\n
"
);
return
FAIL_RETURN
;
...
...
midware/midware/dm/kk_property_db.c
View file @
d6172530
...
...
@@ -113,7 +113,7 @@ static int _kk_check_property_exist(const char* deviceCode,const char* identifie
const
char
*
searchCmd
=
"select * from PropertiesInfo;"
;
_kk_property_db_lock
();
sqlite3_prepare_v2
(
ctx
->
pDb
,
searchCmd
,
strlen
(
searchCmd
),
&
stmt
,
NULL
);
INFO_PRINT
(
"total_column = %d
\n
"
,
sqlite3_column_count
(
stmt
));
//
INFO_PRINT("total_column = %d\n", sqlite3_column_count(stmt));
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
pDeviceCode
=
sqlite3_column_text
(
stmt
,
DB_DEVICECODE
);
pIdentifier
=
sqlite3_column_text
(
stmt
,
DB_IDENTIFITER
);
...
...
@@ -123,7 +123,7 @@ static int _kk_check_property_exist(const char* deviceCode,const char* identifie
break
;
}
}
INFO_PRINT
(
"
\n
"
);
//
INFO_PRINT("\n");
sqlite3_finalize
(
stmt
);
_kk_property_db_unlock
();
return
isExist
;
...
...
@@ -155,7 +155,7 @@ int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_d
ERROR_PRINT
(
"SQL error: %s
\n
"
,
zErrMsg
);
sqlite3_free
(
zErrMsg
);
}
else
{
INFO_PRINT
(
"sub device insert data successfully
\n
"
);
//
INFO_PRINT("sub device insert data successfully\n");
}
sqlite3_free
(
sqlCmd
);
_kk_property_db_unlock
();
...
...
@@ -179,7 +179,7 @@ int kk_property_db_update_value(const char *deviceCode,const char *identifier,co
ERROR_PRINT
(
"SQL error: %s
\n
"
,
zErrMsg
);
sqlite3_free
(
zErrMsg
);
}
else
{
DEBUG_PRINT
(
"kk_property_db_update_value successfully
\n
"
);
//
DEBUG_PRINT("kk_property_db_update_value successfully\n");
}
sqlite3_free
(
sqlCmd
);
_kk_property_db_unlock
();
...
...
midware/midware/dm/kk_sub_db.c
View file @
d6172530
...
...
@@ -103,10 +103,12 @@ static int _kk_load_subDevice(void)
_kk_subDb_lock
();
sqlite3_prepare_v2
(
ctx
->
pDb
,
searchCmd
,
strlen
(
searchCmd
),
&
stmt
,
NULL
);
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
res
=
dm_mgr_subdev_create
(
sqlite3_column_int
(
stmt
,
DB_DEVTYPE
),
sqlite3_column_text
(
stmt
,
DB_PRODUCTCODE
),
res
=
dm_mgr_subdev_create
(
sqlite3_column_int
(
stmt
,
DB_DEVTYPE
),
sqlite3_column_text
(
stmt
,
DB_PRODUCTCODE
),
sqlite3_column_text
(
stmt
,
DB_DEVICECODE
),
sqlite3_column_text
(
stmt
,
DB_MAC
),
sqlite3_column_text
(
stmt
,
DB_FATHERDEVICECODE
),
&
devId
);
sqlite3_column_text
(
stmt
,
DB_MAC
),
sqlite3_column_text
(
stmt
,
DB_FATHERDEVICECODE
),
sqlite3_column_int
(
stmt
,
DB_ONLINE
),
&
devId
);
if
(
res
!=
SUCCESS_RETURN
){
ERROR_PRINT
(
"[%s][%d]dm_mgr_subdev_create FAIL!!!
\n
"
,
__FUNCTION__
,
__LINE__
);
...
...
@@ -120,8 +122,8 @@ static int _kk_load_subDevice(void)
//sync the data from property db
kk_property_sync_values
(
sqlite3_column_text
(
stmt
,
DB_DEVICECODE
));
usleep
(
100000
);
//post the property to cloud
dm_msg_thing_property_post_all
(
sqlite3_column_text
(
stmt
,
DB_DEVICECODE
));
//kk_dm_ota_report_version(devId,sqlite3_column_text(stmt, DB_VERSION));//post version
...
...
@@ -160,7 +162,7 @@ static int _kk_check_subDev_exist(const char* deviceCode)
const
char
*
searchCmd
=
"select * from SubDeviceInfo;"
;
_kk_subDb_lock
();
sqlite3_prepare_v2
(
ctx
->
pDb
,
searchCmd
,
strlen
(
searchCmd
),
&
stmt
,
NULL
);
INFO_PRINT
(
"total_column = %d
\n
"
,
sqlite3_column_count
(
stmt
));
//
INFO_PRINT("total_column = %d\n", sqlite3_column_count(stmt));
while
(
sqlite3_step
(
stmt
)
==
SQLITE_ROW
){
pmac
=
sqlite3_column_text
(
stmt
,
DB_DEVICECODE
);
if
(
!
strcmp
(
deviceCode
,
pmac
))
...
...
@@ -202,7 +204,7 @@ int kk_subDev_insert_db(int devType,char productCode[PRODUCT_CODE_MAXLEN], \
ERROR_PRINT
(
"SQL error: %s
\n
"
,
zErrMsg
);
sqlite3_free
(
zErrMsg
);
}
else
{
INFO_PRINT
(
"sub device insert data successfully
\n
"
);
//
INFO_PRINT("sub device insert data successfully\n");
}
sqlite3_free
(
sqlCmd
);
ctx
->
subDevNum
++
;
...
...
@@ -226,7 +228,7 @@ int kk_subDev_delete_by_dcode(char deviceCode[DEVICE_CODE_MAXLEN])
ERROR_PRINT
(
"SQL error: %s
\n
"
,
zErrMsg
);
sqlite3_free
(
zErrMsg
);
}
else
{
INFO_PRINT
(
"Table delete data successfully
\n
"
);
//
INFO_PRINT("Table delete data successfully\n");
}
sqlite3_free
(
sqlCmd
);
_kk_subDb_unlock
();
...
...
@@ -241,7 +243,7 @@ int kk_subDev_update_offline(int isOffline,const char *deviceCode)
char
*
zErrMsg
=
0
;
kk_subDb_ctx_t
*
ctx
=
_kk_subDb_get_ctx
();
_kk_subDb_lock
();
//
_kk_subDb_lock();
sqlCmd
=
sqlite3_mprintf
(
"UPDATE SubDeviceInfo SET isOffline=%d WHERE deviceCode= '%s'"
,
isOffline
,
deviceCode
);
INFO_PRINT
(
"kk_subDev_update_offline sqlCmd:%s
\n
"
,
sqlCmd
);
rc
=
sqlite3_exec
(
ctx
->
pDb
,
sqlCmd
,
NULL
,
NULL
,
&
zErrMsg
);
...
...
@@ -249,10 +251,10 @@ int kk_subDev_update_offline(int isOffline,const char *deviceCode)
ERROR_PRINT
(
"SQL error: %s
\n
"
,
zErrMsg
);
sqlite3_free
(
zErrMsg
);
}
else
{
INFO_PRINT
(
"Table updata data successfully
\n
"
);
//
INFO_PRINT("Table updata data successfully\n");
}
sqlite3_free
(
sqlCmd
);
_kk_subDb_unlock
();
//
_kk_subDb_unlock();
return
SUCCESS_RETURN
;
}
int
kk_subDev_update_auth
(
int
isAuth
,
const
char
*
deviceCode
)
...
...
midware/tsl/tsl_handle/kk_tsl_func.c
View file @
d6172530
...
...
@@ -104,7 +104,7 @@ static int _kk_tsl_float_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ void *va
float
float_set
=
(
value
==
NULL
)
?
(
0
)
:
(
*
(
float
*
)
value
);
data_value
->
value_float
=
float_set
;
printf
(
"Current Float Value Be Set(Float): %f
\n
"
,
data_value
->
value_float
);
//printf("Current Float Value Be Set(Float): %f\n", data_value->value_float);
return
SUCCESS_RETURN
;
}
...
...
@@ -114,7 +114,7 @@ static int _kk_tsl_double_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ void *v
double
double_set
=
(
value
==
NULL
)
?
(
0
)
:
(
*
(
double
*
)
value
);
data_value
->
value_double
=
double_set
;
printf
(
"Current Double Value Be Set(Double): %f
\n
"
,
data_value
->
value_double
);
//printf("Current Double Value Be Set(Double): %f\n", data_value->value_double);
return
SUCCESS_RETURN
;
}
...
...
@@ -133,7 +133,7 @@ static int _kk_tsl_text_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ void *val
if
(
res
!=
SUCCESS_RETURN
)
{
return
MEMORY_NOT_ENOUGH
;
}
printf
(
"Current Text Value Be Set(String): %s
\n
"
,
data_value
->
value
);
//printf("Current Text Value Be Set(String): %s\n", data_value->value);
return
SUCCESS_RETURN
;
}
...
...
@@ -145,7 +145,7 @@ static int _kk_tsl_enum_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ void *val
enum_set
=
(
enum_set
<
0
)
?
(
0
)
:
(
enum_set
);
data_value
->
value_int
=
enum_set
;
printf
(
"Current Enum Value Be Set(Enum): %d
\n
"
,
data_value
->
value_int
);
//printf("Current Enum Value Be Set(Enum): %d\n", data_value->value_int);
return
SUCCESS_RETURN
;
}
...
...
@@ -164,7 +164,7 @@ static int _kk_tsl_date_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ void *val
if
(
res
!=
SUCCESS_RETURN
)
{
return
MEMORY_NOT_ENOUGH
;
}
printf
(
"Current Date Value Be Set(String): %s
\n
"
,
data_value
->
value
);
//printf("Current Date Value Be Set(String): %s\n", data_value->value);
return
SUCCESS_RETURN
;
}
...
...
@@ -176,7 +176,7 @@ static int _kk_tsl_bool_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ void *val
int_set
=
(
int_set
==
0
)
?
(
int_set
)
:
((
int_set
==
1
)
?
(
int_set
)
:
(
0
));
data_value
->
value_int
=
int_set
;
printf
(
"Current Bool Value Be Set(Bool): %d
\n
"
,
data_value
->
value_int
);
//printf("Current Bool Value Be Set(Bool): %d\n", data_value->value_int);
return
SUCCESS_RETURN
;
}
...
...
@@ -185,7 +185,7 @@ static int _kk_tsl_int_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ void *valu
int
int_set
=
(
value
==
NULL
)
?
(
0
)
:
(
*
(
int
*
)
value
);
data_value
->
value_int
=
int_set
;
printf
(
"Current Int Value Be Set(Int): %d
\n
"
,
data_value
->
value_int
);
//printf("Current Int Value Be Set(Int): %d\n", data_value->value_int);
return
SUCCESS_RETURN
;
}
...
...
@@ -206,8 +206,8 @@ static int _kk_tsl_array_text_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ voi
if
(
res
!=
SUCCESS_RETURN
)
{
return
FAIL_RETURN
;
}
printf
(
"Current Array Value Be Set(Text String), Index: %d, Value: %s
\n
"
,
index
,
*
((
char
**
)(
complex_array
->
value
)
+
index
));
//printf("Current Array Value Be Set(Text String), Index: %d, Value: %s\n", index,
//*((char **)(complex_array->value) + index));
return
SUCCESS_RETURN
;
}
...
...
@@ -219,7 +219,7 @@ static int _kk_tsl_array_enum_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ voi
int
int_set
=
(
value
==
NULL
)
?
(
0
)
:
(
*
(
int
*
)
value
);
*
((
int
*
)(
complex_array
->
value
)
+
index
)
=
int_set
;
printf
(
"Current Array Value Be Set(Enum), Index: %d, Value: %d
\n
"
,
index
,
*
((
int
*
)(
complex_array
->
value
)
+
index
));
//printf("Current Array Value Be Set(Enum), Index: %d, Value: %d\n", index, *((int *)(complex_array->value) + index));
return
SUCCESS_RETURN
;
}
...
...
@@ -241,8 +241,8 @@ static int _kk_tsl_array_date_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ voi
if
(
res
!=
SUCCESS_RETURN
)
{
return
FAIL_RETURN
;
}
printf
(
"Current Array Value Be Set(Date String), Index: %d, Value: %s
\n
"
,
index
,
*
((
char
**
)(
complex_array
->
value
)
+
index
));
//printf("Current Array Value Be Set(Date String), Index: %d, Value: %s\n", index,
//*((char **)(complex_array->value) + index));
return
SUCCESS_RETURN
;
}
...
...
@@ -588,7 +588,7 @@ static int _kk_tsl_array_bool_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ voi
int
int_set
=
(
value
==
NULL
)
?
(
0
)
:
(
*
(
int
*
)
value
);
*
((
int
*
)(
complex_array
->
value
)
+
index
)
=
int_set
;
printf
(
"Current Array Value Be Set(Bool), Index: %d, Value: %d
\n
"
,
index
,
*
((
int
*
)(
complex_array
->
value
)
+
index
));
// printf("Current Array Value Be Set(Bool), Index: %d, Value: %d\n", index, *((int *)(complex_array->value) + index));
return
SUCCESS_RETURN
;
}
...
...
@@ -600,7 +600,7 @@ static int _kk_tsl_array_int_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ void
int
int_set
=
(
value
==
NULL
)
?
(
0
)
:
(
*
(
int
*
)
value
);
*
((
int
*
)(
complex_array
->
value
)
+
index
)
=
int_set
;
printf
(
"Current Array Value Be Set(Int), Index: %d, Value: %d
\n
"
,
index
,
*
((
int
*
)(
complex_array
->
value
)
+
index
));
//printf("Current Array Value Be Set(Int), Index: %d, Value: %d\n", index, *((int *)(complex_array->value) + index));
return
SUCCESS_RETURN
;
}
...
...
@@ -612,8 +612,8 @@ static int _kk_tsl_array_float_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ vo
float
float_set
=
(
value
==
NULL
)
?
(
0
)
:
(
*
(
float
*
)
value
);
*
((
float
*
)(
complex_array
->
value
)
+
index
)
=
float_set
;
printf
(
"Current Array Value Be Set(Float), Index: %d, Value: %f
\n
"
,
index
,
*
((
float
*
)(
complex_array
->
value
)
+
index
));
//printf("Current Array Value Be Set(Float), Index: %d, Value: %f\n", index,
// *((float *)(complex_array->value) + index));
return
SUCCESS_RETURN
;
}
...
...
@@ -625,8 +625,8 @@ static int _kk_tsl_array_double_set(_IN_ kk_tsl_data_value_t *data_value, _IN_ v
double
double_set
=
(
value
==
NULL
)
?
(
0
)
:
(
*
(
double
*
)
value
);
*
((
double
*
)(
complex_array
->
value
)
+
index
)
=
double_set
;
printf
(
"Current Array Value Be Set(Double), Index: %d, Value: %f
\n
"
,
index
,
*
((
double
*
)(
complex_array
->
value
)
+
index
));
//printf("Current Array Value Be Set(Double), Index: %d, Value: %f\n", index,
// *((double *)(complex_array->value) + index));
return
SUCCESS_RETURN
;
}
...
...
@@ -752,7 +752,7 @@ int dm_tsl_get_event_output_data(_IN_ kk_tsl_t *shadow, _IN_ char *key, _IN_ int
return
FAIL_RETURN
;
}
printf
(
"Key: %.*s
\n
"
,
key_len
,
key
);
//printf("Key: %.*s\n", key_len, key);
res
=
_kk_tsl_event_search
(
shadow
,
key
,
offset
,
&
event
);
if
(
res
!=
SUCCESS_RETURN
)
{
...
...
@@ -893,7 +893,7 @@ int dm_tsl_get_service_input_output_data(_IN_ kk_tsl_data_target_e type, _IN_ kk
return
FAIL_RETURN
;
}
printf
(
"Key: %.*s"
,
key_len
,
key
);
//printf("Key: %.*s", key_len, key);
res
=
_kk_tsl_service_search
(
shadow
,
key
,
offset
,
&
service
);
if
(
res
!=
SUCCESS_RETURN
)
{
...
...
@@ -901,7 +901,7 @@ int dm_tsl_get_service_input_output_data(_IN_ kk_tsl_data_target_e type, _IN_ kk
}
pos
=
key
+
offset
+
1
;
printf
(
"TSL Service input/output Data Search, Event Data ID: %s"
,
pos
);
//printf("TSL Service input/output Data Search, Event Data ID: %s", pos);
res
=
_kk_tsl_service_input_output_search
(
type
,
service
,
pos
,
strlen
(
pos
),
&
service_data
,
&
array_index
);
if
(
res
!=
SUCCESS_RETURN
)
{
...
...
@@ -934,7 +934,7 @@ int dm_tsl_set_service_input_output_value(_IN_ kk_tsl_data_target_e type, _IN_ k
return
FAIL_RETURN
;
}
printf
(
"Key: %.*s"
,
key_len
,
key
);
//printf("Key: %.*s", key_len, key);
res
=
_kk_tsl_service_search
(
shadow
,
key
,
offset
,
&
service
);
if
(
res
!=
SUCCESS_RETURN
)
{
...
...
@@ -942,7 +942,7 @@ int dm_tsl_set_service_input_output_value(_IN_ kk_tsl_data_target_e type, _IN_ k
}
pos
=
key
+
offset
+
1
;
printf
(
"TSL Service Input/Output Data Search, Event Data ID: %s"
,
pos
);
//printf("TSL Service Input/Output Data Search, Event Data ID: %s", pos);
res
=
_kk_tsl_service_input_output_search
(
type
,
service
,
pos
,
strlen
(
pos
),
&
service_data
,
&
array_index
);
if
(
res
!=
SUCCESS_RETURN
)
{
...
...
@@ -1018,9 +1018,7 @@ int kk_tsl_get_property_value_ex(_IN_ kk_tsl_t *shadow, _IN_ char *key, _IN_ int
if
(
res
!=
SUCCESS_RETURN
)
{
return
FAIL_RETURN
;
}
printf
(
"Current Found Data: %s
\n
"
,
data
->
identifier
);
if
(
data
->
data_value
.
type
==
KK_TSL_DATA_TYPE_ARRAY
)
{
printf
(
"Current Found Data Index: %d
\n
"
,
array_index
);
res
=
_kk_tsl_data_array_get
(
&
data
->
data_value
,
value
,
array_index
);
if
(
res
!=
SUCCESS_RETURN
)
{
return
TSL_PROPERTY_GET_FAILED
;
...
...
@@ -1051,15 +1049,12 @@ int kk_tsl_get_event_oput_value(_IN_ kk_tsl_t *shadow, _IN_ char *key, _IN_ int
return
FAIL_RETURN
;
}
printf
(
"Key: %.*s
\n
"
,
key_len
,
key
);
res
=
_kk_tsl_event_search
(
shadow
,
key
,
offset
,
&
event
);
if
(
res
!=
SUCCESS_RETURN
)
{
return
TSL_EVENT_NOT_EXIST
;
}
pos
=
key
+
offset
+
1
;
printf
(
"TSL Event Output Data Search, Event Data ID: %s"
,
pos
);
res
=
_kk_tsl_event_output_search
(
event
->
output_datas
,
event
->
output_data_number
,
pos
,
strlen
(
pos
),
&
event_data
,
&
array_index
);
...
...
@@ -1099,7 +1094,7 @@ int kk_tsl_get_service_input_output_value(_IN_ kk_tsl_data_target_e type, _IN_ k
return
FAIL_RETURN
;
}
printf
(
"key: %.*s
\n
"
,
key_len
,
key
);
//printf("key: %.*s\n", key_len, key);
res
=
_kk_tsl_service_search
(
shadow
,
key
,
offset
,
&
service
);
if
(
res
!=
SUCCESS_RETURN
)
{
...
...
@@ -1107,7 +1102,7 @@ int kk_tsl_get_service_input_output_value(_IN_ kk_tsl_data_target_e type, _IN_ k
}
pos
=
key
+
offset
+
1
;
printf
(
"TSL Service Input/Output Data Search, Event Data ID: %s"
,
pos
);
//printf("TSL Service Input/Output Data Search, Event Data ID: %s", pos);
res
=
_kk_tsl_service_input_output_search
(
type
,
service
,
pos
,
strlen
(
pos
),
&
service_data
,
&
array_index
);
if
(
res
!=
SUCCESS_RETURN
)
{
...
...
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