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
6d82af87
Commit
6d82af87
authored
Feb 28, 2022
by
chen.weican
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
【修改内容】增加NX5主机的屏幕二维码显示
【提交人】陈伟灿
parent
2360ed07
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
46 additions
and
13 deletions
+46
-13
application/kcloud/kcloud_main.c
application/kcloud/kcloud_main.c
+31
-1
application/kcloud/kk_info_report.c
application/kcloud/kk_info_report.c
+12
-10
application/klansdk/kk_oldccu_msg.c
application/klansdk/kk_oldccu_msg.c
+1
-1
makefile
makefile
+1
-1
nx5_soc_gw/smarthome_z3gw_a133
nx5_soc_gw/smarthome_z3gw_a133
+0
-0
tools/build-rules/_rules-top.mk
tools/build-rules/_rules-top.mk
+1
-0
No files found.
application/kcloud/kcloud_main.c
View file @
6d82af87
...
@@ -27,6 +27,7 @@
...
@@ -27,6 +27,7 @@
#include "com_api.h"
#include "com_api.h"
#include "kk_product.h"
#include "kk_product.h"
#include "kk_hal.h"
#include "kk_hal.h"
#include "ccu_ver.h"
//#include "kcloud_log.h"
//#include "kcloud_log.h"
static
char
s_ccuid
[
DEVICE_CODE_LEN
]
=
{
0
};
static
char
s_ccuid
[
DEVICE_CODE_LEN
]
=
{
0
};
int
KK_Get_ccuid
(
char
*
device_code
)
int
KK_Get_ccuid
(
char
*
device_code
)
...
@@ -266,8 +267,33 @@ static int setStoragePath(char* path){
...
@@ -266,8 +267,33 @@ static int setStoragePath(char* path){
kk_set_storage_dir
(
path
);
kk_set_storage_dir
(
path
);
return
0
;
return
0
;
}
}
#if CONFIG_NX5_PLATFORM
static
char
s_Version
[
VERSION_MAXLEN
]
=
{
0
};
static
void
kk_cloud_ccuid_version
(
void
)
{
FILE
*
fp
;
if
(
!
(
fp
=
fopen
(
KK_VERSION_FILE_PATH
,
"r"
)))
{
ERROR_PRINT
(
"can't open the file tslPath:%s
\n
"
,
KK_VERSION_FILE_PATH
);
strncpy
(
s_Version
,
KK_CCU_VERSION
,
strlen
(
KK_CCU_VERSION
));
return
;
}
fread
(
s_Version
,
1
,
VERSION_MAXLEN
,
fp
);
if
(
strlen
(
s_Version
)
==
0
){
strncpy
(
s_Version
,
KK_CCU_VERSION
,
strlen
(
KK_CCU_VERSION
));
}
INFO_PRINT
(
"HAL_Ccuid_version version:%s!!!
\n
"
,
s_Version
);
fclose
(
fp
);
return
;
}
int
kk_GetVersion
(
_OU_
char
*
version
)
{
strncpy
(
version
,
s_Version
,
strlen
(
s_Version
));
version
[
strlen
(
s_Version
)]
=
'\0'
;
return
strlen
(
s_Version
);
}
#endif
#ifdef CONFIG_NDK
#ifdef CONFIG_NDK
int
app_main
(
char
*
path
)
int
app_main
(
char
*
path
)
#else
#else
...
@@ -287,6 +313,10 @@ int main(int argc, char* argv[])
...
@@ -287,6 +313,10 @@ int main(int argc, char* argv[])
}
}
kk_cloud_pid_init
();
kk_cloud_pid_init
();
kk_cloud_key_init
();
kk_cloud_key_init
();
#if CONFIG_NX5_PLATFORM
kk_cloud_ccuid_version
();
kk_info_report_start
();
#endif
kk_ipc_init
(
IPC_APP2MID
,(
ipc_cb
*
)
KK_Data_FromDev
,
NULL
,
NULL
);
kk_ipc_init
(
IPC_APP2MID
,(
ipc_cb
*
)
KK_Data_FromDev
,
NULL
,
NULL
);
#if 1
#if 1
kk_dl_config
();
kk_dl_config
();
...
...
application/kcloud/kk_info_report.c
View file @
6d82af87
...
@@ -34,7 +34,7 @@ static int kk_info_nanomsg_init(void)
...
@@ -34,7 +34,7 @@ static int kk_info_nanomsg_init(void)
}
}
return
socketfd
;
return
socketfd
;
}
}
int
kk_GetVersion
(
_OU_
char
*
version
);
static
int
kk_info_get
(
char
*
str
)
static
int
kk_info_get
(
char
*
str
)
{
{
int
ret
=
0
;
int
ret
=
0
;
...
@@ -42,6 +42,8 @@ static int kk_info_get(char *str)
...
@@ -42,6 +42,8 @@ static int kk_info_get(char *str)
char
*
str_tmp
=
NULL
;
char
*
str_tmp
=
NULL
;
char
ccuid
[
32
]
=
{
0
};
char
ccuid
[
32
]
=
{
0
};
char
pid
[
32
]
=
{
0
};
char
pid
[
32
]
=
{
0
};
char
key
[
128
]
=
{
0
};
if
(
str
==
NULL
){
if
(
str
==
NULL
){
return
-
1
;
return
-
1
;
}
}
...
@@ -49,6 +51,8 @@ static int kk_info_get(char *str)
...
@@ -49,6 +51,8 @@ static int kk_info_get(char *str)
KK_Get_ccuid
(
ccuid
);
KK_Get_ccuid
(
ccuid
);
kk_cloud_get_pid
(
pid
);
kk_cloud_get_pid
(
pid
);
kk_cloud_get_key
(
key
);
kk_GetVersion
(
version
);
cJSON
*
root
=
cJSON_CreateObject
();
cJSON
*
root
=
cJSON_CreateObject
();
if
(
root
)
if
(
root
)
{
{
...
@@ -64,22 +68,20 @@ static int kk_info_get(char *str)
...
@@ -64,22 +68,20 @@ static int kk_info_get(char *str)
cJSON_AddItemToObject
(
args
,
"ccu"
,
ccu
);
cJSON_AddItemToObject
(
args
,
"ccu"
,
ccu
);
cJSON_AddStringToObject
(
ccu
,
"id"
,
&
ccuid
[
4
]);
cJSON_AddStringToObject
(
ccu
,
"id"
,
&
ccuid
[
4
]);
cJSON_AddStringToObject
(
ccu
,
"version"
,
"1.1.1"
);
cJSON_AddStringToObject
(
ccu
,
"version"
,
version
);
cJSON_AddStringToObject
(
ccu
,
"name"
,
"kk_new_ccu"
);
cJSON_AddStringToObject
(
ccu
,
"name"
,
"kk_new_ccu"
);
//INFO_PRINT("---222kk_get_cloud_status():%d\n",kk_get_cloud_status());
//INFO_PRINT("---222kk_get_cloud_status():%d\n",kk_get_cloud_status());
//if(kk_get_gw_status() == DEVICE_OFFLINE){
if
(
kk_get_cloud_status
()
==
DEVICE_OFFLINE
){
//memcpy(status,"2",strlen("2"));
//}
if
(
kk_get_cloud_status
()
==
DEVICE_OFFLINE
)
{
//cJSON_AddStringToObject(ccu, "status", "1");
//cJSON_AddStringToObject(ccu, "status", "1");
//INFO_PRINT("_-----------------------------------------------------------11\n");
//INFO_PRINT("_-----------------------------------------------------------11\n");
memcpy
(
status
,
"1"
,
strlen
(
"1"
));
memcpy
(
status
,
"1"
,
strlen
(
"1"
));
}
else
if
(
kk_get_gw_status
()
==
DEVICE_OFFLINE
){
memcpy
(
status
,
"2"
,
strlen
(
"2"
));
}
else
{
}
else
{
//INFO_PRINT("_-----------------------------------------------------------22\n");
//INFO_PRINT("_-----------------------------------------------------------22\n");
memcpy
(
status
,
"0"
,
strlen
(
"0"
));
memcpy
(
status
,
"0"
,
strlen
(
"0"
));
}
}
//INFO_PRINT("
------------------------------------->status :%s\n",status);
INFO_PRINT
(
"kk_info_get
------------------------------------->status :%s
\n
"
,
status
);
cJSON_AddStringToObject
(
ccu
,
"status"
,
status
);
cJSON_AddStringToObject
(
ccu
,
"status"
,
status
);
}
}
...
@@ -102,7 +104,7 @@ static int kk_info_get(char *str)
...
@@ -102,7 +104,7 @@ static int kk_info_get(char *str)
if
(
qr_code
)
if
(
qr_code
)
{
{
char
qrcodeStr
[
256
]
=
{
0
};
char
qrcodeStr
[
256
]
=
{
0
};
sprintf
(
qrcodeStr
,
"KONKE-CCU:%s:%s:
BBE3C5A5FC1FDB6CA1A386AB321D02AB"
,
pid
,
&
ccuid
[
4
]
);
sprintf
(
qrcodeStr
,
"KONKE-CCU:%s:%s:
%s"
,
pid
,
&
ccuid
[
4
],
key
);
cJSON_AddItemToObject
(
args
,
"qr_code"
,
qr_code
);
cJSON_AddItemToObject
(
args
,
"qr_code"
,
qr_code
);
cJSON_AddStringToObject
(
qr_code
,
"string"
,
qrcodeStr
);
cJSON_AddStringToObject
(
qr_code
,
"string"
,
qrcodeStr
);
cJSON_AddBoolToObject
(
qr_code
,
"show"
,
1
);
cJSON_AddBoolToObject
(
qr_code
,
"show"
,
1
);
...
...
application/klansdk/kk_oldccu_msg.c
View file @
6d82af87
...
@@ -369,7 +369,7 @@ static int kk_lan_property_convert(const char *deviceCode,kk_map_dev_node_t *dev
...
@@ -369,7 +369,7 @@ static int kk_lan_property_convert(const char *deviceCode,kk_map_dev_node_t *dev
continue
;
continue
;
}
}
kk_lan_replace_val_to_obj
(
n_item
,
valObj
,
"value"
);
kk_lan_replace_val_to_obj
(
n_item
,
valObj
,
"value"
);
//更新value
if
((
args
=
ccu_value_convert
(
n_dataType
,
n_valueRange
,
o_dataType
,
o_valueRange
,
valObj
))
!=
NULL
){
if
((
args
=
ccu_value_convert
(
n_dataType
,
n_valueRange
,
o_dataType
,
o_valueRange
,
valObj
))
!=
NULL
){
//printf("[%s][%d]\n",__FUNCTION__,__LINE__);
//printf("[%s][%d]\n",__FUNCTION__,__LINE__);
...
...
makefile
View file @
6d82af87
...
@@ -13,7 +13,7 @@ COMP_LIB_COMPONENTS := \
...
@@ -13,7 +13,7 @@ COMP_LIB_COMPONENTS := \
#SUBDIRS += application/kcloud
#SUBDIRS += application/kcloud
$(call
Append_Conditional,
SUBDIRS,
application/kcloud,
KCLOUD_PLATFORM_SUPPORT)
$(call
Append_Conditional,
SUBDIRS,
application/kcloud,
KCLOUD_PLATFORM_SUPPORT)
$(call
Append_Conditional,
SUBDIRS,
application/kk_luoma,
LUOMA_PLATFORM_SUPPORT)
$(call
Append_Conditional,
SUBDIRS,
application/kk_luoma,
LUOMA_PLATFORM_SUPPORT)
#
SUBDIRS += application/oled
SUBDIRS
+=
application/oled
SUBDIRS
+=
application/klansdk
SUBDIRS
+=
application/klansdk
SUBDIRS
+=
midware/midware
SUBDIRS
+=
midware/midware
SUBDIRS
+=
common/mqtt
SUBDIRS
+=
common/mqtt
...
...
nx5_soc_gw/smarthome_z3gw_a133
View file @
6d82af87
No preview for this file type
tools/build-rules/_rules-top.mk
View file @
6d82af87
...
@@ -206,6 +206,7 @@ package:
...
@@ -206,6 +206,7 @@ package:
mkdir
$(releaseDir)
/map
mkdir
$(releaseDir)
/map
mkdir
$(releaseDir)
/config
mkdir
$(releaseDir)
/config
mkdir
$(releaseDir)
/script
mkdir
$(releaseDir)
/script
cp
-rf
$(TOP_DIR)
/ssd1306-revision.ko
$(TOP_DIR)
/
$(releaseDir)
cp
-rf
$(TOP_DIR)
/tsl
$(TOP_DIR)
/
$(releaseDir)
cp
-rf
$(TOP_DIR)
/tsl
$(TOP_DIR)
/
$(releaseDir)
cp
-rf
$(TOP_DIR)
/output/release/lib/
*
.so
$(TOP_DIR)
/
$(releaseDir)
/lib
cp
-rf
$(TOP_DIR)
/output/release/lib/
*
.so
$(TOP_DIR)
/
$(releaseDir)
/lib
cp
-rf
$(TOP_DIR)
/output/release/bin/
*
$(TOP_DIR)
/
$(releaseDir)
/bin
cp
-rf
$(TOP_DIR)
/output/release/bin/
*
$(TOP_DIR)
/
$(releaseDir)
/bin
...
...
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