mirror of
https://github.com/eclipse/paho.mqtt-sn.embedded-c.git
synced 2025-12-16 00:46:52 +01:00
Update: Add Aggregate Gateway functions. #127
Signed-off-by: tomoaki <tomoaki@tomy-tech.com>
This commit is contained in:
@@ -38,7 +38,7 @@ void MQTTGWSubscribeHandler::handleSuback(Client* client, MQTTGWPacket* packet)
|
||||
int qos = 0;
|
||||
|
||||
packet->getSUBACK(&msgId, &rc);
|
||||
TopicIdMapelement* topicId = client->getWaitedSubTopicId(msgId);
|
||||
TopicIdMapElement* topicId = client->getWaitedSubTopicId(msgId);
|
||||
|
||||
if (topicId)
|
||||
{
|
||||
@@ -72,3 +72,28 @@ void MQTTGWSubscribeHandler::handleUnsuback(Client* client, MQTTGWPacket* packet
|
||||
_gateway->getClientSendQue()->post(evt);
|
||||
}
|
||||
|
||||
void MQTTGWSubscribeHandler::handleAggregateSuback(Client* client, MQTTGWPacket* packet)
|
||||
{
|
||||
uint16_t msgId = packet->getMsgId();
|
||||
uint16_t clientMsgId = 0;
|
||||
Client* newClient = _gateway->getAdapterManager()->getAggregater()->convertClient(msgId, &clientMsgId);
|
||||
if ( newClient != nullptr )
|
||||
{
|
||||
packet->setMsgId((int)clientMsgId);
|
||||
handleSuback(newClient, packet);
|
||||
}
|
||||
}
|
||||
|
||||
void MQTTGWSubscribeHandler::handleAggregateUnsuback(Client* client, MQTTGWPacket* packet)
|
||||
{
|
||||
uint16_t msgId = packet->getMsgId();
|
||||
uint16_t clientMsgId = 0;
|
||||
Client* newClient = _gateway->getAdapterManager()->getAggregater()->convertClient(msgId, &clientMsgId);
|
||||
if ( newClient != nullptr )
|
||||
{
|
||||
packet->setMsgId((int)clientMsgId);
|
||||
handleUnsuback(newClient, packet);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user