src
dynamixel_sdk
packet_handler.cpp
Go to the documentation of this file.
1
/*******************************************************************************
2
* Copyright 2017 ROBOTIS CO., LTD.
3
*
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
* you may not use this file except in compliance with the License.
6
* You may obtain a copy of the License at
7
*
8
* http://www.apache.org/licenses/LICENSE-2.0
9
*
10
* Unless required by applicable law or agreed to in writing, software
11
* distributed under the License is distributed on an "AS IS" BASIS,
12
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
* See the License for the specific language governing permissions and
14
* limitations under the License.
15
*******************************************************************************/
16
17
/* Author: zerom, Ryu Woon Jung (Leon) */
18
19
#if defined(__linux__)
20
#include "
packet_handler.h
"
21
#include "
protocol1_packet_handler.h
"
22
#include "
protocol2_packet_handler.h
"
23
#elif defined(__APPLE__)
24
#include "
packet_handler.h
"
25
#include "
protocol1_packet_handler.h
"
26
#include "
protocol2_packet_handler.h
"
27
#elif defined(_WIN32) || defined(_WIN64)
28
#define WINDLLEXPORT
29
#include "
packet_handler.h
"
30
#include "
protocol1_packet_handler.h
"
31
#include "
protocol2_packet_handler.h
"
32
#elif defined(ARDUINO) || defined(__OPENCR__) || defined(__OPENCM904__)
33
#include "../../include/dynamixel_sdk/packet_handler.h"
34
#include "../../include/dynamixel_sdk/protocol1_packet_handler.h"
35
#include "../../include/dynamixel_sdk/protocol2_packet_handler.h"
36
#endif
37
38
using namespace
dynamixel
;
39
40
PacketHandler
*
PacketHandler::getPacketHandler
(
float
protocol_version)
41
{
42
if
(protocol_version == 1.0)
43
{
44
return
(
PacketHandler
*)(
Protocol1PacketHandler::getInstance
());
45
}
46
else
if
(protocol_version == 2.0)
47
{
48
return
(
PacketHandler
*)(
Protocol2PacketHandler::getInstance
());
49
}
50
51
return
(
PacketHandler
*)(
Protocol2PacketHandler::getInstance
());
52
}
protocol1_packet_handler.h
protocol2_packet_handler.h
dynamixel
Definition:
group_bulk_read.h:31
dynamixel::PacketHandler::getPacketHandler
static PacketHandler * getPacketHandler(float protocol_version=2.0)
The function that returns PacketHandler instance.
Definition:
packet_handler.cpp:40
dynamixel::Protocol1PacketHandler::getInstance
static Protocol1PacketHandler * getInstance()
The function that returns Protocol1PacketHandler instance.
Definition:
protocol1_packet_handler.h:46
dynamixel::Protocol2PacketHandler::getInstance
static Protocol2PacketHandler * getInstance()
The function that returns Protocol2PacketHandler instance.
Definition:
protocol2_packet_handler.h:50
packet_handler.h
dynamixel::PacketHandler
The class that inherits Protocol1PacketHandler class or Protocol2PacketHandler class.
Definition:
packet_handler.h:82
dynamixel_sdk
Author(s): Gilbert
, Zerom
, Darby Lim
, Leon
autogenerated on Wed Mar 2 2022 00:13:50