00001 // 00002 // Created by tom on 09/05/16. 00003 // 00004 00005 #include <robotican_hardware_interface/Device.h> 00006 namespace robotican_hardware { 00007 Device::Device(byte id, TransportLayer *transportLayer) { 00008 _id = id; 00009 _ready = false; 00010 _transportLayer = transportLayer; 00011 } 00012 00013 byte Device::getId() { 00014 return _id; 00015 } 00016 00017 void Device::setId(byte id) { 00018 _id = id; 00019 } 00020 00021 void Device::setReady(bool ready) { 00022 _ready = ready; 00023 } 00024 00025 bool Device::isReady() { 00026 return _ready; 00027 } 00028 00029 void Device::deviceAck(const DeviceAck *ack) { 00030 _ready = ack->ackId == _id; 00031 00032 } 00033 }