AMU Library 3.0
C/C++ library for communicating with AMU (Aerospace Measurement Unit) devices
Loading...
Searching...
No Matches
error.h File Reference
#include "config.h"
#include "types.h"

Go to the source code of this file.

Macros

#define LIST_OF_ERRORS
#define X(def, val, str)
#define XE(def, val, str)

Enumerations

enum  {
  SCPI_ERROR_NO_ERROR = 0 ,
  SCPI_ERROR_INVALID_CHARACTER = -101 ,
  SCPI_ERROR_INVALID_SEPARATOR = -103 ,
  SCPI_ERROR_DATA_TYPE_ERROR = -104 ,
  SCPI_ERROR_PARAMETER_NOT_ALLOWED = -108 ,
  SCPI_ERROR_MISSING_PARAMETER = -109 ,
  SCPI_ERROR_UNDEFINED_HEADER = -113 ,
  SCPI_ERROR_INVALID_SUFFIX = -131 ,
  SCPI_ERROR_SUFFIX_NOT_ALLOWED = -138 ,
  SCPI_ERROR_INVALID_STRING_DATA = -151 ,
  SCPI_ERROR_EXPRESSION_PARSING_ERROR = -170 ,
  SCPI_ERROR_EXECUTION_ERROR = -200 ,
  SCPI_ERROR_ILLEGAL_PARAMETER_VALUE = -224 ,
  SCPI_ERROR_SYSTEM_ERROR = -310 ,
  SCPI_ERROR_QUEUE_OVERFLOW = -350 ,
  SCPI_ERROR_INPUT_BUFFER_OVERRUN = -363
}

Functions

void SCPI_ErrorInit (scpi_t *context, scpi_error_t *data, int16_t size)
void SCPI_ErrorClear (scpi_t *context)
scpi_bool_t SCPI_ErrorPop (scpi_t *context, scpi_error_t *error)
void SCPI_ErrorPushEx (scpi_t *context, int16_t err, char *info, size_t info_len)
void SCPI_ErrorPush (scpi_t *context, int16_t err)
int32_t SCPI_ErrorCount (scpi_t *context)
const char * SCPI_ErrorTranslate (int16_t err)

Macro Definition Documentation

◆ LIST_OF_ERRORS

#define LIST_OF_ERRORS

Definition at line 62 of file error.h.

◆ X

#define X ( def,
val,
str )
Value:
def = val,

Definition at line 187 of file error.h.

◆ XE

#define XE ( def,
val,
str )

Definition at line 191 of file error.h.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SCPI_ERROR_NO_ERROR 
SCPI_ERROR_INVALID_CHARACTER -101 
SCPI_ERROR_INVALID_SEPARATOR -103 
SCPI_ERROR_DATA_TYPE_ERROR -104 
SCPI_ERROR_PARAMETER_NOT_ALLOWED -108 
SCPI_ERROR_MISSING_PARAMETER -109 
SCPI_ERROR_UNDEFINED_HEADER -113 
SCPI_ERROR_INVALID_SUFFIX -131 
SCPI_ERROR_SUFFIX_NOT_ALLOWED -138 
SCPI_ERROR_INVALID_STRING_DATA -151 
SCPI_ERROR_EXPRESSION_PARSING_ERROR -170 
SCPI_ERROR_EXECUTION_ERROR -200 
SCPI_ERROR_ILLEGAL_PARAMETER_VALUE -224 
SCPI_ERROR_SYSTEM_ERROR -310 
SCPI_ERROR_QUEUE_OVERFLOW -350 
SCPI_ERROR_INPUT_BUFFER_OVERRUN -363 

Definition at line 186 of file error.h.

Function Documentation

◆ SCPI_ErrorClear()

void SCPI_ErrorClear ( scpi_t * context)

Clear error queue

Parameters
context- scpi context

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
context
Returns

Definition at line 123 of file error.c.

◆ SCPI_ErrorInit()

void SCPI_ErrorInit ( scpi_t * context,
scpi_error_t * data,
int16_t size )

Initialize error queue

Parameters
context- scpi context

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
err- error number
Returns
Error string representation

Definition at line 212 of file error.c.