mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-16 08:56:51 +01:00
Update Aggregatting gateway can now receive PUBLISH from a broker
Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -234,29 +234,48 @@ void Gateway::initialize(int argc, char** argv)
|
||||
_params.clientListName = strdup(param);
|
||||
}
|
||||
|
||||
if (getParam("PredefinedTopicList", param) == 0)
|
||||
if (getParam("PredefinedTopic", param) == 0)
|
||||
{
|
||||
_params.predefinedTopicFileName = strdup(param);
|
||||
if ( !strcasecmp(param, "YES") )
|
||||
{
|
||||
_params.predefinedTopic = true;
|
||||
if (getParam("PredefinedTopicList", param) == 0)
|
||||
{
|
||||
_params.predefinedTopicFileName = strdup(param);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( _params.clientListName == nullptr )
|
||||
if (getParam("AggregatingGateway", param) == 0)
|
||||
{
|
||||
_params.clientListName = strdup(( _params.configDir + string(CLIENT_LIST) ).c_str());
|
||||
if ( !strcasecmp(param, "YES") )
|
||||
{
|
||||
_params.aggregatingGw = true;
|
||||
}
|
||||
}
|
||||
|
||||
if ( _params.predefinedTopicFileName == nullptr )
|
||||
if (getParam("Forwarder", param) == 0)
|
||||
{
|
||||
_params.predefinedTopicFileName = strdup(( _params.configDir + string(PREDEFINEDTOPIC_FILE) ).c_str());
|
||||
if ( !strcasecmp(param, "YES") )
|
||||
{
|
||||
_params.forwarder = true;
|
||||
}
|
||||
}
|
||||
|
||||
/* ClientList and Adapters Initialize */
|
||||
_adapterManager->initialize();
|
||||
if (getParam("QoS-1", param) == 0)
|
||||
{
|
||||
if ( !strcasecmp(param, "YES") )
|
||||
{
|
||||
_params.qosMinus1 = true;
|
||||
}
|
||||
}
|
||||
|
||||
bool aggregate = _adapterManager->isAggregaterActive();
|
||||
_clientList->initialize(aggregate);
|
||||
|
||||
/* Setup predefined topics */
|
||||
_clientList->setPredefinedTopics(aggregate);
|
||||
/* Initialize adapters */
|
||||
_adapterManager->initialize( _params.gatewayName, _params.aggregatingGw, _params.forwarder, _params.qosMinus1);
|
||||
|
||||
/* Setup ClientList and Predefined topics */
|
||||
_clientList->initialize(_params.aggregatingGw);
|
||||
}
|
||||
|
||||
void Gateway::run(void)
|
||||
|
||||
Reference in New Issue
Block a user