Index: wireless.h
===================================================================
--- wireless.h	(revision 1344)
+++ wireless.h	(revision 1345)
@@ -1,4 +1,29 @@
 /**
+ * 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.
+ **/
+
+/**
  * @file wireless.h
  * @brief Contains definitions for the wireless library.
  *
@@ -6,12 +31,19 @@
  *
  * @author Brian Coltin, Colony Project, CMU Robotics Club
  **/
- 
+
+#ifndef WIRELESS_H
+#define WIRELESS_H
+
 //Note: If this is raised above 16, we will need to do
 //something about frame numbers for TX Status packets.
 /**
  * The maximum number of packet groups.
  **/
+//TODO: a PacketGroupHandler is at least 10 bytes (I don't know if function pointers are 2 bytes
+// or 4 bytes).  That means that in the c file, your array of packet groups is at least 160 bytes.
+// Normally that might be fine (the robot's avr chips have 4k SRAM), but austin's chip only has
+// 1k SRAM, so if this number can be reduced or if the size of the struct could be reduced, that would be a plus.
 #define WL_MAX_PACKET_GROUPS 16
 
 /**
@@ -20,12 +52,12 @@
  *
  * Contains functions and definitions for dealing with wireless functionality.<br><br>
  *
- * The wireless library provides a modular method for dealing with 
+ * 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. 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 
+ * 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.<br><br>
@@ -39,11 +71,14 @@
 
 /**
  * @struct PacketGroupHandler
- * A PacketGroupHandler represents a packet group, and is used to 
+ * A PacketGroupHandler represents a packet group, and is used to
  * register a packet group with the wireless library. It contains
  * handlers for various events which can occur related to a packet
  * group.
  **/
+//TODO: the order of member variables in this struct should be changed in case the compile packs the struct
+// In order to achieve the best packing, the variables should be listed in order of decreasing memory size.
+// Thus, pointers should be first, followed by int, followed by char.
 typedef struct
 {
 	/**
@@ -51,6 +86,8 @@
 	 * must be unique. The maximum number of packet groups
 	 * is defined by WL_MAX_PACKET_GROUPS.
 	 **/
+  //TODO: if this number must be less than or equal to WL_MAX_PACKET_GROUPS, don't you only need
+  // one byte for it and it can be made an unsigned char?
 	unsigned int groupCode;
 
 	/**
@@ -58,7 +95,7 @@
 	 * but in wl_do).
 	 **/
 	void (*timeout_handler) (void);
-	
+
 	/**
 	 * Called when a transmit status packet is received
 	 * from the XBee where the first four bits of the frame
@@ -69,7 +106,7 @@
 	 * we did not.
 	 **/
 	void (*handle_response) (int frame, int received);
-	
+
 	/**
 	 * Called when we receive a packet from this group.
 	 *
@@ -79,18 +116,17 @@
 	 * @param packet the packet received
 	 * @param length the length of the packet
 	 **/
-	void (*handle_receive) (char type, int source, unsigned char* packet,
-							int length);
-	
+	void (*handle_receive) (char type, int source, unsigned char* packet, int length);
+
 	/**
 	 * Called for any cleanup when the network is turned off.
 	 **/
 	void (*unregister) (void);
-	
+
 } PacketGroupHandler;
 
 /**@brief Initialize the wireless library **/
-void wl_init(void);
+int wl_init(void);
 /**@brief Uninitialize the wireless library **/
 void wl_terminate(void);
 /**@brief Perform wireless library functionality **/
@@ -101,28 +137,28 @@
 void wl_unregister_packet_group(PacketGroupHandler* h);
 
 /**@brief Send a packet to a specific robot in any PAN **/
-void wl_send_robot_to_robot_global_packet(char group, char type,
-		char* data, int len, int dest, char frame);
+int wl_send_robot_to_robot_global_packet(char group, char type, char* data, int len, int dest, char frame);
 /**@brief Send a packet to a specific robot in our PAN **/
-void wl_send_robot_to_robot_packet(char group, char type,
-		char* data, int len, int dest, char frame);
+int wl_send_robot_to_robot_packet(char group, char type, char* data, int len, int dest, char frame);
 /**@brief Send a packet to all robots **/
-void wl_send_global_packet(char group, char type,
-		char* data, int len, char frame);
+int wl_send_global_packet(char group, char type, char* data, int len, char frame);
 /**@brief Send a packet to all robots in our PAN **/
-void wl_send_pan_packet(char group, char type,
-		char* data, int len, char frame);
+void wl_send_pan_packet(char group, char type, char* data, int len, char frame);
 
 /**@brief Set the PAN we are using **/
-void wl_set_pan(int pan);
+int wl_set_pan(int pan);
 /**@brief Get the PAN we are using **/
 int wl_get_pan(void);
 /**@brief Set the channel we are using **/
-void wl_set_channel(int channel);
+int wl_set_channel(int channel);
 /**@brief Get the channel we are using **/
 int wl_get_channel(void);
 /**@brief Get the 16-bit address of the XBee module **/
-unsigned int wl_get_xbee_id(void);
+int wl_get_xbee_id(void);
+/**@brief Set the com port on a computer, undefined on the robot.**/
+void wl_set_com_port(char* port);
 
 /** @} **/ // end defgroup
 
+#endif
+
