00001 00035 #ifndef SENSOR_MATRIX_H 00036 #define SENSOR_MATRIX_H 00037 00038 00049 #define MAXIMUM_XBEE_ID 0x10 00050 #define READING_UNKNOWN 0xFF 00051 00057 //TODO: the order of member variables in this struct should be changed in case the compile packs the struct 00058 // In order to achieve the best packing, the variables should be listed in order of decreasing memory size. 00059 // Thus, pointers should be first, followed by int, followed by char. 00060 typedef struct 00061 { 00065 int numJoined; 00070 unsigned char joined[MAXIMUM_XBEE_ID]; 00071 00072 // on the bayboard, we don't include the matrix to save memory. 00073 #ifndef BAYBOARD 00074 00078 unsigned char matrix[MAXIMUM_XBEE_ID][MAXIMUM_XBEE_ID]; 00079 #endif 00080 } SensorMatrix; 00081 00083 void sensor_matrix_create(void); 00085 void sensor_matrix_set_reading(int observer, int robot, int reading); 00087 int sensor_matrix_get_reading(int observer, int robot); 00089 void sensor_matrix_set_in_ring(int robot, int in); 00091 int sensor_matrix_get_in_ring(int robot); 00093 int sensor_matrix_get_joined(void); 00095 int sensor_matrix_get_size(void); 00096 //end defgroup 00098 00099 00100 #endif 00101