copied everything over from 2012 and removed all of the actual robot code except the drivetrain stuff
git-svn-id: https://robotics.mvla.net/svn/frc971/2013/trunk/src@4078 f308d9b7-e957-4cde-b6ac-9a88185e7312
diff --git a/aos/crio/motor_server/SolenoidOutput.h b/aos/crio/motor_server/SolenoidOutput.h
new file mode 100644
index 0000000..6a6c838
--- /dev/null
+++ b/aos/crio/motor_server/SolenoidOutput.h
@@ -0,0 +1,38 @@
+#ifndef __CRIO_MOTOR_SERVER_SOLENOID_OUTPUT_H_
+#define __CRIO_MOTOR_SERVER_SOLENOID_OUTPUT_H_
+
+#include "aos/crio/motor_server/OutputDevice.h"
+
+namespace aos {
+
+class SolenoidOutput : public OutputDevice {
+ private:
+ Solenoid solenoid;
+ bool value;
+ public:
+ SolenoidOutput(uint32_t port) : OutputDevice(), solenoid(port), value(false) {
+ }
+ protected:
+ virtual bool ReadValue(ByteBuffer &buff) {
+ const int on = buff.read_char();
+ if (on != 0 && on != 1) {
+ if (on != -1) {
+ LOG(ERROR, "illegal solenoid value %d\n", on);
+ }
+ return false;
+ }
+ value = on;
+ return true;
+ }
+ virtual void SetValue() {
+ solenoid.Set(value);
+ }
+ virtual void NoValue() {
+ // leave the solenoid in its previous state
+ }
+};
+
+} // namespace aos
+
+#endif
+