Ported Arduino RF24Network library.

Committer:
zcw607
Date:
Mon Mar 09 21:23:56 2015 +0000
Revision:
1:b5836d9f8de5
Parent:
0:df0a8886a0e9
Clean up errors

Who changed what in which revision?

UserRevisionLine numberNew contents of line
zcw607 0:df0a8886a0e9 1 /*
zcw607 0:df0a8886a0e9 2 Copyright (C) 2011 James Coliz, Jr. <maniacbug@ymail.com>
zcw607 0:df0a8886a0e9 3
zcw607 0:df0a8886a0e9 4 This program is free software; you can redistribute it and/or
zcw607 0:df0a8886a0e9 5 modify it under the terms of the GNU General Public License
zcw607 0:df0a8886a0e9 6 version 2 as published by the Free Software Foundation.
zcw607 0:df0a8886a0e9 7 */
zcw607 0:df0a8886a0e9 8
zcw607 0:df0a8886a0e9 9 #ifndef __RF24NETWORK_H__
zcw607 0:df0a8886a0e9 10 #define __RF24NETWORK_H__
zcw607 0:df0a8886a0e9 11
zcw607 0:df0a8886a0e9 12 /**
zcw607 0:df0a8886a0e9 13 * @file RF24Network.h
zcw607 0:df0a8886a0e9 14 *
zcw607 0:df0a8886a0e9 15 * Class declaration for RF24Network
zcw607 0:df0a8886a0e9 16 */
zcw607 0:df0a8886a0e9 17
zcw607 0:df0a8886a0e9 18 #include <stddef.h>
zcw607 0:df0a8886a0e9 19 #include <stdint.h>
zcw607 0:df0a8886a0e9 20
zcw607 0:df0a8886a0e9 21 class RF24;
zcw607 0:df0a8886a0e9 22
zcw607 0:df0a8886a0e9 23 /**
zcw607 0:df0a8886a0e9 24 * Header which is sent with each message
zcw607 0:df0a8886a0e9 25 *
zcw607 0:df0a8886a0e9 26 * The frame put over the air consists of this header and a message
zcw607 0:df0a8886a0e9 27 */
zcw607 0:df0a8886a0e9 28 struct RF24NetworkHeader
zcw607 0:df0a8886a0e9 29 {
zcw607 0:df0a8886a0e9 30 uint16_t from_node; /**< Logical address where the message was generated */
zcw607 0:df0a8886a0e9 31 uint16_t to_node; /**< Logical address where the message is going */
zcw607 0:df0a8886a0e9 32 uint16_t id; /**< Sequential message ID, incremented every message */
zcw607 0:df0a8886a0e9 33 unsigned char type; /**< Type of the packet. 0-127 are user-defined types, 128-255 are reserved for system */
zcw607 0:df0a8886a0e9 34 unsigned char reserved; /**< Reserved for future use */
zcw607 0:df0a8886a0e9 35
zcw607 0:df0a8886a0e9 36 static uint16_t next_id; /**< The message ID of the next message to be sent */
zcw607 0:df0a8886a0e9 37
zcw607 0:df0a8886a0e9 38 /**
zcw607 0:df0a8886a0e9 39 * Default constructor
zcw607 0:df0a8886a0e9 40 *
zcw607 0:df0a8886a0e9 41 * Simply constructs a blank header
zcw607 0:df0a8886a0e9 42 */
zcw607 0:df0a8886a0e9 43 RF24NetworkHeader() {}
zcw607 0:df0a8886a0e9 44
zcw607 0:df0a8886a0e9 45 /**
zcw607 0:df0a8886a0e9 46 * Send constructor
zcw607 0:df0a8886a0e9 47 *
zcw607 0:df0a8886a0e9 48 * Use this constructor to create a header and then send a message
zcw607 0:df0a8886a0e9 49 *
zcw607 0:df0a8886a0e9 50 * @code
zcw607 0:df0a8886a0e9 51 * RF24NetworkHeader header(recipient_address,'t');
zcw607 0:df0a8886a0e9 52 * network.write(header,&message,sizeof(message));
zcw607 0:df0a8886a0e9 53 * @endcode
zcw607 0:df0a8886a0e9 54 *
zcw607 0:df0a8886a0e9 55 * @param _to The logical node address where the message is going
zcw607 0:df0a8886a0e9 56 * @param _type The type of message which follows. Only 0-127 are allowed for
zcw607 0:df0a8886a0e9 57 * user messages.
zcw607 0:df0a8886a0e9 58 */
zcw607 0:df0a8886a0e9 59 RF24NetworkHeader(uint16_t _to, unsigned char _type = 0): to_node(_to), id(next_id++), type(_type&0x7f) {}
zcw607 0:df0a8886a0e9 60
zcw607 0:df0a8886a0e9 61 /**
zcw607 0:df0a8886a0e9 62 * Create debugging string
zcw607 0:df0a8886a0e9 63 *
zcw607 0:df0a8886a0e9 64 * Useful for debugging. Dumps all members into a single string, using
zcw607 0:df0a8886a0e9 65 * internal static memory. This memory will get overridden next time
zcw607 0:df0a8886a0e9 66 * you call the method.
zcw607 0:df0a8886a0e9 67 *
zcw607 0:df0a8886a0e9 68 * @return String representation of this object
zcw607 0:df0a8886a0e9 69 */
zcw607 0:df0a8886a0e9 70 const char* toString(void) const;
zcw607 0:df0a8886a0e9 71 };
zcw607 0:df0a8886a0e9 72
zcw607 0:df0a8886a0e9 73 /**
zcw607 0:df0a8886a0e9 74 * Network Layer for RF24 Radios
zcw607 0:df0a8886a0e9 75 *
zcw607 0:df0a8886a0e9 76 * This class implements an OSI Network Layer using nRF24L01(+) radios driven
zcw607 0:df0a8886a0e9 77 * by RF24 library.
zcw607 0:df0a8886a0e9 78 */
zcw607 0:df0a8886a0e9 79
zcw607 0:df0a8886a0e9 80 class RF24Network
zcw607 0:df0a8886a0e9 81 {
zcw607 0:df0a8886a0e9 82 public:
zcw607 0:df0a8886a0e9 83 /**
zcw607 0:df0a8886a0e9 84 * Construct the network
zcw607 0:df0a8886a0e9 85 *
zcw607 0:df0a8886a0e9 86 * @param _radio The underlying radio driver instance
zcw607 0:df0a8886a0e9 87 *
zcw607 0:df0a8886a0e9 88 */
zcw607 0:df0a8886a0e9 89 RF24Network( RF24& _radio );
zcw607 0:df0a8886a0e9 90
zcw607 0:df0a8886a0e9 91 /**
zcw607 0:df0a8886a0e9 92 * Bring up the network
zcw607 0:df0a8886a0e9 93 *
zcw607 0:df0a8886a0e9 94 * @warning Be sure to 'begin' the radio first.
zcw607 0:df0a8886a0e9 95 *
zcw607 0:df0a8886a0e9 96 * @param _channel The RF channel to operate on
zcw607 0:df0a8886a0e9 97 * @param _node_address The logical address of this node
zcw607 0:df0a8886a0e9 98 */
zcw607 0:df0a8886a0e9 99 void begin(uint8_t _channel, uint16_t _node_address );
zcw607 0:df0a8886a0e9 100
zcw607 0:df0a8886a0e9 101 /**
zcw607 0:df0a8886a0e9 102 * Main layer loop
zcw607 0:df0a8886a0e9 103 *
zcw607 0:df0a8886a0e9 104 * This function must be called regularly to keep the layer going. This is where all
zcw607 0:df0a8886a0e9 105 * the action happens!
zcw607 0:df0a8886a0e9 106 */
zcw607 0:df0a8886a0e9 107 void update(void);
zcw607 0:df0a8886a0e9 108
zcw607 0:df0a8886a0e9 109 /**
zcw607 0:df0a8886a0e9 110 * Test whether there is a message available for this node
zcw607 0:df0a8886a0e9 111 *
zcw607 0:df0a8886a0e9 112 * @return Whether there is a message available for this node
zcw607 0:df0a8886a0e9 113 */
zcw607 0:df0a8886a0e9 114 bool available(void);
zcw607 0:df0a8886a0e9 115
zcw607 0:df0a8886a0e9 116 /**
zcw607 0:df0a8886a0e9 117 * Read the next available header
zcw607 0:df0a8886a0e9 118 *
zcw607 0:df0a8886a0e9 119 * Reads the next available header without advancing to the next
zcw607 0:df0a8886a0e9 120 * incoming message. Useful for doing a switch on the message type
zcw607 0:df0a8886a0e9 121 *
zcw607 0:df0a8886a0e9 122 * If there is no message available, the header is not touched
zcw607 0:df0a8886a0e9 123 *
zcw607 0:df0a8886a0e9 124 * @param[out] header The header (envelope) of the next message
zcw607 0:df0a8886a0e9 125 */
zcw607 0:df0a8886a0e9 126 void peek(RF24NetworkHeader& header);
zcw607 0:df0a8886a0e9 127
zcw607 0:df0a8886a0e9 128 /**
zcw607 0:df0a8886a0e9 129 * Read a message
zcw607 0:df0a8886a0e9 130 *
zcw607 0:df0a8886a0e9 131 * @param[out] header The header (envelope) of this message
zcw607 0:df0a8886a0e9 132 * @param[out] message Pointer to memory where the message should be placed
zcw607 0:df0a8886a0e9 133 * @param maxlen The largest message size which can be held in @p message
zcw607 0:df0a8886a0e9 134 * @return The total number of bytes copied into @p message
zcw607 0:df0a8886a0e9 135 */
zcw607 0:df0a8886a0e9 136 size_t read(RF24NetworkHeader& header, void* message, size_t maxlen);
zcw607 0:df0a8886a0e9 137
zcw607 0:df0a8886a0e9 138 /**
zcw607 0:df0a8886a0e9 139 * Send a message
zcw607 0:df0a8886a0e9 140 *
zcw607 0:df0a8886a0e9 141 * @param[in,out] header The header (envelope) of this message. The critical
zcw607 0:df0a8886a0e9 142 * thing to fill in is the @p to_node field so we know where to send the
zcw607 0:df0a8886a0e9 143 * message. It is then updated with the details of the actual header sent.
zcw607 0:df0a8886a0e9 144 * @param message Pointer to memory where the message is located
zcw607 0:df0a8886a0e9 145 * @param len The size of the message
zcw607 0:df0a8886a0e9 146 * @return Whether the message was successfully received
zcw607 0:df0a8886a0e9 147 */
zcw607 0:df0a8886a0e9 148 bool write(RF24NetworkHeader& header,const void* message, size_t len);
zcw607 0:df0a8886a0e9 149
zcw607 0:df0a8886a0e9 150 protected:
zcw607 0:df0a8886a0e9 151 void open_pipes(void);
zcw607 0:df0a8886a0e9 152 uint16_t find_node( uint16_t current_node, uint16_t target_node );
zcw607 0:df0a8886a0e9 153 bool write(uint16_t);
zcw607 0:df0a8886a0e9 154 bool write_to_pipe( uint16_t node, uint8_t pipe );
zcw607 0:df0a8886a0e9 155 bool enqueue(void);
zcw607 0:df0a8886a0e9 156
zcw607 0:df0a8886a0e9 157 bool is_direct_child( uint16_t node );
zcw607 0:df0a8886a0e9 158 bool is_descendant( uint16_t node );
zcw607 0:df0a8886a0e9 159 uint16_t direct_child_route_to( uint16_t node );
zcw607 0:df0a8886a0e9 160 uint8_t pipe_to_descendant( uint16_t node );
zcw607 0:df0a8886a0e9 161 void setup_address(void);
zcw607 0:df0a8886a0e9 162
zcw607 0:df0a8886a0e9 163 private:
zcw607 0:df0a8886a0e9 164 RF24& radio; /**< Underlying radio driver, provides link/physical layers */
zcw607 0:df0a8886a0e9 165 uint16_t node_address; /**< Logical node address of this unit, 1 .. UINT_MAX */
zcw607 0:df0a8886a0e9 166 const static int frame_size = 32; /**< How large is each frame over the air */
zcw607 0:df0a8886a0e9 167 uint8_t frame_buffer[frame_size]; /**< Space to put the frame that will be sent/received over the air */
zcw607 0:df0a8886a0e9 168 uint8_t frame_queue[5*frame_size]; /**< Space for a small set of frames that need to be delivered to the app layer */
zcw607 0:df0a8886a0e9 169 uint8_t* next_frame; /**< Pointer into the @p frame_queue where we should place the next received frame */
zcw607 0:df0a8886a0e9 170
zcw607 0:df0a8886a0e9 171 uint16_t parent_node; /**< Our parent's node address */
zcw607 0:df0a8886a0e9 172 uint8_t parent_pipe; /**< The pipe our parent uses to listen to us */
zcw607 0:df0a8886a0e9 173 uint16_t node_mask; /**< The bits which contain signfificant node address information */
zcw607 1:b5836d9f8de5 174 uint8_t min(uint8_t, uint8_t);
zcw607 0:df0a8886a0e9 175 };
zcw607 0:df0a8886a0e9 176
zcw607 0:df0a8886a0e9 177 /**
zcw607 0:df0a8886a0e9 178 * @example helloworld_tx.pde
zcw607 0:df0a8886a0e9 179 *
zcw607 0:df0a8886a0e9 180 * Simplest possible example of using RF24Network. Put this sketch
zcw607 0:df0a8886a0e9 181 * on one node, and helloworld_rx.pde on the other. Tx will send
zcw607 0:df0a8886a0e9 182 * Rx a nice message every 2 seconds which rx will print out for us.
zcw607 0:df0a8886a0e9 183 */
zcw607 0:df0a8886a0e9 184
zcw607 0:df0a8886a0e9 185 /**
zcw607 0:df0a8886a0e9 186 * @example helloworld_rx.pde
zcw607 0:df0a8886a0e9 187 *
zcw607 0:df0a8886a0e9 188 * Simplest possible example of using RF24Network. Put this sketch
zcw607 0:df0a8886a0e9 189 * on one node, and helloworld_tx.pde on the other. Tx will send
zcw607 0:df0a8886a0e9 190 * Rx a nice message every 2 seconds which rx will print out for us.
zcw607 0:df0a8886a0e9 191 */
zcw607 0:df0a8886a0e9 192
zcw607 0:df0a8886a0e9 193 /**
zcw607 0:df0a8886a0e9 194 * @example meshping.pde
zcw607 0:df0a8886a0e9 195 *
zcw607 0:df0a8886a0e9 196 * Example of pinging across a mesh network
zcw607 0:df0a8886a0e9 197 * Using this sketch, each node will send a ping to the base every
zcw607 0:df0a8886a0e9 198 * few seconds. The RF24Network library will route the message across
zcw607 0:df0a8886a0e9 199 * the mesh to the correct node.
zcw607 0:df0a8886a0e9 200 */
zcw607 0:df0a8886a0e9 201
zcw607 0:df0a8886a0e9 202 /**
zcw607 0:df0a8886a0e9 203 * @example sensornet.pde
zcw607 0:df0a8886a0e9 204 *
zcw607 0:df0a8886a0e9 205 * Example of a sensor network.
zcw607 0:df0a8886a0e9 206 * This sketch demonstrates how to use the RF24Network library to
zcw607 0:df0a8886a0e9 207 * manage a set of low-power sensor nodes which mostly sleep but
zcw607 0:df0a8886a0e9 208 * awake regularly to send readings to the base.
zcw607 0:df0a8886a0e9 209 */
zcw607 0:df0a8886a0e9 210 /**
zcw607 0:df0a8886a0e9 211 * @mainpage Network Layer for RF24 Radios
zcw607 0:df0a8886a0e9 212 *
zcw607 0:df0a8886a0e9 213 * This class implements an <a href="http://en.wikipedia.org/wiki/Network_layer">OSI Network Layer</a> using nRF24L01(+) radios driven
zcw607 0:df0a8886a0e9 214 * by the <a href="http://maniacbug.github.com/RF24/">RF24</a> library.
zcw607 0:df0a8886a0e9 215 *
zcw607 0:df0a8886a0e9 216 * @section Purpose Purpose/Goal
zcw607 0:df0a8886a0e9 217 *
zcw607 0:df0a8886a0e9 218 * Create an alternative to ZigBee radios for Arduino communication.
zcw607 0:df0a8886a0e9 219 *
zcw607 0:df0a8886a0e9 220 * Xbees are excellent little radios, backed up by a mature and robust standard
zcw607 0:df0a8886a0e9 221 * protocol stack. They are also expensive.
zcw607 0:df0a8886a0e9 222 *
zcw607 0:df0a8886a0e9 223 * For many Arduino uses, they seem like overkill. So I am working to build
zcw607 0:df0a8886a0e9 224 * an alternative using nRF24L01 radios. Modules are available for less than
zcw607 0:df0a8886a0e9 225 * $6 from many sources. With the RF24Network layer, I hope to cover many
zcw607 0:df0a8886a0e9 226 * common communication scenarios.
zcw607 0:df0a8886a0e9 227 *
zcw607 0:df0a8886a0e9 228 * Please see the @ref Zigbee page for a comparison against the ZigBee protocols
zcw607 0:df0a8886a0e9 229 *
zcw607 0:df0a8886a0e9 230 * @section Features Features
zcw607 0:df0a8886a0e9 231 *
zcw607 0:df0a8886a0e9 232 * The layer provides:
zcw607 0:df0a8886a0e9 233 * @li Host Addressing. Each node has a logical address on the local network.
zcw607 0:df0a8886a0e9 234 * @li Message Forwarding. Messages can be sent from one node to any other, and
zcw607 0:df0a8886a0e9 235 * this layer will get them there no matter how many hops it takes.
zcw607 0:df0a8886a0e9 236 * @li Ad-hoc Joining. A node can join a network without any changes to any
zcw607 0:df0a8886a0e9 237 * existing nodes.
zcw607 0:df0a8886a0e9 238 *
zcw607 0:df0a8886a0e9 239 * The layer does not (yet) provide:
zcw607 0:df0a8886a0e9 240 * @li Fragmentation/reassembly. Ability to send longer messages and put them
zcw607 0:df0a8886a0e9 241 * all back together before exposing them up to the app.
zcw607 0:df0a8886a0e9 242 * @li Power-efficient listening. It would be useful for nodes who are listening
zcw607 0:df0a8886a0e9 243 * to sleep for extended periods of time if they could know that they would miss
zcw607 0:df0a8886a0e9 244 * no traffic.
zcw607 0:df0a8886a0e9 245 * @li Dynamic address assignment.
zcw607 0:df0a8886a0e9 246 *
zcw607 0:df0a8886a0e9 247 * @section More How to learn more
zcw607 0:df0a8886a0e9 248 *
zcw607 0:df0a8886a0e9 249 * @li <a href="http://maniacbug.github.com/RF24/">RF24: Underlying radio driver</a>
zcw607 0:df0a8886a0e9 250 * @li <a href="classRF24Network.html">RF24Network Class Documentation</a>
zcw607 0:df0a8886a0e9 251 * @li <a href="https://github.com/maniacbug/RF24Network/">Source Code</a>
zcw607 0:df0a8886a0e9 252 * @li <a href="https://github.com/maniacbug/RF24Network/archives/master">Downloads Page</a>
zcw607 0:df0a8886a0e9 253 * @li <a href="examples.html">Examples Page</a>. Start with <a href="helloworld_rx_8pde-example.html">helloworld_rx</a> and <a href="helloworld_tx_8pde-example.html">helloworld_tx</a>.
zcw607 0:df0a8886a0e9 254 *
zcw607 0:df0a8886a0e9 255 * @section Topology Topology for Mesh Networks using nRF24L01(+)
zcw607 0:df0a8886a0e9 256 *
zcw607 0:df0a8886a0e9 257 * This network layer takes advantage of the fundamental capability of the nRF24L01(+) radio to
zcw607 0:df0a8886a0e9 258 * listen actively to up to 6 other radios at once. The network is arranged in a
zcw607 0:df0a8886a0e9 259 * <a href="http://en.wikipedia.org/wiki/Network_Topology#Tree">Tree Topology</a>, where
zcw607 0:df0a8886a0e9 260 * one node is the base, and all other nodes are children either of that node, or of another.
zcw607 0:df0a8886a0e9 261 * Unlike a true mesh network, multiple nodes are not connected together, so there is only one
zcw607 0:df0a8886a0e9 262 * path to any given node.
zcw607 0:df0a8886a0e9 263 *
zcw607 0:df0a8886a0e9 264 * @section Octal Octal Addressing
zcw607 0:df0a8886a0e9 265 *
zcw607 0:df0a8886a0e9 266 * Each node must be assigned an 15-bit address by the administrator. This address exactly
zcw607 0:df0a8886a0e9 267 * describes the position of the node within the tree. The address is an octal number. Each
zcw607 0:df0a8886a0e9 268 * digit in the address represents a position in the tree further from the base.
zcw607 0:df0a8886a0e9 269 *
zcw607 0:df0a8886a0e9 270 * @li Node 00 is the base node.
zcw607 0:df0a8886a0e9 271 * @li Nodes 01-05 are nodes whose parent is the base.
zcw607 0:df0a8886a0e9 272 * @li Node 021 is the second child of node 01.
zcw607 0:df0a8886a0e9 273 * @li Node 0321 is the third child of node 021, an so on.
zcw607 0:df0a8886a0e9 274 * @li The largest node address is 05555, so 3,125 nodes are allowed on a single channel.
zcw607 0:df0a8886a0e9 275 *
zcw607 0:df0a8886a0e9 276 * @section Routing How routing is handled
zcw607 0:df0a8886a0e9 277 *
zcw607 0:df0a8886a0e9 278 * When sending a message using RF24Network::write(), you fill in the header with the logical
zcw607 0:df0a8886a0e9 279 * node address. The network layer figures out the right path to find that node, and sends
zcw607 0:df0a8886a0e9 280 * it through the system until it gets to the right place. This works even if the two nodes
zcw607 0:df0a8886a0e9 281 * are far separated, as it will send the message down to the base node, and then back out
zcw607 0:df0a8886a0e9 282 * to the final destination.
zcw607 0:df0a8886a0e9 283 *
zcw607 0:df0a8886a0e9 284 * All of this work is handled by the RF24Network::update() method, so be sure to call it
zcw607 0:df0a8886a0e9 285 * regularly or your network will miss packets.
zcw607 0:df0a8886a0e9 286 *
zcw607 0:df0a8886a0e9 287 * @section Startup Starting up a node
zcw607 0:df0a8886a0e9 288 *
zcw607 0:df0a8886a0e9 289 * When a node starts up, it only has to contact its parent to establish communication.
zcw607 0:df0a8886a0e9 290 * No direct connection to the Base node is needed. This is useful in situations where
zcw607 0:df0a8886a0e9 291 * relay nodes are being used to bridge the distance to the base, so leaf nodes are out
zcw607 0:df0a8886a0e9 292 * of range of the base.
zcw607 0:df0a8886a0e9 293 *
zcw607 0:df0a8886a0e9 294 * @section Directionality Directionality
zcw607 0:df0a8886a0e9 295 *
zcw607 0:df0a8886a0e9 296 * By default all nodes are always listening, so messages will quickly reach
zcw607 0:df0a8886a0e9 297 * their destination.
zcw607 0:df0a8886a0e9 298 *
zcw607 0:df0a8886a0e9 299 * You may choose to sleep any nodes which do not have any active children on the network
zcw607 0:df0a8886a0e9 300 * (i.e. leaf nodes). This is useful in a case where
zcw607 0:df0a8886a0e9 301 * the leaf nodes are operating on batteries and need to sleep.
zcw607 0:df0a8886a0e9 302 * This is useful for a sensor network. The leaf nodes can sleep most of the time, and wake
zcw607 0:df0a8886a0e9 303 * every few minutes to send in a reading. However, messages cannot be sent to these
zcw607 0:df0a8886a0e9 304 * sleeping nodes.
zcw607 0:df0a8886a0e9 305 *
zcw607 0:df0a8886a0e9 306 * In the future, I plan to write a system where messages can still be passed upward from
zcw607 0:df0a8886a0e9 307 * the base, and get delivered when a sleeping node is ready to receive them. The radio
zcw607 0:df0a8886a0e9 308 * and underlying driver support 'ack payloads', which will be a handy mechanism for this.
zcw607 0:df0a8886a0e9 309 *
zcw607 0:df0a8886a0e9 310 * @page Zigbee Comparison to ZigBee
zcw607 0:df0a8886a0e9 311 *
zcw607 0:df0a8886a0e9 312 * This network layer is influenced by the design of ZigBee, but does not implement it
zcw607 0:df0a8886a0e9 313 * directly.
zcw607 0:df0a8886a0e9 314 *
zcw607 0:df0a8886a0e9 315 * @section Advantage Which is better?
zcw607 0:df0a8886a0e9 316 *
zcw607 0:df0a8886a0e9 317 * ZigBee is a much more robust, feature-rich set of protocols, with many different vendors
zcw607 0:df0a8886a0e9 318 * providing compatible chips.
zcw607 0:df0a8886a0e9 319 *
zcw607 0:df0a8886a0e9 320 * RF24Network is cheap. While ZigBee radios are well over $20, nRF24L01 modules can be found
zcw607 0:df0a8886a0e9 321 * for under $6. My personal favorite is
zcw607 0:df0a8886a0e9 322 * <a href="http://www.mdfly.com/index.php?main_page=product_info&products_id=82">MDFly RF-IS2401</a>.
zcw607 0:df0a8886a0e9 323 *
zcw607 0:df0a8886a0e9 324 * @section Contrast Similiarities & Differences
zcw607 0:df0a8886a0e9 325 *
zcw607 0:df0a8886a0e9 326 * Here are some comparisons between RF24Network and ZigBee.
zcw607 0:df0a8886a0e9 327 *
zcw607 0:df0a8886a0e9 328 * @li Both networks support Star and Tree topologies. Only Zigbee supports a true mesh.
zcw607 0:df0a8886a0e9 329 * @li In both networks, only leaf nodes can sleep (see @ref NodeNames).
zcw607 0:df0a8886a0e9 330 * @li ZigBee nodes are configured using AT commands, or a separate Windows application.
zcw607 0:df0a8886a0e9 331 * RF24 nodes are configured by recompiliing the firmware or writing to EEPROM.
zcw607 0:df0a8886a0e9 332 *
zcw607 0:df0a8886a0e9 333 * @section NodeNames Node Naming
zcw607 0:df0a8886a0e9 334 *
zcw607 0:df0a8886a0e9 335 * @li Leaf node: A node at the outer edge of the network with no children. ZigBee calls it
zcw607 0:df0a8886a0e9 336 * an End Device node.
zcw607 0:df0a8886a0e9 337 * @li Relay node: A node which has both parents and children, and relays messages from one
zcw607 0:df0a8886a0e9 338 * to the other. ZigBee calls it a Router.
zcw607 0:df0a8886a0e9 339 * @li Base node. The top of the tree node with no parents, only children. Typically this node
zcw607 0:df0a8886a0e9 340 * will bridge to another kind of network like Ethernet. ZigBee calls it a Co-ordinator node.
zcw607 0:df0a8886a0e9 341 */
zcw607 0:df0a8886a0e9 342
zcw607 0:df0a8886a0e9 343 #endif // __RF24NETWORK_H__
zcw607 0:df0a8886a0e9 344 // vim:ai:cin:sts=2 sw=2 ft=cpp