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
2a352fcf
Commit
2a352fcf
authored
Sep 18, 2020
by
尹佳钦
Browse files
Options
Browse Files
Download
Plain Diff
新增ISA接口
parents
1003bad8
a743a1d1
Changes
10
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
1244 additions
and
1249 deletions
+1244
-1249
common/curl/README.txt
common/curl/README.txt
+8
-8
common/curl/example_curl.c
common/curl/example_curl.c
+51
-51
common/curl/include/libcurl_ubuntu.so
common/curl/include/libcurl_ubuntu.so
+0
-0
midware/midware/dm/kk_property_db.c
midware/midware/dm/kk_property_db.c
+0
-1
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_3001.json
...uilder/Z3GatewayHost/ZB/dev_config_table/device_3001.json
+0
-4
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.c
...bee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.c
+473
-473
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.h
...bee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.h
+52
-52
platform/zigbee/protocol/zigbee/app/framework/plugin/device-table/device-table.c
...l/zigbee/app/framework/plugin/device-table/device-table.c
+606
-606
process_check.sh
process_check.sh
+21
-21
rc.local
rc.local
+33
-33
No files found.
common/curl/README.txt
View file @
2a352fcf
1. 版本:tiny-curl-7.72.0
download:https://curl.haxx.se/tiny/
2. 编译so选项:./configure --disable-dict --disable-ftp --disable-imap --disable-ldap --disable-file --disable-gopher --disable-imap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --disable-zlib --without-ca-bundle --without-gnutls --without-libidn --without-librtmp --without-libssh2 --without-nss --without-zlib
3. 交叉编译选项 9531: ./configure --disable-dict --disable-ftp --disable-imap --disable-ldap --disable-file --disable-gopher --disable-imap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --disable-zlib --without-ca-bundle --without-gnutls --without-libidn --without-librtmp --without-libssh2 --without-nss --without-zlib --host=mips-openwrt-linux CC=mips-openwrt-linux-gcc --prefix=$PWD/__install
4. 编译example:gcc -o example_curl example_curl.c -L. -lcurl_ubuntu
1. 版本:tiny-curl-7.72.0
download:https://curl.haxx.se/tiny/
2. 编译so选项:./configure --disable-dict --disable-ftp --disable-imap --disable-ldap --disable-file --disable-gopher --disable-imap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --disable-zlib --without-ca-bundle --without-gnutls --without-libidn --without-librtmp --without-libssh2 --without-nss --without-zlib
3. 交叉编译选项 9531: ./configure --disable-dict --disable-ftp --disable-imap --disable-ldap --disable-file --disable-gopher --disable-imap --disable-ldaps --disable-pop3 --disable-proxy --disable-rtsp --disable-smtp --disable-telnet --disable-tftp --disable-zlib --without-ca-bundle --without-gnutls --without-libidn --without-librtmp --without-libssh2 --without-nss --without-zlib --host=mips-openwrt-linux CC=mips-openwrt-linux-gcc --prefix=$PWD/__install
4. 编译example:gcc -o example_curl example_curl.c -L. -lcurl_ubuntu
common/curl/example_curl.c
View file @
2a352fcf
#include "include/curl.h"
size_t
kk_write_func
(
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
FILE
*
stream
)
{
return
fwrite
(
ptr
,
size
,
nmemb
,
stream
);
}
int
kk_progress_func
(
char
*
progress_data
,
double
t
,
/* dltotal */
double
d
,
/* dlnow */
double
ultotal
,
double
ulnow
)
{
printf
(
"%s %g / %g (%g %%)
\n
"
,
progress_data
,
d
,
t
,
d
*
100
.
0
/
t
);
return
0
;
}
int
main
(
int
argc
,
char
**
argv
)
{
CURL
*
curl
;
CURLcode
res
;
FILE
*
outfile
;
char
*
url
=
argv
[
1
];
//"https://pics0.baidu.com/feed/6609c93d70cf3bc7fecc2bfb9d12faa6cc112af6.jpeg?token=517920fbf7c2fef6ff3ab5ff55bbd8d7";
char
*
progress_data
=
"* "
;
if
(
argc
<
3
){
printf
(
"==inpunt params error, Usage:example_curl <url> <fileName>
\n
"
);
return
0
;
}
curl
=
curl_easy_init
();
if
(
curl
)
{
outfile
=
fopen
(
argv
[
2
],
"wb"
);
//fopen("test.jpg", "wb");
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
url
);
curl_easy_setopt
(
curl
,
CURLOPT_WRITEDATA
,
outfile
);
curl_easy_setopt
(
curl
,
CURLOPT_WRITEFUNCTION
,
kk_write_func
);
curl_easy_setopt
(
curl
,
CURLOPT_NOPROGRESS
,
0
);
curl_easy_setopt
(
curl
,
CURLOPT_PROGRESSFUNCTION
,
kk_progress_func
);
curl_easy_setopt
(
curl
,
CURLOPT_PROGRESSDATA
,
progress_data
);
res
=
curl_easy_perform
(
curl
);
fclose
(
outfile
);
/* always cleanup */
curl_easy_cleanup
(
curl
);
}
return
0
;
}
#include "include/curl.h"
size_t
kk_write_func
(
void
*
ptr
,
size_t
size
,
size_t
nmemb
,
FILE
*
stream
)
{
return
fwrite
(
ptr
,
size
,
nmemb
,
stream
);
}
int
kk_progress_func
(
char
*
progress_data
,
double
t
,
/* dltotal */
double
d
,
/* dlnow */
double
ultotal
,
double
ulnow
)
{
printf
(
"%s %g / %g (%g %%)
\n
"
,
progress_data
,
d
,
t
,
d
*
100
.
0
/
t
);
return
0
;
}
int
main
(
int
argc
,
char
**
argv
)
{
CURL
*
curl
;
CURLcode
res
;
FILE
*
outfile
;
char
*
url
=
argv
[
1
];
//"https://pics0.baidu.com/feed/6609c93d70cf3bc7fecc2bfb9d12faa6cc112af6.jpeg?token=517920fbf7c2fef6ff3ab5ff55bbd8d7";
char
*
progress_data
=
"* "
;
if
(
argc
<
3
){
printf
(
"==inpunt params error, Usage:example_curl <url> <fileName>
\n
"
);
return
0
;
}
curl
=
curl_easy_init
();
if
(
curl
)
{
outfile
=
fopen
(
argv
[
2
],
"wb"
);
//fopen("test.jpg", "wb");
curl_easy_setopt
(
curl
,
CURLOPT_URL
,
url
);
curl_easy_setopt
(
curl
,
CURLOPT_WRITEDATA
,
outfile
);
curl_easy_setopt
(
curl
,
CURLOPT_WRITEFUNCTION
,
kk_write_func
);
curl_easy_setopt
(
curl
,
CURLOPT_NOPROGRESS
,
0
);
curl_easy_setopt
(
curl
,
CURLOPT_PROGRESSFUNCTION
,
kk_progress_func
);
curl_easy_setopt
(
curl
,
CURLOPT_PROGRESSDATA
,
progress_data
);
res
=
curl_easy_perform
(
curl
);
fclose
(
outfile
);
/* always cleanup */
curl_easy_cleanup
(
curl
);
}
return
0
;
}
common/curl/include/libcurl_ubuntu.so
0 → 100644
View file @
2a352fcf
File added
midware/midware/dm/kk_property_db.c
View file @
2a352fcf
...
...
@@ -141,7 +141,6 @@ int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_d
char
*
zErrMsg
=
0
;
kk_property_db_ctx_t
*
ctx
=
_kk_property_db_get_ctx
();
if
(
_kk_check_property_exist
(
deviceCode
,
identifier
)
==
1
)
{
WARNING_PRINT
(
"[%s][%d] DATA ALREADY EXIST!!!
\n
"
,
__FUNCTION__
,
__LINE__
);
...
...
platform/zigbee/app/builder/Z3GatewayHost/ZB/dev_config_table/device_3001.json
View file @
2a352fcf
...
...
@@ -8,7 +8,3 @@
"attribute"
:
"0x0000"
,
"reportFunc"
:
"kk_tsl_report_global_onoff"
,
"controlFunc"
:
"zclOnOff"
}
]
}
\ No newline at end of file
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.c
View file @
2a352fcf
This diff is collapsed.
Click to expand it.
platform/zigbee/app/builder/Z3GatewayHost/ZB/kk_tsl_property_report.h
View file @
2a352fcf
#ifndef __KK_TSL_PROPERTY_REPORT_H
#define __KK_TSL_PROPERTY_REPORT_H
#include "kk_zb_com.h"
#include "kk_msg_report.h"
typedef
enum
{
tsl_rpt_success
=
0
,
tsl_rpt_err
=
-
1
,
tsl_rpt_invaild_val
=
-
2
,
tsl_rpt_invaild_len
=
-
3
,
tsl_rpt_invaild_type
=
-
4
,
}
kk_tsl_rpt_status
;
void
kk_tsl_report_attribute
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_global_onoff
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_windowCovering_mode
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_windowCovering_position
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_ias_zoneStatus
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_metering_summationDelivered
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_global_Level
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_temperature_measure
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_illuminance_measure
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_local_temperature
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_OccupiedHeatingSetpoint
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_Formaldehyde
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_PM2_5
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_CO2
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_colorControl_Brightness
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_colorControl_RGB
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
#endif
#ifndef __KK_TSL_PROPERTY_REPORT_H
#define __KK_TSL_PROPERTY_REPORT_H
#include "kk_zb_com.h"
#include "kk_msg_report.h"
typedef
enum
{
tsl_rpt_success
=
0
,
tsl_rpt_err
=
-
1
,
tsl_rpt_invaild_val
=
-
2
,
tsl_rpt_invaild_len
=
-
3
,
tsl_rpt_invaild_type
=
-
4
,
}
kk_tsl_rpt_status
;
void
kk_tsl_report_attribute
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_global_onoff
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_windowCovering_mode
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_windowCovering_position
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_ias_zoneStatus
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_metering_summationDelivered
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_global_Level
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_temperature_measure
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_illuminance_measure
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_local_temperature
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_OccupiedHeatingSetpoint
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_Formaldehyde
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_PM2_5
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_CO2
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_colorControl_Brightness
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
int
kk_tsl_report_colorControl_RGB
(
EmberEUI64
eui64
,
uint8_t
EP
,
EmberAfClusterId
clusterId
,
EmberAfAttributeId
attributeId
,
uint8_t
dataType
,
uint8_t
len
,
uint8_t
*
data
);
#endif
platform/zigbee/protocol/zigbee/app/framework/plugin/device-table/device-table.c
View file @
2a352fcf
This diff is collapsed.
Click to expand it.
process_check.sh
View file @
2a352fcf
#!/bin/sh
#判断进程是否存在,如果不存在就启动它
while
true
do
sleep
30
PIDS
=
`
ps|grep kk_midware |grep
-v
grep
|
awk
'{print $1}'
`
if
[
"
$PIDS
"
!=
""
]
;
then
echo
"kk_midware is runing!"
else
/home/kk/kk_midware
>
/dev/null 2>&1 &
#运行进程
fi
sleep
30
PIDS
=
`
ps|grep kcloud |grep
-v
grep
|
awk
'{print $1}'
`
if
[
"
$PIDS
"
!=
""
]
;
then
echo
"kcloud is runing!"
else
/home/kk/kcloud
>
/dev/null 2>&1 &
#运行进程
fi
done
#!/bin/sh
#判断进程是否存在,如果不存在就启动它
while
true
do
sleep
30
PIDS
=
`
ps|grep kk_midware |grep
-v
grep
|
awk
'{print $1}'
`
if
[
"
$PIDS
"
!=
""
]
;
then
echo
"kk_midware is runing!"
else
/home/kk/kk_midware
>
/dev/null 2>&1 &
#运行进程
fi
sleep
30
PIDS
=
`
ps|grep kcloud |grep
-v
grep
|
awk
'{print $1}'
`
if
[
"
$PIDS
"
!=
""
]
;
then
echo
"kcloud is runing!"
else
/home/kk/kcloud
>
/dev/null 2>&1 &
#运行进程
fi
done
rc.local
View file @
2a352fcf
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
nanomsg_File="/home/kk/lib/libnanomsg.so.5"
ev_File="/home/kk/lib/libev.so.4"
cd /sbin/
insmod /sbin/ssd1306-revision.ko
/sbin/oled >/dev/null 2>&1 &
sleep 1
export LD_LIBRARY_PATH=/home/kk/lib
cd /home/kk/lib
if [ ! -f "$nanomsg_File" ]; then
ln libnanomsg.so libnanomsg.so.5
fi
if [ ! -f "$ev_File" ]; then
ln libev.so libev.so.4
fi
CCU_ID=`cat /etc/dropbear/accessory/hj/hj_ccuid`
/sbin/logread -f -r 120.55.149.201 514 -p /var/run/logread.cloud_log.pid -u -h $CCU_ID >/dev/null 2>&1 &
/sbin/logread -f -e "ccu_err_info" -F /etc/dropbear/accessory/hj/err.log -p /var/run/logread.err_log.pid -S 512 >/dev/null 2>&1 &
sleep 1
/home/kk/run.sh >/dev/null 2>&1 &
sleep 10
/home/kk/process_check.sh >/dev/null 2>&1 &
cd /sbin
/sbin/logd-check.sh >/dev/null 2>&1 &
sleep 1
ntpd -n -q -d -p stdtime.gov.hk &
exit 0
# Put your custom commands here that should be executed once
# the system init finished. By default this file does nothing.
nanomsg_File="/home/kk/lib/libnanomsg.so.5"
ev_File="/home/kk/lib/libev.so.4"
cd /sbin/
insmod /sbin/ssd1306-revision.ko
/sbin/oled >/dev/null 2>&1 &
sleep 1
export LD_LIBRARY_PATH=/home/kk/lib
cd /home/kk/lib
if [ ! -f "$nanomsg_File" ]; then
ln libnanomsg.so libnanomsg.so.5
fi
if [ ! -f "$ev_File" ]; then
ln libev.so libev.so.4
fi
CCU_ID=`cat /etc/dropbear/accessory/hj/hj_ccuid`
/sbin/logread -f -r 120.55.149.201 514 -p /var/run/logread.cloud_log.pid -u -h $CCU_ID >/dev/null 2>&1 &
/sbin/logread -f -e "ccu_err_info" -F /etc/dropbear/accessory/hj/err.log -p /var/run/logread.err_log.pid -S 512 >/dev/null 2>&1 &
sleep 1
/home/kk/run.sh >/dev/null 2>&1 &
sleep 10
/home/kk/process_check.sh >/dev/null 2>&1 &
cd /sbin
/sbin/logd-check.sh >/dev/null 2>&1 &
sleep 1
ntpd -n -q -d -p stdtime.gov.hk &
exit 0
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