common_kerl.h File Reference

Common definitions. More...

This graph shows which files directly or indirectly include this file:


Data Structures

struct  ClientQuery

Defines

#define DBUG(x, args...)
#define BENCH(x, args...)
#define ECASE(error, message)   case error : return message
#define FNLENGTH   20
#define IDLENGTH   50
#define DOMAINLENGTH   50
#define SUCCESS   0
#define GENERICFAIL   -1
#define BROKENCODE   -2
#define NAMEINUSE   -64
#define NOSUCHCLIENT   -65
#define NOTSTORED   -66
#define DEVICENOTINITIALISED   -67
#define NOSUCHDEVICE   -68
#define ERRORQUERYINGDEVICES   -69
#define INVALIDINDEX   -70
#define ERRORCONNECTING   -128
#define PLAYERFAIL   -127
#define NOSOCKET   -126
#define UNDEFINEDFUNCTION   -192
#define UNDEFINEDOPTION   -193
#define SUPPOSITION   0x1
#define SUPLASERS   0x2
#define SUPSONAR   0x4
#define SUPFIDUCIAL   0x8

Functions

char * errorToString (int errorno)

Detailed Description

Common definitions.

Author:
Thomas Lorentsen, Sten Gruener
This file contains common definitions and functions needed for kerl.

Error numbers start from severl ranges depending on where they were caused, this makes debugging easier as we can tell if it is a player problem, ei problem or a kerl problem.

Errors caused in kerl code start from -64 Errors returned from the player server start from -128 Errors returned from ei start from -192


Define Documentation

#define BENCH ( x,
args...   ) 

Issue a benchmark message is benchmarking is enabled.

#define BROKENCODE   -2

Broken code - see code for details

#define DBUG ( x,
args...   ) 

Issue a debug message if debugging is enabled.

#define DEVICENOTINITIALISED   -67

Error: Device not initialised

#define DOMAINLENGTH   50

Maximum length of the domainname of player

#define ECASE ( error,
message   )     case error : return message

Error case definition - on error return message.

#define ERRORCONNECTING   -128

Player error: Error connecting

#define ERRORQUERYINGDEVICES   -69

Error: Error querying devices

#define FNLENGTH   20

Maximum length of a funciton name in driver_kerl

#define GENERICFAIL   -1

Generic failure return value

#define IDLENGTH   50

Maximum length of the robot id

#define INVALIDINDEX   -70

Error: Invalid index specified

#define NAMEINUSE   -64

Error: Name in use

#define NOSOCKET   -126

Player error: No socket

#define NOSUCHCLIENT   -65

Error: No such client

#define NOSUCHDEVICE   -68

Error: No such device

#define NOTSTORED   -66

Error: Not stored

#define PLAYERFAIL   -127

Player error: Player failure

#define SUCCESS   0

Success return value

#define SUPFIDUCIAL   0x8

Supported device: Fiducial sensors

#define SUPLASERS   0x2

Supported device: Laser range finder

#define SUPPOSITION   0x1

Supported device: Position sensor

#define SUPSONAR   0x4

Supported device: Sonar range finder

#define UNDEFINEDFUNCTION   -192

Erlang interface error: Undefined function

#define UNDEFINEDOPTION   -193

Erlang interface error: Undefined option


Function Documentation

errorToString ( int  errorno  ) 

Parameters:
errorno the error value passed
Returns:
the string representation of the error Converts a error defined in common_kerl.h into a human readable form All spaces must be replaced with underscores to be passed as erlang atoms If the error is not found it should return the number as a string. You can also pass SUCCESS to get a string representation that will work in Erlang, just dont pass it back as an error {error, ok} otherwise it will seem rather silly
Parameters:
errorno the error value passed
Returns:
the string representation of the error Converts a error defined in common_kerl.h into a human readable form. All spaces must be replaced with underscores to be passed as erlang atoms. If the error is not found it will return undefined_error. This shouldn't happen though. You can also pass SUCCESS to get a string representation that will work in Erlang, just dont pass it back as an error {error, ok} otherwise it will seem rather silly


Generated on Thu Aug 13 23:20:22 2009 for KERL by  doxygen 1.5.8