Commit 326a6eec authored by 尹佳钦's avatar 尹佳钦

20200907

parent 65243975
...@@ -141,7 +141,6 @@ int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_d ...@@ -141,7 +141,6 @@ int kk_property_db_insert(const char *deviceCode,const char *identifier,kk_tsl_d
char *zErrMsg = 0; char *zErrMsg = 0;
kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx(); kk_property_db_ctx_t *ctx = _kk_property_db_get_ctx();
if(_kk_check_property_exist(deviceCode,identifier) == 1) if(_kk_check_property_exist(deviceCode,identifier) == 1)
{ {
WARNING_PRINT("[%s][%d] DATA ALREADY EXIST!!!\n",__FUNCTION__,__LINE__); WARNING_PRINT("[%s][%d] DATA ALREADY EXIST!!!\n",__FUNCTION__,__LINE__);
......
...@@ -373,10 +373,10 @@ $(TARGET_FILE): $(APPLICATION_OBJECTS) $(LIBRARIES) ...@@ -373,10 +373,10 @@ $(TARGET_FILE): $(APPLICATION_OBJECTS) $(LIBRARIES)
else else
$(TARGET_FILE): $(APPLICATION_OBJECTS) $(LIBRARIES) $(TARGET_FILE): $(APPLICATION_OBJECTS) $(LIBRARIES)
ifeq ($(CONFIG_VENDOR),ubuntu) ifeq ($(CONFIG_VENDOR),ubuntu)
$(LD) $^ $(LINKER_FLAGS) -lm -L. -lapi_com_ubuntu -lnanomsg_ubuntu -lanl -pthread -lev_ubuntu -lkk_hal_ubuntu -o $(TARGET_FILE) $(LD) $^ $(LINKER_FLAGS) -lm -L. -lapi_com_ubuntu -lnanomsg_ubuntu -lanl -pthread -lev_ubuntu -lsqlite3 -lkk_hal_ubuntu -o $(TARGET_FILE)
@echo -e '\n$@ build success' @echo -e '\n$@ build success'
else else
$(LD) $^ $(LINKER_FLAGS) -lm -L. -lapi_com -lnanomsg -lanl -pthread -lev -lkk_hal -o $(TARGET_FILE) $(LD) $^ $(LINKER_FLAGS) -lm -L. -lapi_com -lnanomsg -lanl -pthread -lev -lkk_hal -lsqlite3 -o $(TARGET_FILE)
@echo -e '\n$@ build success' @echo -e '\n$@ build success'
endif endif
endif endif
......
#include "kk_device_manager.h" #include "kk_device_manager.h"
#include <fcntl.h>
#include "sqlite3.h"
/****************** ****************************************************************** /****************** ******************************************************************
* File Name : kk_device_manager.c * File Name : kk_device_manager.c
* Author : yjq * Author : yjq
...@@ -310,9 +315,25 @@ static const char *kk_match_tsl_productCode(const char* modelId) ...@@ -310,9 +315,25 @@ static const char *kk_match_tsl_productCode(const char* modelId)
//////////////////////////////////////////////////// ////////////////////////////////////////////////////
void kk_db()
{
sqlite3 *db = NULL;
char create[]="create table kk_device(number integer PRIMARY KEY, name text, sex text, age integer);";
int ret = sqlite3_open("kk_device.db", &db);
if(ret)
{
emberAfDebugPrintln("can not open database.\n");
}
else
{
emberAfDebugPrintln("open database succsee.\n");
}
}
void emberAfPluginDeviceTableInitialized(void) void emberAfPluginDeviceTableInitialized(void)
{ {
kk_device_table_load(); kk_device_table_load();
kk_db();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment