aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
m---------afb-utilities0
-rw-r--r--high-viwi-binding/ctl-lua.c5
-rw-r--r--high-viwi-binding/high.cpp5
3 files changed, 4 insertions, 6 deletions
diff --git a/afb-utilities b/afb-utilities
-Subproject be1205fd4ab6bd20dd9bc44ed63c35d999ece76
+Subproject 691f6397954929689a1e9434e31940192c2358b
diff --git a/high-viwi-binding/ctl-lua.c b/high-viwi-binding/ctl-lua.c
index ee71bbd..c43b61c 100644
--- a/high-viwi-binding/ctl-lua.c
+++ b/high-viwi-binding/ctl-lua.c
@@ -727,7 +727,6 @@ static void LuaDoAction (LuaDoActionT action, afb_req request) {
char *filename; char*fullpath;
char luaScriptPath[CONTROL_MAXPATH_LEN];
int index;
- BPaths BindingPaths = GetBindingDirsPath();
// scan luascript search path once
static json_object *luaScriptPathJ =NULL;
@@ -746,7 +745,7 @@ static void LuaDoAction (LuaDoActionT action, afb_req request) {
strncpy(luaScriptPath,CONTROL_DOSCRIPT_PRE, sizeof(luaScriptPath));
strncat(luaScriptPath,"-", sizeof(luaScriptPath)-strlen(luaScriptPath)-1);
strncat(luaScriptPath,target, sizeof(luaScriptPath)-strlen(luaScriptPath)-1);
- luaScriptPathJ= ScanForConfig(BindingPaths.etcdir, CTL_SCAN_RECURSIVE,luaScriptPath,".lua");
+ luaScriptPathJ= ScanForConfig(GetBindingDirPath(ETC_DIR), CTL_SCAN_RECURSIVE,luaScriptPath,".lua");
}
for (index=0; index < json_object_array_length(luaScriptPathJ); index++) {
json_object *entryJ=json_object_array_get_idx(luaScriptPathJ, index);
@@ -1002,7 +1001,7 @@ int LuaLibInit () {
strncat (fullprefix, "-", sizeof(fullprefix)-strlen(fullprefix)-1);
const char *dirList= getenv("CONTROL_LUA_PATH");
- if (!dirList) dirList=BindingPaths.etcdir;
+ if (!dirList) dirList= GetBindingDirPath(ETC_DIR);
json_object *luaScriptPathJ = ScanForConfig(dirList , CTL_SCAN_RECURSIVE, fullprefix, "lua");
diff --git a/high-viwi-binding/high.cpp b/high-viwi-binding/high.cpp
index 6803bfa..325d3d4 100644
--- a/high-viwi-binding/high.cpp
+++ b/high-viwi-binding/high.cpp
@@ -234,7 +234,7 @@ int High::parseConfigAndSubscribe(const std::string& confd)
while(properties.empty() || i < conf_files_path.size())
{
json_object *config = json_object_from_file(conf_files_path[i].c_str());
- if(! wrap_json_unpack(config, "{s?o}", "definitions", &jarray1))
+ if(! wrap_json_unpack(config, "{s:o}", "definitions", &jarray1))
{
properties = loadDefinitions(jarray1);
conf_files_path.erase(conf_files_path.begin() + i);
@@ -264,7 +264,6 @@ int High::parseConfigAndSubscribe(const std::string& confd)
int High::subscribeRegisteredObjects() const
{
- BPaths BindingPaths = GetBindingDirsPath();
int ok = 0;
int i = 0;
for(const auto &xObject : registeredObjects)
@@ -273,7 +272,7 @@ int High::subscribeRegisteredObjects() const
{
if(! obj_prop.second.lowMessageName.empty())
{
- //ScanForConfig(BindingPaths.datadir, "low-can", "lua");
+ ScanForConfig(GetBindingDirPath(DATA_DIR), CTL_SCAN_RECURSIVE, "low-can", "lua");
i++;
json_object *jobj = json_object_new_object();
json_object_object_add(jobj,"event", json_object_new_string(obj_prop.second.lowMessageName.c_str()));