xbee_pkt.3.html 3.08 KB
Newer Older
Franz's avatar
Franz committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107
<HTML><HEAD><TITLE>Manpage of XBEE_PKT</TITLE>
</HEAD><BODY>
<H1>XBEE_PKT</H1>
Section: Linux Programmer's Manual (3)<BR>Updated: 2009-11-01<BR><A HREF="#index">Index</A>
<A HREF="../index.html">Return to Main Contents</A><HR>

<A NAME="lbAB">&nbsp;</A>
<H2>NAME</H2>

xbee_pkt
<A NAME="lbAC">&nbsp;</A>
<H2>SYNOPSIS</H2>

<B>#include &lt;<A HREF="file:/usr/include/xbee.h">xbee.h</A>&gt;</B>


<A NAME="lbAD">&nbsp;</A>
<H2>DESCRIPTION</H2>

This is the packet structure. If you want to get more advanced information from connections (such as RSSI) then this is where it lives.
<P>

<PRE>
struct xbee_pkt {
  unsigned char frameID;          /* AT        Status    */
  unsigned char atCmd[2];         /* AT                  */
  unsigned char status;           /* AT  Data  Status    */ /* status / options */
  unsigned char Addr64[8];        /* AT  Data            */
  unsigned char Addr16[2];        /* AT  Data            */
  unsigned char data[128];        /* AT  Data            */
  unsigned char RSSI;             /*     Data            */
  unsigned int datalen;

  /* X  A5 A4 A3 A2 A1 A0 D8    D7 D6 D5 D4 D3 D2 D1 D0 */
  unsigned short IOmask;          /*                  IO */

  /* X  X  X  X  X  X  X  D8    D7 D6 D5 D4 D3 D2 D1 D0 */
  unsigned short IOdata;          /*                  IO */

  /* X  X  X  X  X  D  D  D     D  D  D  D  D  D  D  D  */
  unsigned short IOanalog[6];     /*                  IO */
};
typedef struct xbee_pkt xbee_pkt;
</PRE>


<P>
Most of these fields are fairly self explanatory, however some need attention brought to them
and others need explaining. I will touch on the most important here:
<DL COMPACT>
<DT><B>atCmd</B>

<DD>
This is the 2 character identifier for the AT command response you just recieved.
Of course if you didnt setup an AT connection, you should never see, or try to see data here.
<DT><B>Addr64</B> and <B>Addr16</B>

<DD>
These contain the address of the XBee that you recieved the packet from. You should really know this
because you setup the connection. However remote AT packets will contain both 16 and 64 bit
addresses.
<DT><B>data</B>

<DD>
This is the data you just recieved. Either the AT reponse, or the data from the remote XBee node.
<DT><B>datalen</B>

<DD>
Would you be suprised if I told you this is how much data there is?... Dont try and
<B>printf</B>()

the
<B>data</B>

as it isn't null terminated. Use this for processing instead.


</DL>
<A NAME="lbAE">&nbsp;</A>
<H2>AUTHOR</H2>

Attie Grande &lt;<A HREF="mailto:attie@attie.co.uk">attie@attie.co.uk</A>&gt; 
<A NAME="lbAF">&nbsp;</A>
<H2>SEE ALSO</H2>

<B><A HREF="../man3/libxbee.3.html">libxbee</A></B>(3),

<B><A HREF="../man3/xbee_getpacket.3.html">xbee_getpacket</A></B>(3)

<P>

<HR>
<A NAME="index">&nbsp;</A><H2>Index</H2>
<DL>
<DT><A HREF="#lbAB">NAME</A><DD>
<DT><A HREF="#lbAC">SYNOPSIS</A><DD>
<DT><A HREF="#lbAD">DESCRIPTION</A><DD>
<DT><A HREF="#lbAE">AUTHOR</A><DD>
<DT><A HREF="#lbAF">SEE ALSO</A><DD>
</DL>
<HR>
This document was created by
<A HREF="http://localhost/cgi-bin/man/man2html">man2html</A>,
using the manual pages.<BR>
Time: 00:08:23 GMT, March 30, 2011
</BODY>
</HTML>