From df5b57174a933fde338a409f4ea58e3ed7dc802c Mon Sep 17 00:00:00 2001 From: Bryan Roe Date: Mon, 21 Oct 2019 12:44:59 -0700 Subject: [PATCH] 1. Added additional connection logging 2. Updated Service Detection logic for auto-update --- meshcore/agentcore.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/meshcore/agentcore.c b/meshcore/agentcore.c index 830132b..3d9ee2a 100644 --- a/meshcore/agentcore.c +++ b/meshcore/agentcore.c @@ -2894,14 +2894,14 @@ void MeshServer_ProcessCommand(ILibWebClient_StateObject WebStateObject, MeshAge { if (agent->logUpdate != 0) { - ILIBLOGMESSSAGE("SelfUpdate -> Starting Diagnostic Agent, to assist with self update"); + ILIBLOGMESSSAGE("SelfUpdate -> Starting Secondary Agent, to assist with self update"); } } else { if (agent->logUpdate != 0) { - ILIBLOGMESSSAGE("SelfUpdate -> Diagnostic Agent unavailable to assist with self update"); + ILIBLOGMESSSAGE("SelfUpdate -> Secondary Agent unavailable to assist with self update"); } } @@ -3390,6 +3390,9 @@ void MeshServer_Connect(MeshAgentHostContainer *agent) agent->fakeUpdate = ILibSimpleDataStore_Get(agent->masterDb, "fakeUpdate", NULL, 0); agent->controlChannelDebug = ILibSimpleDataStore_Get(agent->masterDb, "controlChannelDebug", NULL, 0); + if (agent->logUpdate != 0) { ILIBLOGMESSAGEX("PLATFORM_TYPE: %d\n", agent->platformType); } + if (agent->logUpdate != 0) { ILIBLOGMESSAGEX("Running as Service: %d\n", agent->JSRunningAsService); } + if (agent->logUpdate != 0) { ILIBLOGMESSSAGE("Attempting to connect to Server..."); } if (agent->controlChannelDebug != 0) { @@ -3849,10 +3852,9 @@ int MeshAgent_AgentMode(MeshAgentHostContainer *agentHost, int paramLen, char ** } if (duk_peval_string(tmpCtx, "require('service-manager').manager.getService(process.platform=='win32'?'Mesh Agent':'meshagent').isMe();") == 0) { - agentHost->JSRunningAsService = duk_get_int(tmpCtx, -1); + agentHost->JSRunningAsService = duk_get_boolean(tmpCtx, -1); } #endif - #if !defined(MICROSTACK_NOTLS) // Check the local MacAddresses, to see if we need to reset our NodeId if (duk_peval_string(tmpCtx, "(function _getMac() { var ret = ''; var ni = require('os').networkInterfaces(); for (var f in ni) { for (var i in ni[f]) { if(ni[f][i].type == 'ethernet' || ni[f][i].type == 'wireless') {ret += ('[' + ni[f][i].mac + ']');} } } return(ret); })();") == 0)