Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

# Platform/Aperios1.3.2/SystemCall.h

Go to the documentation of this file.

    00001 /**
    00002 * @file  Platform/Aperios1.3.2/SystemCall.h
    00003 * @brief static class for system calls from the non NDA classes
    00004 *
    00005 * @author <A href="mailto:brunn@sim.informatik.tu-darmstadt.de">Ronnie Brunn</A>
    00006 * @author <A href="mailto:risler@sim.informatik.tu-darmstadt.de">Max Risler</A>
    00007 */
    00008
    00009 #ifndef _SYSTEMCALL_H_
    00010 #define _SYSTEMCALL_H_
    00011
    00012 class RobotDesign
    00013 {
    00014 public:
    00015   /**
    00016   * The design of the robot.
    00017   */
    00018   enum Design
    00019   {
    00020     UNKNOWN,
    00021     ERS210,
    00022     ERS7
    00023   };
    00024
    00025   /**
    00026   * Returns name for robot design.
    00027   */
    00028   static const char* getRobotDesignName(Design design)
    00029   {
    00030     switch(design)
    00031     {
    00032       case ERS210: return "ers210";
    00033       case ERS7: return "ers7";
    00034       default: return "unknown";
    00035     }
    00036   }
    00037 };
    00038
    00039 /**
    00040 * static class for system calls
    00041 * @attention the implementation is system specific!
    00042 */
    00043 class SystemCall
    00044 {
    00045 public:
    00046   /** returns the current system time in milliseconds
    00047   */
    00048   static unsigned long getCurrentSystemTime ();
    00049
    00050   /** returns the time since aTime
    00051   */
    00052   static unsigned long getTimeSince (unsigned long aTime) {
    00053     return (getCurrentSystemTime() - aTime);
    00054   }
    00055
    00056   /** returns the amount of free memory
    00057     */
    00058   static unsigned long getFreeMem();
    00059
    00060   /** returns the amount of remaining battery power in percent
    00061     * or 100 if the robot is attached to powerline
    00062     */
    00063   static unsigned char getRemainingPower();
    00064
    00065   /** reboots the robot */
    00066   static void reboot();
    00067
    00068   /** shuts the robot down */
    00069   static void shutdown();
    00070
    00071   /** returns the robot's mac address */
    00072   static void getMacAddress(unsigned char address[6]);
    00073
    00074   /** returns the robot's design */
    00075   static RobotDesign::Design getRobotDesign();
    00076 };
    00077
    00078
    00079 #endif // _SYSTEMCALL_H_