Macros | Variables
sdhoptions.cpp File Reference

Implementation of a class to parse common SDH related command line options. More...

#include <getopt.h>
#include <assert.h>
#include <iostream>
#include <fstream>
#include "sdh/sdh.h"
#include "sdh/sdhlibrary_settings.h"
#include "sdh/release.h"
#include "sdh/dsa.h"
#include "sdhoptions.h"
Include dependency graph for sdhoptions.cpp:

Go to the source code of this file.

Macros

#define STRINGIFY(_s)   #_s
 helper macro for XSTRINGIFY, see there More...
 
#define XSTRINGIFY(_x)   STRINGIFY(_x)
 

Variables

static struct option sdhoptions_long_options []
 long command line options accepted by the cSDHOptions class More...
 
static char const * sdhoptions_short_options = "hvVd:l:p:T:b:cn:e:w:RFt:q:r:fSCM:"
 short command line options accepted by the cSDHOptions class More...
 
static char const * sdhusage_dsaadjust
 DSA (tactile sensor) adjustment options. More...
 
static char const * sdhusage_dsacom
 DSA (tactile sensor) communication options. More...
 
static char const * sdhusage_dsaother
 DSA (tactile sensor) other options. More...
 
static char const * sdhusage_general
 general options More...
 
static char const * sdhusage_sdhcom_cancommon
 Common CAN communication options. More...
 
static char const * sdhusage_sdhcom_common
 Common communication options. More...
 
static char const * sdhusage_sdhcom_esdcan
 ESD CAN communication options. More...
 
static char const * sdhusage_sdhcom_peakcan
 PEAK CAN communication options. More...
 
static char const * sdhusage_sdhcom_serial
 RS232 communication options. More...
 
static char const * sdhusage_sdhcom_tcp
 TCP communication options. More...
 
static char const * sdhusage_sdhother
 Other options. More...
 

Detailed Description

Implementation of a class to parse common SDH related command line options.

Author
Dirk Osswald
Date
2008-05-05

Copyright

Copyright (c) 2008 SCHUNK GmbH & Co. KG


Definition in file sdhoptions.cpp.

Macro Definition Documentation

◆ STRINGIFY

#define STRINGIFY (   _s)    #_s

helper macro for XSTRINGIFY, see there

Definition at line 72 of file sdhoptions.cpp.

◆ XSTRINGIFY

#define XSTRINGIFY (   _x)    STRINGIFY(_x)

macro for stringification of _x

allows to stringify the value of a macro:

#define foo 4
STRINGIFY( foo ) // yields "foo"
XSTRINGIFY( foo ) // yields "4"

Definition at line 69 of file sdhoptions.cpp.

Variable Documentation

◆ sdhoptions_long_options

struct option sdhoptions_long_options[]
static

long command line options accepted by the cSDHOptions class

Definition at line 312 of file sdhoptions.cpp.

◆ sdhoptions_short_options

char const* sdhoptions_short_options = "hvVd:l:p:T:b:cn:e:w:RFt:q:r:fSCM:"
static

short command line options accepted by the cSDHOptions class

Definition at line 310 of file sdhoptions.cpp.

◆ sdhusage_dsaadjust

char const* sdhusage_dsaadjust
static

DSA (tactile sensor) adjustment options.

Definition at line 264 of file sdhoptions.cpp.

◆ sdhusage_dsacom

