XBee modules

Dependencies:   DigiLogger

Fork of XBeeLib by Digi International Inc.

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers FH_RxPacket802.h Source File

FH_RxPacket802.h

00001 /**
00002  * Copyright (c) 2015 Digi International Inc.,
00003  * All rights not expressly granted are reserved.
00004  *
00005  * This Source Code Form is subject to the terms of the Mozilla Public
00006  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
00007  * You can obtain one at http://mozilla.org/MPL/2.0/.
00008  *
00009  * Digi International Inc. 11001 Bren Road East, Minnetonka, MN 55343
00010  * =======================================================================
00011  */
00012 
00013 #if !defined(__FH_RX_PACKET_802_H_)
00014 #define __FH_RX_PACKET_802_H_
00015 
00016 #include "FrameHandler.h"
00017 #include "RemoteXBee/RemoteXBee.h"
00018 
00019 namespace XBeeLib {
00020 
00021 /**
00022  * @defgroup callback_types "Callback types declaration"
00023  * @{
00024  */
00025 /** receive callback type declaration
00026   * @param remote the remote module that sent the data
00027   * @param broadcast a boolean to tell if the message was broadcast (true) or unicast (false)
00028   * @param data a pointer to data sent by @b remote.
00029   * @param len length (in bytes) of @b data buffer
00030   */
00031 typedef void (*receive_802_cb_t)(const RemoteXBee802& remote, bool broadcast, const uint8_t *const data, uint16_t len);
00032 /**
00033  * @}
00034  */
00035 
00036 class FH_RxPacket64b802 : public FrameHandler
00037 {
00038     private:
00039         /** Callback function, invoked if registered */
00040         receive_802_cb_t receive_cb;
00041 
00042     public:
00043         /** Class constructor */
00044         FH_RxPacket64b802();
00045 
00046         /** Class destructor */
00047         virtual ~FH_RxPacket64b802();
00048 
00049         virtual void process_frame_data(const ApiFrame* const frame);
00050 
00051         virtual void register_receive_cb(receive_802_cb_t function);
00052 
00053         virtual void unregister_receive_cb();
00054 };
00055 
00056 class FH_RxPacket16b802 : public FrameHandler
00057 {
00058     private:
00059         /** Callback function, invoked if registered */
00060         receive_802_cb_t receive_cb;
00061 
00062     public:
00063         /** Class constructor */
00064         FH_RxPacket16b802();
00065 
00066         /** Class destructor */
00067         virtual ~FH_RxPacket16b802();
00068 
00069         virtual void process_frame_data(const ApiFrame *const frame);
00070 
00071         virtual void register_receive_cb(receive_802_cb_t function);
00072 
00073         virtual void unregister_receive_cb();
00074 };
00075 
00076 }   /* namespace XBeeLib */
00077 
00078 #endif /* __FH_RX_PACKET_802_H_ */