Fork of my MQTTGateway

Dependencies:   mbed-http

Committer:
vpcola
Date:
Sat Apr 08 14:45:51 2017 +0000
Revision:
0:f1d3878b8dd9
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
vpcola 0:f1d3878b8dd9 1 /**
vpcola 0:f1d3878b8dd9 2 * Copyright (c) 2015 Digi International Inc.,
vpcola 0:f1d3878b8dd9 3 * All rights not expressly granted are reserved.
vpcola 0:f1d3878b8dd9 4 *
vpcola 0:f1d3878b8dd9 5 * This Source Code Form is subject to the terms of the Mozilla Public
vpcola 0:f1d3878b8dd9 6 * License, v. 2.0. If a copy of the MPL was not distributed with this file,
vpcola 0:f1d3878b8dd9 7 * You can obtain one at http://mozilla.org/MPL/2.0/.
vpcola 0:f1d3878b8dd9 8 *
vpcola 0:f1d3878b8dd9 9 * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
vpcola 0:f1d3878b8dd9 10 * =======================================================================
vpcola 0:f1d3878b8dd9 11 */
vpcola 0:f1d3878b8dd9 12
vpcola 0:f1d3878b8dd9 13 #if !defined(__FRAME_HANDLER_H_)
vpcola 0:f1d3878b8dd9 14 #define __FRAME_HANDLER_H_
vpcola 0:f1d3878b8dd9 15
vpcola 0:f1d3878b8dd9 16 #include "Frames/ApiFrame.h"
vpcola 0:f1d3878b8dd9 17
vpcola 0:f1d3878b8dd9 18 /** Class for the frame handlers */
vpcola 0:f1d3878b8dd9 19 class FrameHandler
vpcola 0:f1d3878b8dd9 20 {
vpcola 0:f1d3878b8dd9 21 friend class ApiFrame;
vpcola 0:f1d3878b8dd9 22
vpcola 0:f1d3878b8dd9 23 public:
vpcola 0:f1d3878b8dd9 24 /** Class constructor
vpcola 0:f1d3878b8dd9 25 *
vpcola 0:f1d3878b8dd9 26 * @param type frame type handled by this frame handler
vpcola 0:f1d3878b8dd9 27 */
vpcola 0:f1d3878b8dd9 28 FrameHandler(ApiFrame::ApiFrameType type);
vpcola 0:f1d3878b8dd9 29
vpcola 0:f1d3878b8dd9 30 FrameHandler(const FrameHandler& other); /* Intentionally not implemented */
vpcola 0:f1d3878b8dd9 31 /** Class destructor */
vpcola 0:f1d3878b8dd9 32 virtual ~FrameHandler();
vpcola 0:f1d3878b8dd9 33
vpcola 0:f1d3878b8dd9 34 /** get_type returns the type of frames handled by this handler
vpcola 0:f1d3878b8dd9 35 *
vpcola 0:f1d3878b8dd9 36 * @returns the frame type handled by the handler
vpcola 0:f1d3878b8dd9 37 */
vpcola 0:f1d3878b8dd9 38 ApiFrame::ApiFrameType get_type() const;
vpcola 0:f1d3878b8dd9 39
vpcola 0:f1d3878b8dd9 40 /** process_frame_data method called by the library to process the
vpcola 0:f1d3878b8dd9 41 * the incoming frames if the type matches.
vpcola 0:f1d3878b8dd9 42 *
vpcola 0:f1d3878b8dd9 43 * @param frame pointer pointing to the api frame that must be processed
vpcola 0:f1d3878b8dd9 44 */
vpcola 0:f1d3878b8dd9 45 virtual void process_frame_data(const ApiFrame *const frame) = 0;
vpcola 0:f1d3878b8dd9 46
vpcola 0:f1d3878b8dd9 47 protected:
vpcola 0:f1d3878b8dd9 48 /** frame type handled by this handler */
vpcola 0:f1d3878b8dd9 49 ApiFrame::ApiFrameType _type;
vpcola 0:f1d3878b8dd9 50 };
vpcola 0:f1d3878b8dd9 51
vpcola 0:f1d3878b8dd9 52 #endif /* defined(__FRAME_HANDLER_H_) */