00001 // 00002 // Created by tom on 09/05/16. 00003 // 00004 00005 #ifndef ROBOTICAN_HARDWARE_INTERFACE_IDEVICE_H 00006 #define ROBOTICAN_HARDWARE_INTERFACE_IDEVICE_H 00007 00008 #include <ros/ros.h> 00009 #include <robotican_hardware_interface/Protocol.h> 00010 #include <robotican_hardware_interface/TransportLayer.h> 00011 #include <robotican_hardware_interface/jointInfo.h> 00012 00013 namespace robotican_hardware { 00014 00015 class Device { 00016 private: 00017 byte _id; 00018 bool _ready; 00019 protected: 00020 ros::NodeHandle _nodeHandle; 00021 TransportLayer* _transportLayer; 00022 public: 00023 Device(byte id, TransportLayer *transportLayer); 00024 byte getId(); 00025 void setId(byte id); 00026 bool isReady(); 00027 void setReady(bool ready); 00028 virtual void deviceAck(const DeviceAck *ack); 00029 virtual void update(const DeviceMessage * deviceMessage)=0; 00030 virtual void write() =0; 00031 virtual void buildDevice() =0; 00032 }; 00033 } 00034 00035 #endif //ROBOTICAN_HARDWARE_INTERFACE_IDEVICE_H