71 lines
2.1 KiB
C
71 lines
2.1 KiB
C
//
|
|
// Created by xajhu on 2019/10/10 0010.
|
|
//
|
|
//#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;
|
|
}
|
|
|
|
ret_code object_config_chk(uint source, uint *config_type,
|
|
pointer input, int *input_len,
|
|
pointer output, int *output_len)
|
|
{
|
|
|
|
return RET_OK;
|
|
}
|
|
|
|
ret_code object_config_proc(uint source, uint config_type,
|
|
pointer input, int input_len,
|
|
pointer output, int *output_len)
|
|
{
|
|
LOG_EX(LOG_Debug, "[%016X]:type = %u, %s\n", source, config_type, (const char*)input);
|
|
return RET_OK;
|
|
}
|
|
|
|
ret_code object_config_get(uint source,
|
|
pointer input, int input_len,
|
|
pointer output, int *output_len)
|
|
{
|
|
LOG_EX(LOG_Debug, "[%016X]: %s\n", source, (const char*)input);
|
|
return RET_OK;
|
|
}
|
|
|
|
ret_code object_config_get_all(uint source,
|
|
pointer output, int *output_len)
|
|
{
|
|
LOG_EX(LOG_Debug, "[%016X]: \n", source);
|
|
return RET_OK;
|
|
}
|