XBEE_PKT

Section: Linux Programmer's Manual (3)
Updated: 2009-11-01
Index Return to Main Contents
 

NAME

xbee_pkt  

SYNOPSIS

#include <xbee.h>  

DESCRIPTION

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

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;

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:

atCmd
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.
Addr64 and Addr16
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.
data
This is the data you just recieved. Either the AT reponse, or the data from the remote XBee node.
datalen
Would you be suprised if I told you this is how much data there is?... Dont try and printf() the data as it isn't null terminated. Use this for processing instead.
 

AUTHOR

Attie Grande <attie@attie.co.uk>  

SEE ALSO

libxbee(3), xbee_getpacket(3)


 

Index

NAME
SYNOPSIS
DESCRIPTION
AUTHOR
SEE ALSO

This document was created by man2html, using the manual pages.
Time: 00:08:23 GMT, March 30, 2011