diff --git a/meshcore/agentcore.c b/meshcore/agentcore.c index 575ce07..691b878 100644 --- a/meshcore/agentcore.c +++ b/meshcore/agentcore.c @@ -3640,6 +3640,19 @@ void MeshServer_Agent_SelfTest(MeshAgentHostContainer *agent) //int CoreModuleTesterLen = ILibSimpleDataStore_Get(agent->masterDb, "CoreModuleTester", NULL, 0); //char *CoreModule, *CoreModuleTester; + char *argarray; + size_t argarrayLen; + + argarrayLen = (size_t)ILibSimpleDataStore_Cached_GetJSONEx(agent->masterDb, NULL, 0); + ILibMemory_AllocateRaw(argarray, argarrayLen); + ILibSimpleDataStore_Cached_GetJSONEx(agent->masterDb, argarray, (int)argarrayLen); + + duk_push_heapptr(agent->meshCoreCtx, ILibDuktape_GetProcessObject(agent->meshCoreCtx)); // [process] + duk_push_string(agent->meshCoreCtx, argarray); // [process][string] + duk_json_decode(agent->meshCoreCtx, -1); // [process][json] + duk_put_prop_string(agent->meshCoreCtx, -2, "\xFF_argArray"); // [process] + duk_pop(agent->meshCoreCtx); + printf("Agent Self Test...\n"); if (agent->coreTimeout != 0) { diff --git a/modules/agent-selftest.js b/modules/agent-selftest.js index f2aee00..6de2218 100644 --- a/modules/agent-selftest.js +++ b/modules/agent-selftest.js @@ -75,6 +75,11 @@ function coreInfo() console.log(' ' + J.osdesc); console.log(' ' + J.value); console.log(''); + if (process.argv.includes('--showCoreInfo="1"')) + { + console.log('\n' + JSON.stringify(J) + '\n'); + } + handler.promise._res(); } };