#include <stdint.h>
#include "parser.h"
#include "ieee488.h"
#include "error.h"
#include "fifo_private.h"
#include "constants.h"
Go to the source code of this file.
|
| void | SCPI_ErrorInit (scpi_t *context, scpi_error_t *data, int16_t size) |
| static void | SCPI_ErrorEmitEmpty (scpi_t *context) |
| static void | SCPI_ErrorEmit (scpi_t *context, int16_t err) |
| void | SCPI_ErrorClear (scpi_t *context) |
| scpi_bool_t | SCPI_ErrorPop (scpi_t *context, scpi_error_t *error) |
| int32_t | SCPI_ErrorCount (scpi_t *context) |
| static scpi_bool_t | SCPI_ErrorAddInternal (scpi_t *context, int16_t err, char *info, size_t info_len) |
| void | SCPI_ErrorPushEx (scpi_t *context, int16_t err, char *info, size_t info_len) |
| void | SCPI_ErrorPush (scpi_t *context, int16_t err) |
| const char * | SCPI_ErrorTranslate (int16_t err) |
◆ ERROR_DEFS_N
◆ SCPI_ERROR_SETVAL
| #define SCPI_ERROR_SETVAL |
( |
| e, |
|
|
| c, |
|
|
| i ) |
Value:do { (e)->error_code = (c); (void)(i);} while(0)
Definition at line 48 of file error.c.
| #define X |
( |
| def, |
|
|
| val, |
|
|
| str ) |
◆ XE
| #define XE |
( |
| def, |
|
|
| val, |
|
|
| str ) |
◆ SCPI_ErrorAddInternal()
| scpi_bool_t SCPI_ErrorAddInternal |
( |
scpi_t * | context, |
|
|
int16_t | err, |
|
|
char * | info, |
|
|
size_t | info_len ) |
|
static |
◆ SCPI_ErrorClear()
| void SCPI_ErrorClear |
( |
scpi_t * | context | ) |
|
Clear error queue
- Parameters
-
Definition at line 90 of file error.c.
◆ SCPI_ErrorCount()
| int32_t SCPI_ErrorCount |
( |
scpi_t * | context | ) |
|
Return number of errors/events in the queue
- Parameters
-
- Returns
Definition at line 123 of file error.c.
◆ SCPI_ErrorEmit()
| void SCPI_ErrorEmit |
( |
scpi_t * | context, |
|
|
int16_t | err ) |
|
static |
Emit error
- Parameters
-
| context | scpi context |
| err | Error to emit |
Definition at line 78 of file error.c.
◆ SCPI_ErrorEmitEmpty()
| void SCPI_ErrorEmitEmpty |
( |
scpi_t * | context | ) |
|
|
static |
Emit no error
- Parameters
-
Definition at line 63 of file error.c.
◆ SCPI_ErrorInit()
| void SCPI_ErrorInit |
( |
scpi_t * | context, |
|
|
scpi_error_t * | data, |
|
|
int16_t | size ) |
Initialize error queue
- Parameters
-
Definition at line 55 of file error.c.
◆ SCPI_ErrorPop()
| scpi_bool_t SCPI_ErrorPop |
( |
scpi_t * | context, |
|
|
scpi_error_t * | error ) |
Pop error from queue
- Parameters
-
| context | - scpi context |
| error | |
- Returns
Definition at line 108 of file error.c.
◆ SCPI_ErrorPush()
| void SCPI_ErrorPush |
( |
scpi_t * | context, |
|
|
int16_t | err ) |
Push error to queue
- Parameters
-
| context | - scpi context |
| err | - error number |
Definition at line 202 of file error.c.
◆ SCPI_ErrorPushEx()
| void SCPI_ErrorPushEx |
( |
scpi_t * | context, |
|
|
int16_t | err, |
|
|
char * | info, |
|
|
size_t | info_len ) |
Push error to queue
- Parameters
-
| context | |
| err | - error number |
| info | - additional text information or NULL for no text |
| info_len | - length of text or 0 for automatic length |
Definition at line 173 of file error.c.
◆ SCPI_ErrorTranslate()
| const char * SCPI_ErrorTranslate |
( |
int16_t | err | ) |
|
Translate error number to string
- Parameters
-
- Returns
- Error string representation
Definition at line 212 of file error.c.
◆ errs
Initial value:= {
{-100, -199, 0x20 },
{-200, -299, 0x10 },
{-300, -399, 0x08 },
{ 1, 32767, 0x08 },
{-400, -499, 0x04 },
{-500, -599, 0x80 },
{-600, -699, 0x40 },
{-700, -799, 0x02 },
{-800, -899, 0x01 },
}
Definition at line 154 of file error.c.