![]() |
Dynamixel
2.9.5
RoadNarrows Robotics Dynamixel Package
|
Error and logging handling routines. More...
#include <stdio.h>
#include <stdlib.h>
#include <libgen.h>
#include <string.h>
#include <string>
#include "rnr/rnrconfig.h"
#include "rnr/log.h"
#include "rnr/new.h"
#include "rnr/units.h"
#include "Dynamixel/dxl/dxl.h"
#include "Dynamixel/Dynamixel.h"
#include "Dynamixel/DynaError.h"
#include "Dynamixel/DynaComm.h"
#include "DynaLibInternal.h"
Go to the source code of this file.
Functions | |
int | DynaMapDxlToEcode (int nDxlError) |
Map DXL library error code to Dynamixel error code. More... | |
const char * | DynaStrError (int ecode) |
Get the error string describing the Dynamixel error code. More... | |
void | DynaPrintBuf (FILE *fp, const char *sPreface, byte_t buf[], const char *sFmt, size_t uCount, size_t uNLFreq, uint_t uCol) |
Pretty print a byte buffer to opened file stream. More... | |
void | DynaLogServoAlarms (int nServoId, uint_t uAlarms) |
Log servo alarms. More... | |
void | DynaLogBuf (const char *sPreface, byte_t buf[], size_t uCount, const char *sFmt) |
Log integer data. More... | |
Variables | |
static const char * | DynaEcodeStrTbl [] |
Package Dynamixel Error Code String Table. More... | |
Error and logging handling routines.
Definition in file DynaError.cxx.
void DynaLogBuf | ( | const char * | sPreface, |
byte_t | buf[], | ||
size_t | uCount, | ||
const char * | sFmt | ||
) |
Log integer data.
Print diagnostic logging of the contents of a buffer of bytes.
sPreface | Buffer preface string. |
buf | Buffer contents to log. |
uCount | Number of entries to log. |
sFmt | Buffer entry format string. |
Definition at line 206 of file DynaError.cxx.
void DynaLogServoAlarms | ( | int | nServoId, |
uint_t | uAlarms | ||
) |
Log servo alarms.
nServoId | Servo id. |
uAlarms | Alarm bits fields. |
Definition at line 183 of file DynaError.cxx.
References DYNA_ALARM_NONE, and DynaComm::GetAlarmsString().
int DynaMapDxlToEcode | ( | int | nDxlError | ) |
Map DXL library error code to Dynamixel error code.
nDxlError | DXL error code. |
Definition at line 117 of file DynaError.cxx.
References DXL_COMM_RXCORRUPT, DXL_COMM_RXFAIL, DXL_COMM_RXTIMEOUT, DXL_COMM_TXERROR, DXL_COMM_TXFAIL, DYNA_ECODE_ECOMM, DYNA_ECODE_RX_BAD_PKT, DYNA_ECODE_RX_FAIL, DYNA_ECODE_RX_TIMEOUT, DYNA_ECODE_TX_ERROR, and DYNA_ECODE_TX_FAIL.
Referenced by newstr(), DynaCommSerial::Read16(), DynaCommSerial::Read8(), DynaCommSerial::Reset(), DynaCommSerial::SyncWrite(), DynaCommSerial::Write16(), and DynaCommSerial::Write8().
void DynaPrintBuf | ( | FILE * | fp, |
const char * | sPreface, | ||
byte_t | buf[], | ||
const char * | sFmt, | ||
size_t | uCount, | ||
size_t | uNLFreq, | ||
uint_t | uCol | ||
) |
Pretty print a byte buffer to opened file stream.
fp | File pointer. |
sPreface | Optional buffer preface string (set to NULL for no preface). |
buf | Buffer to print. |
sFmt | Buffer entry format string. |
uCount | Number of entries to print. |
uNLFreq | Newline frequency (set to 0 for no newlines). |
uCol | Column alignment number. |
Definition at line 155 of file DynaError.cxx.
const char* DynaStrError | ( | int | ecode | ) |
Get the error string describing the Dynamixel error code.
The absolute value of the error code is taken prior retrieving the string. An unknown or out-of-range error code will be mapped to DYNA_ECODE_BADEC.
ecode | Dynamixel error code. |
Definition at line 141 of file DynaError.cxx.
References DYNA_ECODE_BADEC, and DynaEcodeStrTbl.
Referenced by DynaShellCmdPlay::ControlToGoals(), DynaShell::Error(), DynaShellCmdPlay::PidSetPoint(), and DynaShellCmdPlay::SetRecordGoals().
|
static |
Package Dynamixel Error Code String Table.
Table is indexed by error codes (see Package Error Codes). Keep in sync.
Definition at line 82 of file DynaError.cxx.
Referenced by DynaStrError().