|
|
/home/brennan/n-sim/OrbisQuartus/shared/sensor_node.hGo to the documentation of this file.00001 00014 /* 00015 * Copyright 2007. Los Alamos National Security, LLC. This material 00016 * was produced under U.S. Government contract DE-AC52-06NA25396 for 00017 * Los Alamos National Laboratory (LANL), which is operated by Los 00018 * Alamos National Security, LLC, for the Department of Energy. The 00019 * U.S. Government has rights to use, reproduce, and distribute this 00020 * software. NEITHER THE GOVERNMENT NOR LOS ALAMOS NATIONAL SECURITY, 00021 * LLC, MAKES ANY WARRANTY, EXPRESS OR IMPLIED, OR ASSUMES ANY LEGAL 00022 * LIABILITY FOR THE USE OF THIS SOFTWARE. If software is modified to 00023 * produce derivative works, such modified software should be clearly 00024 * marked, so as not to confuse it with the version available from LANL. 00025 * 00026 * Additionally, this program is free software; you can redistribute 00027 * it and/or modify it under the terms of the GNU General Public 00028 * License as published by the Free Software Foundation; version 2 of 00029 * the License. Accordingly, this program is distributed in the hope 00030 * it will be useful, but WITHOUT ANY WARRANTY; without even the 00031 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00032 * PURPOSE. See the GNU General Public License for more details. 00033 */ 00034 00035 00036 #ifndef _SENSOR_NODE_H_ 00037 #define _SENSOR_NODE_H_ 00038 00039 #include "avl.h" 00040 #include "coordinates.h" 00041 #include "environ_object.h" 00042 00043 00044 #ifndef PATH_MAX 00045 #define PATH_MAX 4096 00046 #endif 00047 00048 #define LINUX 11 00049 #define EMULATED 22 00050 00051 00052 struct Node_mobility { 00053 int degrees; 00054 long cmps; 00055 }; 00056 00057 00058 struct Node_block_dev { 00059 unsigned int size_MB; 00060 char image_path[PATH_MAX]; 00061 }; 00062 00063 00064 struct Node_powersource { 00065 int mAH; 00066 }; 00067 00068 00069 struct Node_radio { 00070 char protocol[MAX_NAME]; 00071 long bits_per_ms; 00072 }; 00073 00074 00075 class Battery_sensor; 00076 class GPS_sensor; 00077 00078 class Sensor_node : public Environ_object { 00079 unsigned int thread_id; 00080 00081 unsigned short moved; 00082 Node_mobility mobility; 00083 00084 unsigned int processor_MHz; 00085 unsigned int memory_MB; 00086 unsigned int os_type; 00087 Node_radio radio; 00088 Node_block_dev blkdev; 00089 Node_powersource powersource; 00090 char console_log_path[PATH_MAX]; 00091 00092 friend class Battery_sensor; 00093 friend class GPS_sensor; 00094 00095 public: 00096 AVL_tree<unsigned long> sensors; 00097 00098 Sensor_node(unsigned long); 00099 ~Sensor_node(); 00100 00101 void move() { moved = 1; }; 00102 unsigned short is_moved() { return moved; }; 00103 00104 int launch(); 00105 int pause(); 00106 int unpause(); 00107 int save(); 00108 int restore(); 00109 }; 00110 00111 00112 #endif // _SENSOR_NODE_H_ |