dynamixel protocol engine
Fork of Dynamixel by
Diff: DynamixelBus.cpp
- Revision:
- 4:fe2a6b66cb85
- Parent:
- 3:37aa8024931e
--- a/DynamixelBus.cpp Tue Jan 19 19:53:15 2016 +0000
+++ b/DynamixelBus.cpp Sat Jan 23 00:08:13 2016 +0000
@@ -1,11 +1,24 @@
-/*
-Copyright (c) 2015 Jonathan Pickett (& Schakra, & Microsoft). Some appropriate open source license.
-*/
-
+/* Copyright (C) 2016 Schakra Inc, MIT License
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of this software
+ * and associated documentation files (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge, publish, distribute,
+ * sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is
+ * furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all copies or
+ * substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
+ * BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+
#include <mbed.h>
#include "DynamixelBus.h"
-/*****/
DynamixelBus::DynamixelBus( PinName txUartPin, PinName rxUartPin, PinName txSelectPin, PinName rxSelectPin, int baud )
: _uart( txUartPin, rxUartPin), _txSelect(txSelectPin, 0), _rxSelect(rxSelectPin, 0) {
@@ -15,56 +28,48 @@
_replyDelay = .0012;
}
-/*****/
StatusCode DynamixelBus::Ping( ServoId id )
{
return send_ping( id );
}
-/*****/
StatusCode DynamixelBus::Read( ServoId id, unsigned char controlTableStart, unsigned char bytesToRead, CommBuffer& data )
{
return send_read( id, controlTableStart, bytesToRead, data );
}
-/*****/
StatusCode DynamixelBus::Write( ServoId id, unsigned char controlTableStart, const CommBuffer& dataToWrite )
{
return send_write( id, controlTableStart, dataToWrite );
}
-/*****/
StatusCode DynamixelBus::WriteAction( ServoId id, unsigned char start, const CommBuffer& dataToWrite )
{
return 0;
}
-/*****/
void DynamixelBus::TriggerAction( ServoId id )
{
return;
}
-/*****/
StatusCode DynamixelBus::HardReset( ServoId id )
{
return 0;
}
-/*****/
StatusCode DynamixelBus::SyncWrite( unsigned char controlTableStart, unsigned char bytesToWrite, vector<SyncIdDataPair>& data )
{
return 0;
}
-/*****/
unsigned char DynamixelBus::CalculateTxPacketChecksum( CommBuffer& packet )
{
@@ -82,7 +87,6 @@
return (~sum & 0xFF); // AX-12 reference manual p. 10, Section 3-2
}
-/*****/
// pings a servo at a specified ID
//
@@ -159,7 +163,6 @@
}
}
-/*****/
StatusCode DynamixelBus::send_read( ServoId id, unsigned char controlTableStart, unsigned char bytesToRead, CommBuffer& data )
{
@@ -234,7 +237,6 @@
}
}
-/*****/
StatusCode DynamixelBus::send_write( ServoId id, unsigned char controlTableStart, const CommBuffer& dataToWrite )
{