char const* sdhusage_dsacom
static
Initial value:
=
"\nDSA options (tactile sensor):\n"
" -q PORT, --dsaport=PORT\n"
" use RS232 communication PORT to connect to to tactile sensor controller\n"
" of SDH instead of default 1='COM2'='/dev/ttyS1'.\n"
" \n"
" --dsa_tcp[=[IP_OR_HOSTNAME][:PORT]]\n"
" use TCP for communication with the tactile sensor controller.\n"
" The tactile sensor can be reached via TCP/IP on port PORT at\n"
" IP_OR_HOSTNAME, which can be a numeric IPv4 address or a hostname.\n"
" The default is \"" SDH_DEFAULT_TCP_ADR ":" XSTRINGIFY(DSA_DEFAULT_TCP_PORT) "\"\n"
" When using --tcp and --dsa_tcp then only the last set IP_OR_HOSTNAME\n"
" is used for both.\n"
" (This feature requires at least SDH firmware 0.0.3.2)\n"
" \n"
" --dsa_rs_device=DEVICE_FORMAT_STRING\n"
" Use DEVICE_FORMAT_STRING instead of the default \"/dev/ttyS%d\". Useful\n"
" e.g. to use USB to RS232 converters available via \"/dev/ttyUSB%d\". If \n"
" the DEVICE_FORMAT_STRING contains '%d' then the dsa PORT must also be \n"
" provided. If not then the DEVICE_FORMAT_STRING is the full device name.\n"
" \n"
" --no_rle\n"
" Do not use the RunLengthEncoding\n"
" \n"

DSA (tactile sensor) communication options.

Definition at line 212 of file sdhoptions.cpp.

◆ sdhusage_dsaother

char const* sdhusage_dsaother
static
Initial value:
=
" -r, --framerate=FRAMERATE\n"
" Framerate for acquiring full tactile sensor frames. Default value 0\n"
" means 'acquire a single frame only'. Any value > 0 will make the\n"
" DSACON32m controller in the SDH send data at the highest possible rate \n"
" (ca. 30 FPS (frames per second)).\n"
" \n"
" -f, --fullframe\n"
" Print acquired full frames numerically.\n"
" \n"
" -S, --sensorinfo\n"
" Print sensor info from DSA (texel dimensions, number of texels...).\n"
" \n"
" -C, --controllerinfo\n"
" Print controller info from DSA (version...).\n"
" \n"
" -M, --matrixinfo=MATRIX_INDEX\n"
" Print matrix info for matrix with index MATRIX_INDEX from DSA.\n"
" This includes the current setting for sensitivity and threshold\n"
" of the addressed matrix (if supported by the tactile sensor firmware)."
" This option can be used multiple times.\n"

DSA (tactile sensor) other options.

Definition at line 240 of file sdhoptions.cpp.

◆ sdhusage_general

char const* sdhusage_general
static
Initial value:
=
"\nGeneral options:\n"
" -h, --help\n"
" Show this help message and exit.\n"
" \n"
" -v, --version\n"
" Print the version (revision/release names) and dates of application,\n"
" library (and the attached SDH firmware, if found), then exit.\n"
" \n"
" -V, --version_check\n"
" Check the firmware release of the connected SDH if it is the one\n"
" recommended by this library. A message will be printed accordingly.\n"
" \n"
" -d LEVEL, --debug=LEVEL\n"
" Print debug messages of level LEVEL or lower while executing the program.\n"
" Level 0 (default): No messages, 1: application-level messages, \n"
" 2: cSDH-level messages, 3: cSDHSerial-level messages\n"
" \n"
" -l LOGFILE, --debuglog=LOGFILE\n"
" Redirect the printed debug messages to LOGFILE instead of default \n"
" standard error. If LOGFILE starts with '+' then the output will be \n"
" appended to the file (without the leading '+'), else the file will be\n"
" overwritten.\n"
" \n"

general options

Definition at line 80 of file sdhoptions.cpp.

◆ sdhusage_sdhcom_cancommon

char const* sdhusage_sdhcom_cancommon
static
Initial value:
=
""

Common CAN communication options.

Definition at line 166 of file sdhoptions.cpp.

◆ sdhusage_sdhcom_common

char const* sdhusage_sdhcom_common
static
Initial value:
=
" -T TIMEOUT, --timeout=TIMEOUT Timeout in seconds when waiting for data from\n"
" SDH. The default -1 means: wait forever.\n"
" \n"
" -b BAUDRATE, --baud=BAUDRATE\n"
" Use BAUDRATE in bit/s for communication. Default=115200 Bit/s for RS232\n"

