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(__FH_AT_CMD_RESP_H_)
vpcola 0:f1d3878b8dd9 14 #define __FH_AT_CMD_RESP_H_
vpcola 0:f1d3878b8dd9 15
vpcola 0:f1d3878b8dd9 16 #include "FrameHandler.h"
vpcola 0:f1d3878b8dd9 17 #include "XBee/XBee.h"
vpcola 0:f1d3878b8dd9 18
vpcola 0:f1d3878b8dd9 19 namespace XBeeLib {
vpcola 0:f1d3878b8dd9 20 typedef void (*at_cmd_resp_cb_t)(const uint8_t * data, uint16_t len);
vpcola 0:f1d3878b8dd9 21
vpcola 0:f1d3878b8dd9 22 class FH_AtCmdResp : public FrameHandler
vpcola 0:f1d3878b8dd9 23 {
vpcola 0:f1d3878b8dd9 24 private:
vpcola 0:f1d3878b8dd9 25 /** Callback function, invoked (if registered) when an at command response packet is received */
vpcola 0:f1d3878b8dd9 26 at_cmd_resp_cb_t at_cmd_resp_cb;
vpcola 0:f1d3878b8dd9 27
vpcola 0:f1d3878b8dd9 28 public:
vpcola 0:f1d3878b8dd9 29
vpcola 0:f1d3878b8dd9 30 /** Class constructor */
vpcola 0:f1d3878b8dd9 31 FH_AtCmdResp();
vpcola 0:f1d3878b8dd9 32
vpcola 0:f1d3878b8dd9 33 /** Class constructor */
vpcola 0:f1d3878b8dd9 34 FH_AtCmdResp(ApiFrame::ApiFrameType type);
vpcola 0:f1d3878b8dd9 35
vpcola 0:f1d3878b8dd9 36
vpcola 0:f1d3878b8dd9 37 /** Class destructor */
vpcola 0:f1d3878b8dd9 38 virtual ~FH_AtCmdResp();
vpcola 0:f1d3878b8dd9 39
vpcola 0:f1d3878b8dd9 40 virtual void process_frame_data(const ApiFrame *const frame);
vpcola 0:f1d3878b8dd9 41
vpcola 0:f1d3878b8dd9 42 virtual void register_at_cmd_resp_cb(at_cmd_resp_cb_t function);
vpcola 0:f1d3878b8dd9 43
vpcola 0:f1d3878b8dd9 44 virtual void unregister_at_cmd_resp_cb();
vpcola 0:f1d3878b8dd9 45 };
vpcola 0:f1d3878b8dd9 46
vpcola 0:f1d3878b8dd9 47 /**
vpcola 0:f1d3878b8dd9 48 * @defgroup callback_types "Callback types declaration"
vpcola 0:f1d3878b8dd9 49 * @{
vpcola 0:f1d3878b8dd9 50 */
vpcola 0:f1d3878b8dd9 51 /** Node Discovery Response callback type declaration for ZigBee
vpcola 0:f1d3878b8dd9 52 * @param remote discovered remote node.
vpcola 0:f1d3878b8dd9 53 * @param node_id Node Identifier (NI parameter) of remote.
vpcola 0:f1d3878b8dd9 54 */
vpcola 0:f1d3878b8dd9 55 typedef void (*node_discovery_zb_cb_t)(const RemoteXBeeZB& remote, char const * const node_id);
vpcola 0:f1d3878b8dd9 56 /**
vpcola 0:f1d3878b8dd9 57 * @}
vpcola 0:f1d3878b8dd9 58 */
vpcola 0:f1d3878b8dd9 59
vpcola 0:f1d3878b8dd9 60 class FH_NodeDiscoveryZB : public FH_AtCmdResp
vpcola 0:f1d3878b8dd9 61 {
vpcola 0:f1d3878b8dd9 62 private:
vpcola 0:f1d3878b8dd9 63 /** Callback function, invoked (if registered) when an at command response packet is received */
vpcola 0:f1d3878b8dd9 64 node_discovery_zb_cb_t node_discovery_cb;
vpcola 0:f1d3878b8dd9 65
vpcola 0:f1d3878b8dd9 66 public:
vpcola 0:f1d3878b8dd9 67
vpcola 0:f1d3878b8dd9 68 /** Class constructor */
vpcola 0:f1d3878b8dd9 69 FH_NodeDiscoveryZB();
vpcola 0:f1d3878b8dd9 70
vpcola 0:f1d3878b8dd9 71 /** Class destructor */
vpcola 0:f1d3878b8dd9 72 virtual ~FH_NodeDiscoveryZB();
vpcola 0:f1d3878b8dd9 73
vpcola 0:f1d3878b8dd9 74 virtual void process_frame_data(const ApiFrame *const frame);
vpcola 0:f1d3878b8dd9 75
vpcola 0:f1d3878b8dd9 76 virtual void register_node_discovery_cb(node_discovery_zb_cb_t function);
vpcola 0:f1d3878b8dd9 77
vpcola 0:f1d3878b8dd9 78 virtual void unregister_node_discovery_cb();
vpcola 0:f1d3878b8dd9 79 };
vpcola 0:f1d3878b8dd9 80
vpcola 0:f1d3878b8dd9 81 /**
vpcola 0:f1d3878b8dd9 82 * @defgroup callback_types "Callback types declaration"
vpcola 0:f1d3878b8dd9 83 * @{
vpcola 0:f1d3878b8dd9 84 */
vpcola 0:f1d3878b8dd9 85 /** Node Discovery Response callback type declaration for ZigBee
vpcola 0:f1d3878b8dd9 86 * @param remote discovered remote node.
vpcola 0:f1d3878b8dd9 87 * @param node_id Node Identifier (NI parameter) of remote.
vpcola 0:f1d3878b8dd9 88 */
vpcola 0:f1d3878b8dd9 89 typedef void (*node_discovery_dm_cb_t)(const RemoteXBeeDM& remote, char const * const node_id);
vpcola 0:f1d3878b8dd9 90 /**
vpcola 0:f1d3878b8dd9 91 * @}
vpcola 0:f1d3878b8dd9 92 */
vpcola 0:f1d3878b8dd9 93
vpcola 0:f1d3878b8dd9 94 class FH_NodeDiscoveryDM : public FH_AtCmdResp
vpcola 0:f1d3878b8dd9 95 {
vpcola 0:f1d3878b8dd9 96 private:
vpcola 0:f1d3878b8dd9 97 /** Callback function, invoked (if registered) when an at command response packet is received */
vpcola 0:f1d3878b8dd9 98 node_discovery_dm_cb_t node_discovery_cb;
vpcola 0:f1d3878b8dd9 99
vpcola 0:f1d3878b8dd9 100 public:
vpcola 0:f1d3878b8dd9 101
vpcola 0:f1d3878b8dd9 102 /** Class constructor */
vpcola 0:f1d3878b8dd9 103 FH_NodeDiscoveryDM();
vpcola 0:f1d3878b8dd9 104
vpcola 0:f1d3878b8dd9 105 /** Class destructor */
vpcola 0:f1d3878b8dd9 106 virtual ~FH_NodeDiscoveryDM();
vpcola 0:f1d3878b8dd9 107
vpcola 0:f1d3878b8dd9 108 virtual void process_frame_data(const ApiFrame *const frame);
vpcola 0:f1d3878b8dd9 109
vpcola 0:f1d3878b8dd9 110 virtual void register_node_discovery_cb(node_discovery_dm_cb_t function);
vpcola 0:f1d3878b8dd9 111
vpcola 0:f1d3878b8dd9 112 virtual void unregister_node_discovery_cb();
vpcola 0:f1d3878b8dd9 113 };
vpcola 0:f1d3878b8dd9 114
vpcola 0:f1d3878b8dd9 115 /**
vpcola 0:f1d3878b8dd9 116 * @defgroup callback_types "Callback types declaration"
vpcola 0:f1d3878b8dd9 117 * @{
vpcola 0:f1d3878b8dd9 118 */
vpcola 0:f1d3878b8dd9 119 /** Node Discovery Response callback type declaration for 802.15.4
vpcola 0:f1d3878b8dd9 120 * @param remote discovered remote node.
vpcola 0:f1d3878b8dd9 121 * @param node_id Node Identifier (NI parameter) of remote.
vpcola 0:f1d3878b8dd9 122 */
vpcola 0:f1d3878b8dd9 123 typedef void (*node_discovery_802_cb_t)(const RemoteXBee802& remote, char const * const node_id);
vpcola 0:f1d3878b8dd9 124 /**
vpcola 0:f1d3878b8dd9 125 * @}
vpcola 0:f1d3878b8dd9 126 */
vpcola 0:f1d3878b8dd9 127
vpcola 0:f1d3878b8dd9 128 class FH_NodeDiscovery802 : public FH_AtCmdResp
vpcola 0:f1d3878b8dd9 129 {
vpcola 0:f1d3878b8dd9 130 private:
vpcola 0:f1d3878b8dd9 131 /** Callback function, invoked (if registered) when an at command response packet is received */
vpcola 0:f1d3878b8dd9 132 node_discovery_802_cb_t node_discovery_cb;
vpcola 0:f1d3878b8dd9 133
vpcola 0:f1d3878b8dd9 134 public:
vpcola 0:f1d3878b8dd9 135
vpcola 0:f1d3878b8dd9 136 /** Class constructor */
vpcola 0:f1d3878b8dd9 137 FH_NodeDiscovery802();
vpcola 0:f1d3878b8dd9 138
vpcola 0:f1d3878b8dd9 139 /** Class destructor */
vpcola 0:f1d3878b8dd9 140 virtual ~FH_NodeDiscovery802();
vpcola 0:f1d3878b8dd9 141
vpcola 0:f1d3878b8dd9 142 virtual void process_frame_data(const ApiFrame *const frame);
vpcola 0:f1d3878b8dd9 143
vpcola 0:f1d3878b8dd9 144 virtual void register_node_discovery_cb(node_discovery_802_cb_t function);
vpcola 0:f1d3878b8dd9 145
vpcola 0:f1d3878b8dd9 146 virtual void unregister_node_discovery_cb();
vpcola 0:f1d3878b8dd9 147 };
vpcola 0:f1d3878b8dd9 148
vpcola 0:f1d3878b8dd9 149 } /* namespace XBeeLib */
vpcola 0:f1d3878b8dd9 150
vpcola 0:f1d3878b8dd9 151 #endif /* __FH_AT_CMD_RESP_H_ */