mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-12 23:16:51 +01:00
@@ -423,37 +423,10 @@ Client* ClientList::createPredefinedTopic(MQTTSNString* clientId, string topicNa
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
/* anonimous clients */
|
||||
if (_clientCnt > MAX_CLIENTS)
|
||||
{
|
||||
return nullptr; // full of clients
|
||||
}
|
||||
|
||||
client = createClient(NULL, clientId, aggregate);
|
||||
if (client == nullptr)
|
||||
{
|
||||
/* creat a new client */
|
||||
client = new Client();
|
||||
client->setClientId(*clientId);
|
||||
if (aggregate)
|
||||
{
|
||||
client->setAggregated();
|
||||
}
|
||||
_mutex.lock();
|
||||
|
||||
/* add the list */
|
||||
if (_firstClient == nullptr)
|
||||
{
|
||||
_firstClient = client;
|
||||
_endClient = client;
|
||||
}
|
||||
else
|
||||
{
|
||||
_endClient->_nextClient = client;
|
||||
client->_prevClient = _endClient;
|
||||
_endClient = client;
|
||||
}
|
||||
_clientCnt++;
|
||||
_mutex.unlock();
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
// create Topic & Add it
|
||||
|
||||
@@ -34,7 +34,6 @@ Gateway::Gateway(void)
|
||||
{
|
||||
theMultiTaskProcess = this;
|
||||
theProcess = this;
|
||||
_packetEventQue.setMaxSize(MAX_INFLIGHTMESSAGES * MAX_CLIENTS);
|
||||
_clientList = new ClientList(this);
|
||||
_adapterManager = new AdapterManager(this);
|
||||
_topics = new Topics();
|
||||
@@ -282,11 +281,14 @@ void Gateway::initialize(int argc, char** argv)
|
||||
_params.maxClients = atoi(param);
|
||||
}
|
||||
|
||||
if (getParam("BleAddress", param) == 0)
|
||||
if (getParam("RFCOMMAddress", param) == 0)
|
||||
{
|
||||
_params.bleAddress = strdup(param);
|
||||
}
|
||||
|
||||
/* Setup max PacketEventQue size */
|
||||
_packetEventQue.setMaxSize(_params.maxInflightMsgs * _params.maxClients);
|
||||
|
||||
/* Initialize adapters */
|
||||
_adapterManager->initialize(_params.gatewayName, _params.aggregatingGw, _params.forwarder, _params.qosMinus1);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user