Mod aaa-12 更新对象管理接口

RCA:
SOL:
修改人:huangxin
检视人:huangxin
This commit is contained in:
huangxin 2019-10-12 09:28:09 +08:00
parent 817bb900aa
commit 392a974d43
3 changed files with 37 additions and 6 deletions

View File

@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10)
project(drivers) #
project(secgateway) #
set(PLAT_CFG_DIR "./Platform/user/configm/config-server")
#include(kernel_config.cmake) # add_definitions(xxx)
@ -17,11 +17,10 @@ aux_source_directory(${PLAT_CFG_DIR}/object_manager DIR_SRCS)
aux_source_directory(${PLAT_CFG_DIR}/web_config DIR_SRCS)
set(MY_ANDROID_ROOT_DIR "./kernel/linux-4.14.83") # 便使
#set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -nostdinc") # C
add_executable(drivers ${DIR_SRCS} Platform/user/configm/config-server/object_manager/object_manager.h Platform/user/configm/config-server/object_manager/object_manager.c) # dummy targetexternal libraries
add_executable(object ${DIR_SRCS}) # dummy targetexternal libraries
# main.cClion
include_directories(

View File

@ -1,14 +1,40 @@
//
// Created by xajhu on 2019/10/10 0010.
//
#include "object_manager.h"
#include "configm.h"
//#include <sqlite3.h>
#include "object_manager.h"
#include "log.h"
#include "ret_errno.h"
//#define OBJECT_DB ("~/database/object.db")
//#define FIRMWARE_TBL_SQL_CMD ("CREATE TABLE IF NOT EXISTS %s (" \
"ID INTEGER PRIMARY KEY AUTOINCREMENT," \
"name TEXT UNIQUE NOT NULL," \
"desc TEXT NOT NULL DEFAULT (\'\')," \
"prio INTEGER NOT NULL DEFAULT (0)," \
"type INTEGER NOT NULL," \
"prio INTEGER NOT NULL);")
//static sqlite3 *g_obj_db = NULL;
ret_code object_config_init()
{
#if 0
int rc = 0;
char* err_msg = NULL;
IHW_InitLOG("obj", NULL, TRUE);
rc = sqlite3_open_v2(OBJECT_DB, &g_obj_db, SQLITE_OPEN_READWRITE | SQLITE_OPEN_CREATE, NULL);
if(rc != SQLITE_OK) {
LOG_EX(LOG_Error, "Init database %s error: %d\n", OBJECT_DB, rc);
return -RET_NOTFOUND;
}
#endif
return RET_OK;
}
@ -16,6 +42,7 @@ ret_code object_config_chk(uint source, uint *config_type,
pointer input, int *input_len,
pointer output, int *output_len)
{
return RET_OK;
}

View File

@ -967,6 +967,7 @@ static void test_add_object(void)
pObjKItem->objs.svr_obj[0].pro_type = 1;
pObjKItem->objs.svr_obj[0].str_val = strdup("10010-10011");
object_add(pObjItem, pObjKItem);
free(pObjKItem);
}
}
@ -1063,6 +1064,9 @@ static void test_mod_object(void)
if (pAdd) {
if (pAdd->pCtx) {
for (i = 0; i < pAdd->n_obj; i++) {
free(pAdd->pCtx[i].pObj);
}
free(pAdd->pCtx);
}
@ -1103,6 +1107,8 @@ static void test_mod_object(void)
retCtx.data[i].name = pAdd->pCtx[i].pObj->name;
retCtx.data[i].ret_code = ret;
retCtx.data[i].mesg = get_err_message(ret);
free(pAdd->pCtx[i].pObj);
}
dump_object();
@ -1873,7 +1879,6 @@ int main(int argc, char **argv)
test_search_object(optarg);
break;
case 'j':
test_configm_object(optarg);
break;