Xbee API Test 3

Dependencies:   XBee mbed

> help
h or help
m <status-in-hex>,. ... Modem status
l <cmd>,<val-in-hex>.   ... exec <cmd> (AT) at this host.
lset fid <val-in-hex>. ... set local frame id. default is 1.
lset cmd <val-in-hex>. ... set local command.
lset val <val-in-hex>. ... set local command value.
q <cmd>,<val-in-hex>.   ... set queue parameter value.
r <cmd>,<val-in-hex>.   ... exec <cmd> (AT)at remote host.
rset a16 <val-in-hex>. ... set remote address high.
rset a64 <val-in-hex>,<val-in-hex>.  ... set remote address low.
rset fid <val-in-hex>. ... set remote frame id. default is 1.

> l D4,0x05
cmd=D4 val=0x05
apiId=88

object 100008c8:35 01 00 10 88 00 05 FE 04 01 00 FF

l OK:

> l D4,0x04
cmd=D4 val=0x04
apiId=88

object 100008c8:35 01 00 10 88 00 05 FE 04 01 00 FF

l OK:

>
Committer:
takashiyamanoue
Date:
Sat Jul 21 04:09:54 2012 +0000
Revision:
0:3edcfa3aba71
xbee test 3

Who changed what in which revision?

UserRevisionLine numberNew contents of line
takashiyamanoue 0:3edcfa3aba71 1 /*****************************************************************************
takashiyamanoue 0:3edcfa3aba71 2 * randm.h - Random number generator header file.
takashiyamanoue 0:3edcfa3aba71 3 *
takashiyamanoue 0:3edcfa3aba71 4 * Copyright (c) 2003 by Marc Boucher, Services Informatiques (MBSI) inc.
takashiyamanoue 0:3edcfa3aba71 5 * Copyright (c) 1998 Global Election Systems Inc.
takashiyamanoue 0:3edcfa3aba71 6 *
takashiyamanoue 0:3edcfa3aba71 7 * The authors hereby grant permission to use, copy, modify, distribute,
takashiyamanoue 0:3edcfa3aba71 8 * and license this software and its documentation for any purpose, provided
takashiyamanoue 0:3edcfa3aba71 9 * that existing copyright notices are retained in all copies and that this
takashiyamanoue 0:3edcfa3aba71 10 * notice and the following disclaimer are included verbatim in any
takashiyamanoue 0:3edcfa3aba71 11 * distributions. No written agreement, license, or royalty fee is required
takashiyamanoue 0:3edcfa3aba71 12 * for any of the authorized uses.
takashiyamanoue 0:3edcfa3aba71 13 *
takashiyamanoue 0:3edcfa3aba71 14 * THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS *AS IS* AND ANY EXPRESS OR
takashiyamanoue 0:3edcfa3aba71 15 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
takashiyamanoue 0:3edcfa3aba71 16 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
takashiyamanoue 0:3edcfa3aba71 17 * IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
takashiyamanoue 0:3edcfa3aba71 18 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
takashiyamanoue 0:3edcfa3aba71 19 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
takashiyamanoue 0:3edcfa3aba71 20 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
takashiyamanoue 0:3edcfa3aba71 21 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
takashiyamanoue 0:3edcfa3aba71 22 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
takashiyamanoue 0:3edcfa3aba71 23 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
takashiyamanoue 0:3edcfa3aba71 24 *
takashiyamanoue 0:3edcfa3aba71 25 ******************************************************************************
takashiyamanoue 0:3edcfa3aba71 26 * REVISION HISTORY
takashiyamanoue 0:3edcfa3aba71 27 *
takashiyamanoue 0:3edcfa3aba71 28 * 03-01-01 Marc Boucher <marc@mbsi.ca>
takashiyamanoue 0:3edcfa3aba71 29 * Ported to lwIP.
takashiyamanoue 0:3edcfa3aba71 30 * 98-05-29 Guy Lancaster <glanca@gesn.com>, Global Election Systems Inc.
takashiyamanoue 0:3edcfa3aba71 31 * Extracted from avos.
takashiyamanoue 0:3edcfa3aba71 32 *****************************************************************************/
takashiyamanoue 0:3edcfa3aba71 33
takashiyamanoue 0:3edcfa3aba71 34 #ifndef RANDM_H
takashiyamanoue 0:3edcfa3aba71 35 #define RANDM_H
takashiyamanoue 0:3edcfa3aba71 36
takashiyamanoue 0:3edcfa3aba71 37 /***********************
takashiyamanoue 0:3edcfa3aba71 38 *** PUBLIC FUNCTIONS ***
takashiyamanoue 0:3edcfa3aba71 39 ***********************/
takashiyamanoue 0:3edcfa3aba71 40 /*
takashiyamanoue 0:3edcfa3aba71 41 * Initialize the random number generator.
takashiyamanoue 0:3edcfa3aba71 42 */
takashiyamanoue 0:3edcfa3aba71 43 void avRandomInit(void);
takashiyamanoue 0:3edcfa3aba71 44
takashiyamanoue 0:3edcfa3aba71 45 /*
takashiyamanoue 0:3edcfa3aba71 46 * Churn the randomness pool on a random event. Call this early and often
takashiyamanoue 0:3edcfa3aba71 47 * on random and semi-random system events to build randomness in time for
takashiyamanoue 0:3edcfa3aba71 48 * usage. For randomly timed events, pass a null pointer and a zero length
takashiyamanoue 0:3edcfa3aba71 49 * and this will use the system timer and other sources to add randomness.
takashiyamanoue 0:3edcfa3aba71 50 * If new random data is available, pass a pointer to that and it will be
takashiyamanoue 0:3edcfa3aba71 51 * included.
takashiyamanoue 0:3edcfa3aba71 52 */
takashiyamanoue 0:3edcfa3aba71 53 void avChurnRand(char *randData, u32_t randLen);
takashiyamanoue 0:3edcfa3aba71 54
takashiyamanoue 0:3edcfa3aba71 55 /*
takashiyamanoue 0:3edcfa3aba71 56 * Randomize our random seed value. To be called for truely random events
takashiyamanoue 0:3edcfa3aba71 57 * such as user operations and network traffic.
takashiyamanoue 0:3edcfa3aba71 58 */
takashiyamanoue 0:3edcfa3aba71 59 #if MD5_SUPPORT
takashiyamanoue 0:3edcfa3aba71 60 #define avRandomize() avChurnRand(NULL, 0)
takashiyamanoue 0:3edcfa3aba71 61 #else /* MD5_SUPPORT */
takashiyamanoue 0:3edcfa3aba71 62 void avRandomize(void);
takashiyamanoue 0:3edcfa3aba71 63 #endif /* MD5_SUPPORT */
takashiyamanoue 0:3edcfa3aba71 64
takashiyamanoue 0:3edcfa3aba71 65 /*
takashiyamanoue 0:3edcfa3aba71 66 * Use the random pool to generate random data. This degrades to pseudo
takashiyamanoue 0:3edcfa3aba71 67 * random when used faster than randomness is supplied using churnRand().
takashiyamanoue 0:3edcfa3aba71 68 * Thus it's important to make sure that the results of this are not
takashiyamanoue 0:3edcfa3aba71 69 * published directly because one could predict the next result to at
takashiyamanoue 0:3edcfa3aba71 70 * least some degree. Also, it's important to get a good seed before
takashiyamanoue 0:3edcfa3aba71 71 * the first use.
takashiyamanoue 0:3edcfa3aba71 72 */
takashiyamanoue 0:3edcfa3aba71 73 void avGenRand(char *buf, u32_t bufLen);
takashiyamanoue 0:3edcfa3aba71 74
takashiyamanoue 0:3edcfa3aba71 75 /*
takashiyamanoue 0:3edcfa3aba71 76 * Return a new random number.
takashiyamanoue 0:3edcfa3aba71 77 */
takashiyamanoue 0:3edcfa3aba71 78 u32_t avRandom(void);
takashiyamanoue 0:3edcfa3aba71 79
takashiyamanoue 0:3edcfa3aba71 80
takashiyamanoue 0:3edcfa3aba71 81 #endif /* RANDM_H */