xbee.c File Reference

XBee Interface. More...

#include "xbee.h"
#include "wl_defs.h"
#include <fcntl.h>
#include <unistd.h>
#include <pthread.h>
#include <errno.h>
#include <termios.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

Defines

#define XBEE_FRAME_START   0x7E
#define XBEE_GET_PACKET_TIMEOUT   1000
#define XBEE_FRAME_STATUS   0x8A
#define XBEE_FRAME_AT_COMMAND   0x08
#define XBEE_FRAME_AT_COMMAND_RESPONSE   0x88
#define XBEE_FRAME_TX_REQUEST_64   0x00
#define XBEE_FRAME_TX_REQUEST_16   0x01
#define XBEE_FRAME_TX_STATUS   XBEE_TX_STATUS
#define XBEE_FRAME_RX_64   0x80
#define XBEE_FRAME_RX_16   XBEE_RX
#define XBEE_BUFFER_SIZE   128
#define PACKET_BUFFER_SIZE   108

Functions

int xbee_lib_init ()
 Initialize the XBee library.
void xbee_terminate ()
 Uninitialize the XBee library.
int xbee_send_packet (char *packet, int len, int dest, char options, char frame)
 Send a packet to the XBee.
int xbee_get_packet (unsigned char *dest)
 Get a packet from the XBee.
int xbee_set_pan_id (int id)
 Set the PAN ID for the XBee.
unsigned int xbee_get_pan_id ()
 Get the XBee's PAN ID.
int xbee_set_channel (int channel)
 Set the channel the XBee is currently using.
int xbee_get_channel (void)
 Get the channel the XBee is currently using.
unsigned int xbee_get_address ()
 Get the XBee's 16-bit address.
void xbee_set_com_port (char *port)
 Set the com port on a computer, undefined on the robot.

Variables

char arrival_buf [XBEE_BUFFER_SIZE]
volatile int buffer_last = 0
volatile int buffer_first = 0

Detailed Description

XBee Interface.

Copyright (c) 2007 Colony Project

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Implementation of low level communication with the XBee in API mode.

Author:
Brian Coltin, Colony Project, CMU Robotics Club

Generated on Wed Sep 23 12:51:07 2009 for libwireless by  doxygen 1.6.1