John Bailey / XBeeApi

Dependencies:   CircularBuffer FixedLengthList

Dependents:   XBeeApiTest XBeeApiSimpleATCmdsExample XBeeApiBroadcastExample XBeeApiBroadcastExampleRTOS ... more

Revision:
10:0d084d0253a7
Parent:
6:3cb62daace78
Child:
12:58319a467943
--- a/Base/XBeeApiFrame.hpp	Fri Jan 31 02:20:02 2014 +0000
+++ b/Base/XBeeApiFrame.hpp	Fri Jan 31 09:29:28 2014 +0000
@@ -96,8 +96,26 @@
         /** Retrieve the API identifier for this frame */
         XBeeApiIdentifier_e getApiId( void ) const;
         
-        /** Return a pointer to the API-specific data (i.e. that which follows the API identifier in the frame */
-        const uint8_t*      getDataPtr( void ) const;
+        /** Retrieve a pointer to the API-specific data (i.e. that which follows the API identifier in 
+            the frame).  In *total*, getDataPtr will return sufficient data to match getCmdLen(), however
+            it may be done in chunks using p_start and *p_len to control the fragmentation process.  
+            For example:
+            
+                getCmdLen() == 5;
+                getDataPtr( 0, &b, &l );
+                l == 2; b[0] == 'a'; b[1] == 'b'; 
+                getDataPtr( 2, &b, &l );
+                l == 1; b[2] == 'c';
+                getDataPtr( 3, &b, &l );
+                l == 2; b[0] == 'd'; b[1] == 'e';
+            
+            \param[in]  p_start The start point within the buffer.  It is only meaningful to use a non-zero
+                                value in the case that a previous call to getDataPtr did not return a buffer
+                                of length getCmdLen(), in which case p_start should be set to be the next
+                                byte that is required.
+            \param[out] p_buff  Pointer to a pointer to receive the buffer pointer 
+            \param[out] p_len   Pointer to receive the length of the data pointed to by *p_buff */
+        void getDataPtr( const uint16_t p_start, const uint8_t**  p_buff, uint16_t* const p_len ) const;
 };
 
 /* Forward declare this as XBeeDevice is dependent upon XBeeApiFrameDecoder */