Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for Mac OS X #51

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions c++/example/dxl_monitor/dxl_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that properties of Dynamixel MX and PRO are already set as %% MX - ID : 1 / Baudnum : 1 (Baudrate : 1000000) , PRO - ID : 1 / Baudnum : 3 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <getopt.h>
Expand All @@ -65,7 +65,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -82,7 +82,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down Expand Up @@ -332,7 +332,7 @@ int main(int argc, char *argv[])

char *dev_name = (char*)DEVICENAME;

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
// parameter parsing
while(1)
{
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol1.0/bulk_read/bulk_read.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// This example is tested with two Dynamixel MX-28, and an USB2DYNAMIXEL
// Be sure that Dynamixel MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000)
//
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -82,7 +82,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -99,7 +99,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol1.0/multi_port/multi_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that Dynamixel MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -77,7 +77,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -94,7 +94,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol1.0/ping/ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that Dynamixel MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand All @@ -61,7 +61,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -78,7 +78,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol1.0/read_write/read_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that DXL MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -76,7 +76,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -93,7 +93,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
8 changes: 4 additions & 4 deletions c++/example/protocol1.0/reset/reset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// This example resets all properties of Dynamixel to default values, such as %% ID : 1 / Baudnum : 34 (Baudrate : 57600)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -76,7 +76,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -93,7 +93,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down Expand Up @@ -124,7 +124,7 @@ int kbhit(void)

void msecSleep(int waitTime)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
usleep(waitTime * 1000);
#elif defined(_WIN32) || defined(_WIN64)
Sleep(waitTime);
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol1.0/sync_write/sync_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that Dynamixel MX properties are already set as %% ID : 1 / Baudnum : 1 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -81,7 +81,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -98,7 +98,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol2.0/broadcast_ping/broadcast_ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that Dynamixel PRO properties are already set as %% ID : 1 / Baudnum : 3 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand All @@ -62,7 +62,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -79,7 +79,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol2.0/bulk_read_write/bulk_read_write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that Dynamixel PRO properties are already set as %% ID : 1 and 2 / Baudnum : 3 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -83,7 +83,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -100,7 +100,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
8 changes: 4 additions & 4 deletions c++/example/protocol2.0/factory_reset/factory_reset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
// This example resets all properties of Dynamixel to default values, such as %% ID : 1 / Baudnum : 1 (Baudrate : 57600)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -74,7 +74,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -91,7 +91,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down Expand Up @@ -122,7 +122,7 @@ int kbhit(void)

void msecSleep(int waitTime)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
usleep(waitTime * 1000);
#elif defined(_WIN32) || defined(_WIN64)
Sleep(waitTime);
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol2.0/indirect_address/indirect_address.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that Dynamixel PRO properties are already set as %% ID : 1 / Baudnum : 3 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -93,7 +93,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -110,7 +110,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol2.0/multi_port/multi_port.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that Dynamixel PRO properties are already set as %% ID : 1 / Baudnum : 3 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand Down Expand Up @@ -77,7 +77,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -94,7 +94,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
6 changes: 3 additions & 3 deletions c++/example/protocol2.0/ping/ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
// Be sure that Dynamixel PRO properties are already set as %% ID : 1 / Baudnum : 3 (Baudrate : 1000000)
//

#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
#include <unistd.h>
#include <fcntl.h>
#include <termios.h>
Expand All @@ -62,7 +62,7 @@

int getch()
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
tcgetattr(STDIN_FILENO, &oldt);
Expand All @@ -79,7 +79,7 @@ int getch()

int kbhit(void)
{
#ifdef __linux__
#if defined(__linux__) || defined(__APPLE__)
struct termios oldt, newt;
int ch;
int oldf;
Expand Down
Loading