Common communication options.

Definition at line 126 of file sdhoptions.cpp.

◆ sdhusage_sdhcom_esdcan

char const* sdhusage_sdhcom_esdcan
static
Initial value:
=
""

ESD CAN communication options.

Definition at line 138 of file sdhoptions.cpp.

◆ sdhusage_sdhcom_peakcan

char const* sdhusage_sdhcom_peakcan
static
Initial value:
=
""

PEAK CAN communication options.

Definition at line 151 of file sdhoptions.cpp.

◆ sdhusage_sdhcom_serial

char const* sdhusage_sdhcom_serial
static
Initial value:
=
"\nCommunication options:\n"
" -p PORT, --port=PORT, --sdhport=PORT\n"
" Use RS232 communication PORT to connect to the SDH instead of the default\n"
" 0='COM1'='/dev/ttyS0'.\n"
" \n"
" --sdh_rs_device=DEVICE_FORMAT_STRING\n"
" Use DEVICE_FORMAT_STRING instead of the default \"/dev/ttyS%d\". Useful\n"
" e.g. to use USB to RS232 converters available via \"/dev/ttyUSB%d\". \n"
" If the DEVICE_FORMAT_STRING contains '%d' then the PORT must also be \n"
" provided. If not then the DEVICE_FORMAT_STRING is the full device name. \n"
" \n"

RS232 communication options.

Definition at line 109 of file sdhoptions.cpp.

◆ sdhusage_sdhcom_tcp

char const* sdhusage_sdhcom_tcp
static
Initial value:
=
" --tcp[=[IP_OR_HOSTNAME][:PORT]]\n"
" Use TCP for communication with the SDH. The SDH can be reached via\n"
" TCP/IP on port PORT at IP_OR_HOSTNAME, which can be a numeric IPv4\n"
" address or a hostname. The default is \"" SDH_DEFAULT_TCP_ADR ":" XSTRINGIFY(SDH_DEFAULT_TCP_PORT) "\"\n"
" When using --tcp and --dsa_tcp then only the last set IP_OR_HOSTNAME\n"
" is used for both.\n"
" (This feature requires at least SDH firmware 0.0.3.1)\n"
" \n"

TCP communication options.

Definition at line 180 of file sdhoptions.cpp.

◆ sdhusage_sdhother

char const* sdhusage_sdhother
static
Initial value:
=
"\nOther options:\n"
" -R, --radians\n"
" Use radians and radians per second for angles and angular velocities\n"
" instead of default degrees and degrees per second.\n"
" (The demo programs provided might not evaluate this parameter\n"
" correctly. Thus they might fail if this parameter is used.)\n"
" \n"
" -F, --fahrenheit\n"
" Use degrees fahrenheit to report temperatures instead of default degrees\n"
" celsius.\n"
" \n"
" -t PERIOD, --period=PERIOD\n"
" For periodic commands only: Time period of measurements in seconds. The\n"
" default of '0' means: report once only. If set then the time since start\n"
" of measurement is printed at the beginning of every line.\n"
" \n"

Other options.

Definition at line 193 of file sdhoptions.cpp.

SDH_DEFAULT_TCP_ADR
#define SDH_DEFAULT_TCP_ADR
Definition: sdhoptions.h:66
XSTRINGIFY
#define XSTRINGIFY(_x)
Definition: sdhoptions.cpp:69
STRINGIFY
#define STRINGIFY(_s)
helper macro for XSTRINGIFY, see there
Definition: sdhoptions.cpp:72
SDH_DEFAULT_TCP_PORT
#define SDH_DEFAULT_TCP_PORT
Definition: sdhoptions.h:67
DSA_DEFAULT_TCP_PORT
#define DSA_DEFAULT_TCP_PORT
Definition: sdhoptions.h:68


sdhlibrary_cpp
Author(s): Dirk Osswald
autogenerated on Wed Mar 2 2022 01:00:59