Jack Hansdampf / mbed-mqtt-GSOE1

Dependents:   ESP8266MQTT

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers MQTTSNAggregateConnectionHandler.h Source File

MQTTSNAggregateConnectionHandler.h

00001 /**************************************************************************************
00002  * Copyright (c) 2018, Tomoaki Yamaguchi
00003  *
00004  * All rights reserved. This program and the accompanying materials
00005  * are made available under the terms of the Eclipse Public License v1.0
00006  * and Eclipse Distribution License v1.0 which accompany this distribution.
00007  *
00008  * The Eclipse Public License is available at
00009  *    http://www.eclipse.org/legal/epl-v10.html
00010  * and the Eclipse Distribution License is available at
00011  *   http://www.eclipse.org/org/documents/edl-v10.php.
00012  *
00013  * Contributors:
00014  *    Tomoaki Yamaguchi - initial API and implementation and/or initial documentation
00015  **************************************************************************************/
00016 
00017 #ifndef MQTTSNGATEWAY_SRC_MQTTSNAGGREGATECONNECTIONHANDLER_H_
00018 #define MQTTSNGATEWAY_SRC_MQTTSNAGGREGATECONNECTIONHANDLER_H_
00019 
00020 #include "MQTTSNGWDefines.h"
00021 
00022 namespace MQTTSNGW
00023 {
00024 class Gateway;
00025 class Client;
00026 class MQTTSNPacket;
00027 
00028 class MQTTSNAggregateConnectionHandler
00029 {
00030 public:
00031     MQTTSNAggregateConnectionHandler(Gateway* gateway);
00032     ~MQTTSNAggregateConnectionHandler(void);
00033 
00034     void handleConnect(Client* client, MQTTSNPacket* packet);
00035     void handleWillmsg(Client* client, MQTTSNPacket* packet);
00036     void handleDisconnect(Client* client, MQTTSNPacket* packet);
00037     void handlePingreq(Client* client, MQTTSNPacket* packet);
00038 
00039 private:
00040     void sendStoredPublish(Client* client);
00041 
00042     char _pbuf[MQTTSNGW_MAX_PACKET_SIZE * 3];
00043     Gateway* _gateway;
00044 };
00045 
00046 }
00047 
00048 #endif /* MQTTSNGATEWAY_SRC_MQTTSNAGGREGATECONNECTIONHANDLER_H_ */