port_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 "port_handler.h"
21 #include "port_handler_linux.h"
22 #elif defined(__APPLE__)
23 #include "port_handler.h"
24 #include "port_handler_mac.h"
25 #elif defined(_WIN32) || defined(_WIN64)
26 #define WINDLLEXPORT
27 #include "port_handler.h"
28 #include "port_handler_windows.h"
29 #elif defined(ARDUINO) || defined(__OPENCR__) || defined(__OPENCM904__)
30 #include "../../include/dynamixel_sdk/port_handler.h"
31 #include "../../include/dynamixel_sdk/port_handler_arduino.h"
32 #endif
33 
34 using namespace dynamixel;
35 
37 {
38 #if defined(__linux__)
39  return (PortHandler *)(new PortHandlerLinux(port_name));
40 #elif defined(__APPLE__)
41  return (PortHandler *)(new PortHandlerMac(port_name));
42 #elif defined(_WIN32) || defined(_WIN64)
43  return (PortHandler *)(new PortHandlerWindows(port_name));
44 #elif defined(ARDUINO) || defined(__OPENCR__) || defined(__OPENCM904__)
45  return (PortHandler *)(new PortHandlerArduino(port_name));
46 #endif
47 }
static PortHandler * getPortHandler(const char *port_name)
The function that gets PortHandler class inheritance The function gets class inheritance (PortHandle...
The class for control port in Linux.
The class for control port in Arduino.
The class for port control that inherits PortHandlerLinux, PortHandlerWindows, PortHandlerMac, or PortHandlerArduino.
Definition: port_handler.h:56
The class for control port in Windows.
The class for control port in Mac OS.


dynamixel_sdk
Author(s): Gilbert , Zerom , Darby Lim , Leon
autogenerated on Fri Apr 16 2021 02:25:55