Wireless

Wireless definitions. More...

Data Structures

struct  PacketGroupHandler
struct  PacketGroupHandler

Functions

void wl_init (void)
 Initialize the wireless library.
void wl_terminate (void)
 Uninitialize the wireless library.
void wl_do (void)
 Perform wireless library functionality.
void wl_register_packet_group (PacketGroupHandler *h)
 Register a packet group with the wireless library.
void wl_unregister_packet_group (PacketGroupHandler *h)
 Unregister a packet group with the wireless library.
void wl_send_robot_to_robot_global_packet (char group, char type, char *data, int len, int dest, char frame)
 Send a packet to a specific robot in any PAN.
void wl_send_robot_to_robot_packet (char group, char type, char *data, int len, int dest, char frame)
 Send a packet to a specific robot in our PAN.
void wl_send_global_packet (char group, char type, char *data, int len, char frame)
 Send a packet to all robots.
void wl_send_pan_packet (char group, char type, char *data, int len, char frame)
 Send a packet to all robots in our PAN.
void wl_set_pan (int pan)
 Set the PAN we are using.
int wl_get_pan (void)
 Get the PAN we are using.
void wl_set_channel (int channel)
 Set the channel we are using.
int wl_get_channel (void)
 Get the channel we are using.
unsigned int wl_get_xbee_id (void)
 Get the 16-bit address of the XBee module.

Detailed Description

Wireless definitions.

Contains functions and definitions for dealing with wireless functionality.

The wireless library provides a modular method for dealing with wireless packets, by allowing packet groups to be registered. A packet group is a collection of packets which share a packet group code. Each packet in the group also has a type. A packet group code and type are sent with each packet. When a packet with a group code registered in the wireless library is received, the corresponding event handler is called. The event handler uses the packet type and other information stored in the packet to respond.

This architecture allows different wireless functionality to be defined and handled separately, making it simpler and more efficient to take advantage of the XBee's wireless functionality.


Function Documentation

void wl_do void   ) 
 

Perform wireless library functionality.

Performs wireless library functionality. This function must be called frequently for wireless to perform effectively. This function will call timeout handlers, as well as received packet and transmit status handlers.

int wl_get_channel void   ) 
 

Get the channel we are using.

Get the channel the XBee is part of.

Returns:
the channel the XBee is part of
See also:
wl_set_channel

int wl_get_pan void   ) 
 

Get the PAN we are using.

Get the PAN the XBee is currently part of.

Returns:
the PAN of the XBee
See also:
wl_set_pan

unsigned int wl_get_xbee_id void   ) 
 

Get the 16-bit address of the XBee module.

Returns the 16-bit address of the XBee module.

Returns:
the 16-bit address of the XBee module.

void wl_init void   ) 
 

Initialize the wireless library.

Initializes the wireless library. Must be called before any other function.

void wl_register_packet_group PacketGroupHandler h  ) 
 

Register a packet group with the wireless library.

Register a packet group with the wireless library. The event handlers in the packet group will be called whenever an event dealing with the packet group's group code occurs.

Parameters:
h the PacketGroupHandler to register

void wl_send_global_packet char  group,
char  type,
char *  data,
int  len,
char  frame
 

Send a packet to all robots.

Send a packet to all XBees in all PANs.

Parameters:
group the packet group
type the packet type
data the packet data
len the packet length in bytes
frame the frame number to see with a TX_STATUS response

void wl_send_pan_packet char  group,
char  type,
char *  data,
int  len,
char  frame
 

Send a packet to all robots in our PAN.

Send a packet to all XBee's in the same PAN.

Parameters:
group the packet group
type the packet type
data the packet data
len the packet length in bytes
frame the frame number to see with a TX_STATUS response

void wl_send_robot_to_robot_global_packet char  group,
char  type,
char *  data,
int  len,
int  dest,
char  frame
 

Send a packet to a specific robot in any PAN.

Send a packet to a specific XBee without specifying a PAN.

Parameters:
group the packet group
type the packet type
data the packet data
len the packet length in bytes
dest the 16-bit address of the XBee to send the packet to
frame the frame number to see with a TX_STATUS response

void wl_send_robot_to_robot_packet char  group,
char  type,
char *  data,
int  len,
int  dest,
char  frame
 

Send a packet to a specific robot in our PAN.

Send a packet to a specific XBee in the same PAN.

Parameters:
group the packet group
type the packet type
data the packet data
len the packet length in bytes
dest the 16-bit address of the XBee to send the packet to
frame the frame number to see with a TX_STATUS response

void wl_set_channel int  channel  ) 
 

Set the channel we are using.

Set the channel the XBee is listening to.

Parameters:
channel the new channel to join
See also:
wl_get_channel

void wl_set_pan int  pan  ) 
 

Set the PAN we are using.

Set the PAN for the XBee to join.

Parameters:
pan the new PAN
See also:
wl_get_pan

void wl_terminate void   ) 
 

Uninitialize the wireless library.

Uninitializes the wireless library.

void wl_unregister_packet_group PacketGroupHandler h  ) 
 

Unregister a packet group with the wireless library.

Unregister a packet group from the wireless library.

Parameters:
h the packet group to remove


Generated on Wed Oct 31 17:54:43 2007 for libwireless by  doxygen 1.4.6