]> git.tdb.fi Git - r2c2.git/blobdiff - source/libr2c2/arducontrol.h
React to overcurrent events
[r2c2.git] / source / libr2c2 / arducontrol.h
index 8560a13b969d21257c7e8dfab3aa611113d16682..8d27a2f572d74e561acdbc0266dc20561a777f8c 100644 (file)
@@ -219,6 +219,7 @@ private:
        public:
                void push(const T &);
                bool pop(T &);
+               bool empty() const;
        };
 
        class Task
@@ -356,8 +357,9 @@ private:
                virtual void main();
                void init_baud_rate();
                bool get_work(PendingCommand &);
-               unsigned do_command(const PendingCommand &);
+               unsigned do_command(const PendingCommand &, const Msp::Time::TimeDelta &);
                unsigned process_reply(const char *, unsigned);
+               void set_power(bool);
        };
 
        typedef std::map<unsigned, Locomotive> LocomotiveMap;
@@ -383,7 +385,7 @@ private:
 
        SensorMap sensors;
 
-       Msp::Mutex mutex;
+       Msp::Time::TimeDelta command_timeout;
        Queue<PendingCommand> command_queue;
        Queue<Tag> completed_commands;
        RefreshTask refresh;