#include <motor_message.h>
Copyright (c) 2016, Ubiquity Robotics All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of ubiquity_motor nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition at line 37 of file motor_message.h.
Definition at line 45 of file motor_message.h.
Definition at line 52 of file motor_message.h.
MotorMessage::MotorMessage | ( | ) | [inline] |
Definition at line 41 of file motor_message.h.
MotorMessage::~MotorMessage | ( | ) | [inline] |
Definition at line 42 of file motor_message.h.
int MotorMessage::deserialize | ( | const std::vector< uint8_t > & | serialized | ) |
Definition at line 140 of file motor_message.cc.
uint8_t MotorMessage::generateChecksum | ( | const std::vector< uint8_t > & | data | ) | [static, private] |
Definition at line 199 of file motor_message.cc.
int32_t MotorMessage::getData | ( | ) | const |
Definition at line 118 of file motor_message.cc.
Definition at line 102 of file motor_message.cc.
Definition at line 90 of file motor_message.cc.
std::vector< uint8_t > MotorMessage::serialize | ( | ) | const |
Definition at line 126 of file motor_message.cc.
void MotorMessage::setData | ( | int32_t | data | ) |
Definition at line 110 of file motor_message.cc.
void MotorMessage::setRegister | ( | MotorMessage::Registers | reg | ) |
Definition at line 96 of file motor_message.cc.
void MotorMessage::setType | ( | MotorMessage::MessageTypes | type | ) |
Definition at line 84 of file motor_message.cc.
int MotorMessage::verifyRegister | ( | uint8_t | r | ) | [static, private] |
Definition at line 188 of file motor_message.cc.
int MotorMessage::verifyType | ( | uint8_t | t | ) | [static, private] |
Definition at line 177 of file motor_message.cc.
uint8_t MotorMessage::data[4] [private] |
Definition at line 125 of file motor_message.h.
const uint8_t MotorMessage::delimeter = 0x7E [static, private] |
Definition at line 127 of file motor_message.h.
const uint8_t MotorMessage::protocol_version = 0x02 [static, private] |
Definition at line 128 of file motor_message.h.
uint8_t MotorMessage::register_addr [private] |
Definition at line 124 of file motor_message.h.
uint8_t MotorMessage::type [private] |
Definition at line 123 of file motor_message.h.
uint8_t const MotorMessage::valid_registers [static, private] |
Definition at line 131 of file motor_message.h.
uint8_t const MotorMessage::valid_types [static, private] |
{ TYPE_READ, TYPE_WRITE, TYPE_RESPONSE }
Copyright (c) 2016, Ubiquity Robotics All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
Neither the name of ubiquity_motor nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Definition at line 130 of file motor_message.h.