Important Update:
- Save reference to process config in Function Core
- Moved from DeviceCore to here as common feature
- "Config" : object
Allow additional config to be stored in application definition
- "Config" : string
Name reference to config object in main JSON file
- Remove from Device Core
This commit is contained in:
@@ -95,6 +95,7 @@ bool CFunctionCore::Init( CDataMember * FunctionConfig )
|
||||
CDataMember * ChannelConfig;
|
||||
EDebugLevel pLogLevel;
|
||||
int pLogOutput;
|
||||
char * ConfigName = NULL;
|
||||
|
||||
// Validate
|
||||
if (!FunctionConfig )
|
||||
@@ -118,6 +119,13 @@ bool CFunctionCore::Init( CDataMember * FunctionConfig )
|
||||
ChannelConfig = ChannelConfig->GetNextPeer();
|
||||
}
|
||||
|
||||
// Get main configuration
|
||||
if ((Config = FunctionConfig->GetChild( "Config", true )) && Config->isString()) {
|
||||
ConfigName = (char*)FunctionConfig->GetChStr( "Config" );
|
||||
Config = Application->Config->GetChild( ConfigName, true );
|
||||
}
|
||||
if (Config->isNull()) Config->SetObject();
|
||||
|
||||
return true;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user