Vergil Cola
/
MQTTGateway2
Fork of my original MQTTGateway
XbeeMonitor/XBeeLib/FrameHandlers/FH_RxPacket802.h@0:a1734fe1ec4b, 2017-04-08 (annotated)
- Committer:
- vpcola
- Date:
- Sat Apr 08 14:43:14 2017 +0000
- Revision:
- 0:a1734fe1ec4b
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
vpcola | 0:a1734fe1ec4b | 1 | /** |
vpcola | 0:a1734fe1ec4b | 2 | * Copyright (c) 2015 Digi International Inc., |
vpcola | 0:a1734fe1ec4b | 3 | * All rights not expressly granted are reserved. |
vpcola | 0:a1734fe1ec4b | 4 | * |
vpcola | 0:a1734fe1ec4b | 5 | * This Source Code Form is subject to the terms of the Mozilla Public |
vpcola | 0:a1734fe1ec4b | 6 | * License, v. 2.0. If a copy of the MPL was not distributed with this file, |
vpcola | 0:a1734fe1ec4b | 7 | * You can obtain one at http://mozilla.org/MPL/2.0/. |
vpcola | 0:a1734fe1ec4b | 8 | * |
vpcola | 0:a1734fe1ec4b | 9 | * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343 |
vpcola | 0:a1734fe1ec4b | 10 | * ======================================================================= |
vpcola | 0:a1734fe1ec4b | 11 | */ |
vpcola | 0:a1734fe1ec4b | 12 | |
vpcola | 0:a1734fe1ec4b | 13 | #if !defined(__FH_RX_PACKET_802_H_) |
vpcola | 0:a1734fe1ec4b | 14 | #define __FH_RX_PACKET_802_H_ |
vpcola | 0:a1734fe1ec4b | 15 | |
vpcola | 0:a1734fe1ec4b | 16 | #include "FrameHandler.h" |
vpcola | 0:a1734fe1ec4b | 17 | #include "RemoteXBee/RemoteXBee.h" |
vpcola | 0:a1734fe1ec4b | 18 | |
vpcola | 0:a1734fe1ec4b | 19 | namespace XBeeLib { |
vpcola | 0:a1734fe1ec4b | 20 | |
vpcola | 0:a1734fe1ec4b | 21 | /** |
vpcola | 0:a1734fe1ec4b | 22 | * @defgroup callback_types "Callback types declaration" |
vpcola | 0:a1734fe1ec4b | 23 | * @{ |
vpcola | 0:a1734fe1ec4b | 24 | */ |
vpcola | 0:a1734fe1ec4b | 25 | /** receive callback type declaration |
vpcola | 0:a1734fe1ec4b | 26 | * @param remote the remote module that sent the data |
vpcola | 0:a1734fe1ec4b | 27 | * @param broadcast a boolean to tell if the message was broadcast (true) or unicast (false) |
vpcola | 0:a1734fe1ec4b | 28 | * @param data a pointer to data sent by @b remote. |
vpcola | 0:a1734fe1ec4b | 29 | * @param len length (in bytes) of @b data buffer |
vpcola | 0:a1734fe1ec4b | 30 | */ |
vpcola | 0:a1734fe1ec4b | 31 | typedef void (*receive_802_cb_t)(const RemoteXBee802& remote, bool broadcast, const uint8_t *const data, uint16_t len); |
vpcola | 0:a1734fe1ec4b | 32 | /** |
vpcola | 0:a1734fe1ec4b | 33 | * @} |
vpcola | 0:a1734fe1ec4b | 34 | */ |
vpcola | 0:a1734fe1ec4b | 35 | |
vpcola | 0:a1734fe1ec4b | 36 | class FH_RxPacket64b802 : public FrameHandler |
vpcola | 0:a1734fe1ec4b | 37 | { |
vpcola | 0:a1734fe1ec4b | 38 | private: |
vpcola | 0:a1734fe1ec4b | 39 | /** Callback function, invoked if registered */ |
vpcola | 0:a1734fe1ec4b | 40 | receive_802_cb_t receive_cb; |
vpcola | 0:a1734fe1ec4b | 41 | |
vpcola | 0:a1734fe1ec4b | 42 | public: |
vpcola | 0:a1734fe1ec4b | 43 | /** Class constructor */ |
vpcola | 0:a1734fe1ec4b | 44 | FH_RxPacket64b802(); |
vpcola | 0:a1734fe1ec4b | 45 | |
vpcola | 0:a1734fe1ec4b | 46 | /** Class destructor */ |
vpcola | 0:a1734fe1ec4b | 47 | virtual ~FH_RxPacket64b802(); |
vpcola | 0:a1734fe1ec4b | 48 | |
vpcola | 0:a1734fe1ec4b | 49 | virtual void process_frame_data(const ApiFrame* const frame); |
vpcola | 0:a1734fe1ec4b | 50 | |
vpcola | 0:a1734fe1ec4b | 51 | virtual void register_receive_cb(receive_802_cb_t function); |
vpcola | 0:a1734fe1ec4b | 52 | |
vpcola | 0:a1734fe1ec4b | 53 | virtual void unregister_receive_cb(); |
vpcola | 0:a1734fe1ec4b | 54 | }; |
vpcola | 0:a1734fe1ec4b | 55 | |
vpcola | 0:a1734fe1ec4b | 56 | class FH_RxPacket16b802 : public FrameHandler |
vpcola | 0:a1734fe1ec4b | 57 | { |
vpcola | 0:a1734fe1ec4b | 58 | private: |
vpcola | 0:a1734fe1ec4b | 59 | /** Callback function, invoked if registered */ |
vpcola | 0:a1734fe1ec4b | 60 | receive_802_cb_t receive_cb; |
vpcola | 0:a1734fe1ec4b | 61 | |
vpcola | 0:a1734fe1ec4b | 62 | public: |
vpcola | 0:a1734fe1ec4b | 63 | /** Class constructor */ |
vpcola | 0:a1734fe1ec4b | 64 | FH_RxPacket16b802(); |
vpcola | 0:a1734fe1ec4b | 65 | |
vpcola | 0:a1734fe1ec4b | 66 | /** Class destructor */ |
vpcola | 0:a1734fe1ec4b | 67 | virtual ~FH_RxPacket16b802(); |
vpcola | 0:a1734fe1ec4b | 68 | |
vpcola | 0:a1734fe1ec4b | 69 | virtual void process_frame_data(const ApiFrame *const frame); |
vpcola | 0:a1734fe1ec4b | 70 | |
vpcola | 0:a1734fe1ec4b | 71 | virtual void register_receive_cb(receive_802_cb_t function); |
vpcola | 0:a1734fe1ec4b | 72 | |
vpcola | 0:a1734fe1ec4b | 73 | virtual void unregister_receive_cb(); |
vpcola | 0:a1734fe1ec4b | 74 | }; |
vpcola | 0:a1734fe1ec4b | 75 | |
vpcola | 0:a1734fe1ec4b | 76 | } /* namespace XBeeLib */ |
vpcola | 0:a1734fe1ec4b | 77 | |
vpcola | 0:a1734fe1ec4b | 78 | #endif /* __FH_RX_PACKET_802_H_ */ |