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

Added API for library error code #139

Closed
wants to merge 2 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
5 changes: 5 additions & 0 deletions src/Dynamixel2Arduino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ unsigned long Dynamixel2Arduino::getPortBaud()
return p_dxl_port_->getBaud();
}

int Dynamixel2Arduino::getLibErrCode()
{
return getLastLibErrCode();
}

bool Dynamixel2Arduino::scan()
{
bool ret = true;
Expand Down
11 changes: 11 additions & 0 deletions src/Dynamixel2Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,17 @@ class Dynamixel2Arduino : public DYNAMIXEL::Master
* @return It returns serial baudrate of board port.
*/
unsigned long getPortBaud();

/**
* @brief API for getting library error code.
* @code
* const int DXL_DIR_PIN = 2;
* Dynamixel2Arduino dxl(Serial1, DXL_DIR_PIN);
* Serial.print(dxl.getLibErrCode());
* @endcode
* @return It returns error code from library.
*/
int getLibErrCode();

/**
* @brief It is API for To checking the communication connection status of DYNAMIXEL.
Expand Down