Go to the source code of this file.
Defines | |
#define | KB_ERROR(f, e,...) kb_error( __FILE__ , __LINE__ , f , e , ##__VA_ARGS__ ) |
#define | KB_FATAL(f, e,...) kb_fatal( __FILE__ , __LINE__ , f , e , ##__VA_ARGS__ ) |
#define | KB_DEBUG(f, e, m,...) kb_debug( __FILE__ , __LINE__ , f , e , m , ##__VA_ARGS__ ) |
#define | KB_EXIT_ON_ERROR 200 |
#define | KB_ERROR_NOMEM 0 |
#define | KB_ERROR_TOOMANYARGS 1 |
#define | KB_ERROR_OUTOFRANGE 2 |
#define | KB_ERROR_INVAL 3 |
#define | KB_ERROR_UNKCMD 4 |
#define | KB_ERROR_INVALID 5 |
#define | KB_ERROR_SYMDEF 6 |
#define | KB_ERROR_UNKDEVCLASS 7 |
#define | KB_ERROR_DEVCLASSUSED 8 |
#define | KB_ERROR_INVNUM 9 |
#define | KB_ERROR_FILEOPEN 10 |
#define | KB_ERROR_NOBUSFOUND 11 |
#define | KB_ERROR_INVORDER 12 |
#define | KB_ERROR_EXCLACCESS 13 |
#define | KB_ERROR_DEVICEINUSE 14 |
#define | KB_ERROR_UNLINKDEV 15 |
#define | KB_ERROR_OPENBUS 16 |
#define | KB_ERROR_SCANBUS 17 |
#define | KB_ERROR_NODEVFOUND 18 |
#define | KB_ERROR_OPENDIR 19 |
#define | KB_ERROR_NODEVFOUNDSTR 20 |
#define | KB_ERROR_SYMNOTDEF 21 |
#define | KB_ERROR_NOSECTION 22 |
#define | KB_ERROR_CMDARGMIN 23 |
#define | KB_ERROR_CMDARGMAX 24 |
#define | KB_ERROR_UNKBUS 25 |
#define | KB_ERROR_NOBUSADDR 26 |
#define | KB_ERROR_NOMODBUS 27 |
#define | KB_ERROR_INVNAME 28 |
#define | KB_ERROR_NOINIT 29 |
#define | KB_ERROR_DUPLEX 30 |
#define | KB_ERROR_FRAGMENT 31 |
#define | KB_ERROR_FRAGEXP 32 |
#define | KB_ERROR_IPTR 33 |
#define | KB_ERROR_OPTR 34 |
#define | KB_ERROR_PTHREAD 35 |
#define | KB_ERROR_BADSOUND 36 |
#define | KB_ERROR_MMAP 37 |
#define | KB_ERROR_OPENLRF 38 |
#define | KB_ERROR_LRFDATA2BIG 39 |
#define | KB_ERROR_LRFNOSTX 40 |
#define | KB_ERROR_LRFNOETX 41 |
#define | KB_ERROR_LRFWRONGSTX 42 |
#define | KB_ERROR_LRFWRONGETX 43 |
#define | KB_ERROR_LRFNODATA 44 |
#define | KB_ERROR_LRFWRONGCRC 45 |
#define | KB_ERROR_LRFSENDDATA 46 |
#define | KB_ERROR_LRFNOCERT 47 |
#define | KB_ERROR_LRFCMDTX 48 |
#define | KB_ERROR_LRFDISTRX 49 |
#define | KB_ERROR_LRFDATARX 50 |
#define | KB_ERROR_KH3SZFMTERR 51 |
#define | KB_ERROR_KH3FRMSZERR 52 |
#define | KB_ERROR_KH3FRMSNDERR 53 |
#define | KB_ERROR_KH3KBINIT 54 |
#define | KB_WARN_CONFIG_FILE 0 |
#define | KB_WARN_OPENDIR 1 |
#define | KB_WARN_CONNECT 2 |
#define | KB_WARN_SOUNDIO 3 |
#define | KB_WARN_SOUNDSAMPLE 4 |
Typedefs | |
typedef void(* | kb_error_handler_t )(const char *, unsigned int, const char *, unsigned int, va_list) |
typedef void(* | kb_warning_handler_t )(unsigned int, va_list) |
Functions | |
void | kb_set_debug_level (unsigned int level) |
void | kb_set_error_handler (kb_error_handler_t handler) |
void | kb_vmsg (const char *msg, va_list argptr) |
void | kb_msg (const char *msg,...) |
int | kb_vdebug (const char *file, unsigned int line, const char *func, unsigned int level, const char *msg, va_list argptr) |
int | kb_debug (const char *file, unsigned int line, const char *func, unsigned int level, const char *msg,...) |
int | kb_verror (const char *file, unsigned int line, const char *func, unsigned int error, va_list argptr) |
int | kb_error (const char *file, unsigned int line, const char *func, unsigned int error,...) |
int | kb_vwarning (unsigned int error, va_list argptr) |
int | kb_warning (unsigned int error,...) |
void | kb_fatal (const char *file, unsigned int line, const char *func, unsigned int error,...) |
Variables | |
const char * | kb_errmsg [] |
const char * | kb_warnmsg [] |
unsigned int | kb_debug_level |
#define KB_DEBUG | ( | f, | |||
e, | |||||
m, | |||||
... | ) | kb_debug( __FILE__ , __LINE__ , f , e , m , ##__VA_ARGS__ ) |
Definition at line 23 of file kb_error.h.
Referenced by kb_lrf_AcquireCertifiedCode(), kb_lrf_CertifyLink(), kb_lrf_GetDataFromLRF(), kb_lrf_SendCommand(), kb_snd_doMmap(), kb_snd_enableFrag(), kb_snd_enableTrigger(), kb_snd_open(), kb_snd_openDevices(), and kb_snd_setSampleRate().
#define KB_ERROR | ( | f, | |||
e, | |||||
... | ) | kb_error( __FILE__ , __LINE__ , f , e , ##__VA_ARGS__ ) |
Definition at line 19 of file kb_error.h.
Referenced by kb_clk_init(), kb_find_command(), kb_gpio_cleanup(), kb_gpio_clear(), kb_gpio_dir(), kb_gpio_function(), kb_gpio_get(), kb_gpio_init(), kb_gpio_set(), kb_lrf_AcquireCertifiedCode(), kb_lrf_CertifyLink(), kb_lrf_FetchDistanceFromLRF(), kb_lrf_GetDataFromLRF(), kb_lrf_GetDistances(), kb_lrf_Init(), kb_lrf_OpenComPort(), kb_lrf_SendCommand(), kb_parse_command(), kb_pwm0_init(), kb_pwm1_init(), kb_pwm_activate(), kb_pwm_cleanup(), kb_pwm_config(), kb_pwm_desactivate(), kb_pwm_duty(), kb_pwm_period(), kb_snd_enableFrag(), kb_snd_getIPtr(), kb_snd_getOPtr(), kb_wav_play(), kbot_SetProcVCore(), kgripper_init(), kh3_getcommand(), kh3_init(), kh3_sendcommand(), knet_open(), ksock_add_command(), ksock_exec_command(), ksock_exec_command_pending(), and ksock_remove_command().
#define KB_ERROR_BADSOUND 36 |
#define KB_ERROR_CMDARGMAX 24 |
#define KB_ERROR_CMDARGMIN 23 |
#define KB_ERROR_DEVCLASSUSED 8 |
#define KB_ERROR_DEVICEINUSE 14 |
#define KB_ERROR_DUPLEX 30 |
#define KB_ERROR_EXCLACCESS 13 |
Definition at line 46 of file kb_error.h.
#define KB_ERROR_FILEOPEN 10 |
Definition at line 43 of file kb_error.h.
Referenced by kb_clk_init(), kb_gpio_init(), kb_parse_config_file(), kb_pwm0_init(), kb_pwm1_init(), kb_wav_play(), and knet_rs232_open().
#define KB_ERROR_FRAGEXP 32 |
#define KB_ERROR_FRAGMENT 31 |
#define KB_ERROR_INVAL 3 |
#define KB_ERROR_INVALID 5 |
Definition at line 38 of file kb_error.h.
Referenced by kb_gpio_clear(), kb_gpio_dir(), kb_gpio_function(), kb_gpio_get(), kb_gpio_set(), kb_is_valid_identifier(), kb_pwm_activate(), kb_pwm_config(), kb_pwm_desactivate(), kb_pwm_duty(), and kb_pwm_period().
#define KB_ERROR_INVNAME 28 |
#define KB_ERROR_INVNUM 9 |
#define KB_ERROR_INVORDER 12 |
Definition at line 45 of file kb_error.h.
#define KB_ERROR_IPTR 33 |
#define KB_ERROR_KH3FRMSNDERR 53 |
#define KB_ERROR_KH3FRMSZERR 52 |
#define KB_ERROR_KH3KBINIT 54 |
#define KB_ERROR_KH3SZFMTERR 51 |
#define KB_ERROR_LRFCMDTX 48 |
#define KB_ERROR_LRFDATA2BIG 39 |
#define KB_ERROR_LRFDATARX 50 |
#define KB_ERROR_LRFDISTRX 49 |
#define KB_ERROR_LRFNOCERT 47 |
Definition at line 80 of file kb_error.h.
Referenced by kb_lrf_AcquireCertifiedCode(), kb_lrf_CertifyLink(), and kb_lrf_GetDistances().
#define KB_ERROR_LRFNODATA 44 |
Definition at line 77 of file kb_error.h.
Referenced by kb_lrf_AcquireCertifiedCode(), kb_lrf_CertifyLink(), and kb_lrf_SendCommand().
#define KB_ERROR_LRFNOETX 41 |
#define KB_ERROR_LRFNOSTX 40 |
#define KB_ERROR_LRFSENDDATA 46 |
#define KB_ERROR_LRFWRONGCRC 45 |
Definition at line 78 of file kb_error.h.
#define KB_ERROR_LRFWRONGETX 43 |
Definition at line 76 of file kb_error.h.
#define KB_ERROR_LRFWRONGSTX 42 |
Definition at line 75 of file kb_error.h.
#define KB_ERROR_MMAP 37 |
Definition at line 70 of file kb_error.h.
Referenced by kb_clk_init(), kb_gpio_cleanup(), kb_gpio_init(), kb_pwm0_init(), kb_pwm1_init(), and kb_pwm_cleanup().
#define KB_ERROR_NOBUSADDR 26 |
#define KB_ERROR_NOBUSFOUND 11 |
#define KB_ERROR_NODEVFOUND 18 |
#define KB_ERROR_NODEVFOUNDSTR 20 |
#define KB_ERROR_NOINIT 29 |
Definition at line 62 of file kb_error.h.
Referenced by ksock_add_command(), ksock_exec_command(), ksock_exec_command_pending(), and ksock_remove_command().
#define KB_ERROR_NOMEM 0 |
#define KB_ERROR_NOMODBUS 27 |
#define KB_ERROR_NOSECTION 22 |
Definition at line 55 of file kb_error.h.
Referenced by kb_parse_alias(), kb_parse_device(), kb_parse_modbus(), kb_parse_modbusaddr(), and kb_parse_register().
#define KB_ERROR_OPENBUS 16 |
#define KB_ERROR_OPENDIR 19 |
Definition at line 52 of file kb_error.h.
#define KB_ERROR_OPENLRF 38 |
#define KB_ERROR_OPTR 34 |
#define KB_ERROR_OUTOFRANGE 2 |
#define KB_ERROR_PTHREAD 35 |
#define KB_ERROR_SCANBUS 17 |
#define KB_ERROR_SYMDEF 6 |
Definition at line 39 of file kb_error.h.
Referenced by kb_parse_alias(), kb_parse_device(), kb_parse_register(), and kb_parse_section().
#define KB_ERROR_SYMNOTDEF 21 |
Definition at line 54 of file kb_error.h.
#define KB_ERROR_TOOMANYARGS 1 |
#define KB_ERROR_UNKBUS 25 |
#define KB_ERROR_UNKCMD 4 |
Definition at line 37 of file kb_error.h.
Referenced by kb_find_command(), kb_parse_command(), and kb_parse_config_file().
#define KB_ERROR_UNKDEVCLASS 7 |
#define KB_ERROR_UNLINKDEV 15 |
#define KB_EXIT_ON_ERROR 200 |
#define KB_FATAL | ( | f, | |||
e, | |||||
... | ) | kb_fatal( __FILE__ , __LINE__ , f , e , ##__VA_ARGS__ ) |
Definition at line 21 of file kb_error.h.
Referenced by kb_alloc(), kb_realloc(), koa_net_init(), startlog(), and stoplog().
#define KB_WARN_CONFIG_FILE 0 |
#define KB_WARN_CONNECT 2 |
#define KB_WARN_OPENDIR 1 |
#define KB_WARN_SOUNDIO 3 |
#define KB_WARN_SOUNDSAMPLE 4 |
typedef void(* kb_error_handler_t)(const char *, unsigned int, const char *, unsigned int, va_list) |
Error Handle Type Definition
Definition at line 106 of file kb_error.h.
typedef void(* kb_warning_handler_t)(unsigned int, va_list) |
Warning Handle Type Definition
Definition at line 113 of file kb_error.h.
int kb_debug | ( | const char * | file, | |
unsigned int | line, | |||
const char * | func, | |||
unsigned int | mask, | |||
const char * | msg, | |||
... | ||||
) |
This function displays a debug message on standard output.
file | caller's source file (usually __FILE__) | |
line | caller's source line (usually __LINE__) | |
func | caller's name | |
mask | debug mask | |
msg | debug message | |
... | list of arguments |
Definition at line 213 of file kb_error.c.
References kb_vdebug().
int kb_error | ( | const char * | file, | |
unsigned int | line, | |||
const char * | func, | |||
unsigned int | error, | |||
... | ||||
) |
This function displays an error message on standard error
file | caller's source file (usually __FILE__) | |
line | caller's source line (usually __LINE__) | |
func | caller's name | |
error | number of the error | |
... | list of arguments |
Definition at line 280 of file kb_error.c.
References kb_verror().
Referenced by kb_is_valid_identifier(), kb_parse_alias(), kb_parse_command(), kb_parse_config_file(), kb_parse_device(), kb_parse_modbus(), kb_parse_modbusaddr(), kb_parse_register(), kb_parse_section(), knet_device_destroy(), knet_i2c_init(), knet_i2c_open(), knet_open(), and knet_rs232_open().
void kb_fatal | ( | const char * | file, | |
unsigned int | line, | |||
const char * | func, | |||
unsigned int | error, | |||
... | ||||
) |
This function displaya an error message on standard error and exit the application.
file | caller's source file (usually __FILE__) | |
line | caller's source line (usually __LINE__) | |
func | caller's name | |
error | number of the error | |
... | list of arguments |
Definition at line 357 of file kb_error.c.
References KB_EXIT_ON_ERROR, and kb_verror().
void kb_msg | ( | const char * | msg, | |
... | ||||
) |
This function displays a message on standard output
msg | message | |
... | list of arguments |
Definition at line 161 of file kb_error.c.
References kb_vmsg().
Referenced by kb_dump_symbol_table(), kb_init(), main(), print_device(), print_register(), and print_section().
void kb_set_debug_level | ( | unsigned int | level | ) |
This function changes the debug level
level | New debug level |
Definition at line 126 of file kb_error.c.
References kb_debug_level.
void kb_set_error_handler | ( | kb_error_handler_t | handler | ) |
This function sets a user error handler
handler | Pointer to the user error handler |
Definition at line 137 of file kb_error.c.
References kb_user_error_handler.
Referenced by kb_parse_config_file().
int kb_vdebug | ( | const char * | file, | |
unsigned int | line, | |||
const char * | func, | |||
unsigned int | mask, | |||
const char * | msg, | |||
va_list | argptr | |||
) |
This function displays a debug message on standard output.
file | caller's source file (usually __FILE__) | |
line | caller's source line (usually __LINE__) | |
func | caller's name | |
level | debug level | |
msg | debug message | |
argptr | list of arguments |
Definition at line 184 of file kb_error.c.
References kb_debug_mask.
Referenced by kb_debug().
int kb_verror | ( | const char * | file, | |
unsigned int | line, | |||
const char * | func, | |||
unsigned int | error, | |||
va_list | argptr | |||
) |
This function displays an error message on standard error.
file | caller's source file (usually __FILE__) | |
line | caller's source line (usually __LINE__) | |
func | caller's name | |
error | number of the error | |
argptr | list of arguments |
Definition at line 241 of file kb_error.c.
References kb_debug_level, kb_errmsg, and kb_user_error_handler.
Referenced by kb_config_error(), kb_error(), and kb_fatal().
void kb_vmsg | ( | const char * | msg, | |
va_list | argptr | |||
) |
This function displays a message on standard output
msg | message | |
argptr | list of arguments |
Definition at line 149 of file kb_error.c.
Referenced by kb_msg().
int kb_vwarning | ( | unsigned int | error, | |
va_list | argptr | |||
) |
This function displays a warning message on standard error.
error | number of the error | |
argptr | list of arguments |
Definition at line 304 of file kb_error.c.
References kb_debug_level, kb_user_warning_handler, and kb_warnmsg.
Referenced by kb_warning().
int kb_warning | ( | unsigned int | error, | |
... | ||||
) |
This function displays a warning message on standard error
error | number of the error | |
... | list of arguments |
Definition at line 335 of file kb_error.c.
References kb_vwarning().
Referenced by kb_config_init(), kb_wav_play(), and ksock_next_connection().
unsigned int kb_debug_level |
Definition at line 106 of file kb_error.c.
Referenced by kb_set_debug_level(), kb_verror(), and kb_vwarning().
const char* kb_errmsg[] |
Error Messages Error codes are defined in kb_error.h and are always returned as negative integers.
Definition at line 31 of file kb_error.c.
Referenced by kb_verror().
const char* kb_warnmsg[] |
Warning Messages Warning codes are defined in kb_error.h and are always returned as positive intergers.
Definition at line 95 of file kb_error.c.
Referenced by kb_vwarning().