QTools  6.9.4
Collection of Host-Based Tools
qspy.h File Reference

Host API. More...

Go to the source code of this file.

Classes

struct  QSpyRecord
 
struct  QSpyConfig
 
struct  QSPY_LastOutput
 

Macros

#define QSPY_VER   "6.9.4"
 
#define QS_LINE_OFFSET   8
 
#define SNPRINTF_LINE(format_, ...)
 
#define SNPRINTF_APPEND(format_, ...)
 
#define QSPY_line   (&QSPY_output.buf[QS_LINE_OFFSET])
 

Typedefs

typedef uint64_t KeyType
 
typedef uint32_t SigType
 
typedef uint64_t ObjType
 
typedef int(* QSPY_CustParseFun) (QSpyRecord *const me)
 
typedef void(* QSPY_resetFun) (void)
 

Enumerations

enum  QSpyStatus { QSPY_ERROR , QSPY_SUCCESS }
 
enum  QSpyCommands {
  QSPY_ATTACH = 128 , QSPY_DETACH , QSPY_SAVE_DICT , QSPY_SCREEN_OUT ,
  QSPY_BIN_OUT , QSPY_MATLAB_OUT , QSPY_SEQUENCE_OUT , QSPY_SEND_EVENT ,
  QSPY_SEND_AO_FILTER , QSPY_SEND_CURR_OBJ , QSPY_SEND_COMMAND , QSPY_SEND_TEST_PROBE
}
 
enum  {
  QS_RECORD_SIZE_MAX = 512 , QS_LINE_LEN_MAX = 1000 , QS_FNAME_LEN_MAX = 256 , QS_SEQ_LIST_LEN_MAX = 300 ,
  QS_DNAME_LEN_MAX = 64
}
 
enum  QSPY_LastOutputType { REG_OUT , INF_OUT , ERR_OUT }
 

Functions

void QSpyRecord_init (QSpyRecord *const me, uint8_t const *start, size_t tot_len)
 
QSpyStatus QSpyRecord_OK (QSpyRecord *const me)
 
uint32_t QSpyRecord_getUint32 (QSpyRecord *const me, uint8_t size)
 
int32_t QSpyRecord_getInt32 (QSpyRecord *const me, uint8_t size)
 
uint64_t QSpyRecord_getUint64 (QSpyRecord *const me, uint8_t size)
 
int64_t QSpyRecord_getInt64 (QSpyRecord *const me, uint8_t size)
 
char const * QSpyRecord_getStr (QSpyRecord *const me)
 
uint8_t const * QSpyRecord_getMem (QSpyRecord *const me, uint8_t size, uint32_t *pNum)
 
void QSPY_config (QSpyConfig const *config, void *matFile, void *seqFile, char const *seqList, QSPY_CustParseFun custParseFun)
 
QSpyConfig const * QSPY_getConfig (void)
 
void QSPY_configTxReset (QSPY_resetFun txResetFun)
 
void QSPY_configMatFile (void *matFile)
 
void QSPY_configSeqFile (void *seqFile)
 
void QSPY_reset (void)
 
void QSPY_parse (uint8_t const *buf, uint32_t nBytes)
 
void QSPY_txReset (void)
 
void QSPY_setExternDict (char const *dictName)
 
QSpyStatus QSPY_readDict (void)
 
QSpyStatus QSPY_writeDict (void)
 
bool QSPY_command (uint8_t cmdId)
 
void QSPY_sendEvt (QSpyRecord const *const qrec)
 
void QSPY_sendObj (QSpyRecord const *const qrec)
 
void QSPY_sendCmd (QSpyRecord const *const qrec)
 
void QSPY_sendTP (QSpyRecord const *const qrec)
 
size_t QSPY_encode (uint8_t *dstBuf, size_t dstSize, uint8_t const *srcBuf, size_t srcBytes)
 
size_t QSPY_encodeResetCmd (uint8_t *dstBuf, size_t dstSize)
 
size_t QSPY_encodeInfoCmd (uint8_t *dstBuf, size_t dstSize)
 
size_t QSPY_encodeTickCmd (uint8_t *dstBuf, size_t dstSize, uint8_t rate)
 
SigType QSPY_findSig (char const *name, ObjType obj)
 
KeyType QSPY_findObj (char const *name)
 
KeyType QSPY_findFun (char const *name)
 
KeyType QSPY_findUsr (char const *name)
 
void QSPY_stop (void)
 
void QSPY_cleanup (void)
 
char const * QSPY_tstampStr (void)
 
void QSPY_onPrintLn (void)
 
void QSPY_printInfo (void)
 
void QSPY_printError (void)
 

Variables

QSPY_LastOutput QSPY_output
 

Detailed Description

Host API.

Definition in file qspy.h.


Class Documentation

◆ QSpyRecord

struct QSpyRecord

QSPY record being processed

Definition at line 73 of file qspy.h.

Class Members
uint8_t const * start

start of the record

uint8_t const * pos

current position in the stream

uint32_t tot_len

total length of the record, including chksum

int32_t len

current length of the stream

uint8_t rec

the record-ID (see enum QSpyRecords in qs.h)

◆ QSpyConfig

struct QSpyConfig

QSPY configuration parameters.

See also
QSPY_config()

Definition at line 82 of file qspy.h.

Class Members
uint16_t version
uint8_t endianness
uint8_t objPtrSize
uint8_t funPtrSize
uint8_t tstampSize
uint8_t sigSize
uint8_t evtSize
uint8_t queueCtrSize
uint8_t poolCtrSize
uint8_t poolBlkSize
uint8_t tevtCtrSize
uint8_t tstamp[6]

◆ QSPY_LastOutput

struct QSPY_LastOutput

Definition at line 170 of file qspy.h.

Class Members
char buf[QS_LINE_OFFSET+QS_LINE_LEN_MAX]
int len
int rec
int type

Macro Definition Documentation

◆ QSPY_VER

#define QSPY_VER   "6.9.4"

Definition at line 43 of file qspy.h.

◆ QS_LINE_OFFSET

#define QS_LINE_OFFSET   8

Definition at line 168 of file qspy.h.

◆ SNPRINTF_LINE

#define SNPRINTF_LINE (   format_,
  ... 
)
Value:
do { \
int n_ = SNPRINTF_S(&QSPY_output.buf[QS_LINE_OFFSET], \
format_, ##__VA_ARGS__); \
if ((0 < n_) && (n_ < QS_LINE_LEN_MAX - QS_LINE_OFFSET)) { \
QSPY_output.len = n_; \
} \
else { \
QSPY_output.len = QS_LINE_LEN_MAX - QS_LINE_OFFSET; \
} \
} while (0)
char buf[QS_LINE_OFFSET+QS_LINE_LEN_MAX]
Definition: qspy.h:171
QSPY_LastOutput QSPY_output
@ QS_LINE_LEN_MAX
Definition: qspy.h:104
#define QS_LINE_OFFSET
Definition: qspy.h:168

Definition at line 181 of file qspy.h.

◆ SNPRINTF_APPEND

#define SNPRINTF_APPEND (   format_,
  ... 
)
Value:
do { \
int n_ = SNPRINTF_S(&QSPY_output.buf[QS_LINE_OFFSET + QSPY_output.len],\
format_, ##__VA_ARGS__); \
if ((0 < n_) \
QSPY_output.len += n_; \
} \
else { \
QSPY_output.len = QS_LINE_LEN_MAX - QS_LINE_OFFSET; \
} \
} while (0)

Definition at line 193 of file qspy.h.

◆ QSPY_line

#define QSPY_line   (&QSPY_output.buf[QS_LINE_OFFSET])

Definition at line 213 of file qspy.h.

Typedef Documentation

◆ KeyType

typedef uint64_t KeyType

Definition at line 97 of file qspy.h.

◆ SigType

typedef uint32_t SigType

Definition at line 98 of file qspy.h.

◆ ObjType

typedef uint64_t ObjType

Definition at line 99 of file qspy.h.

◆ QSPY_CustParseFun

typedef int(* QSPY_CustParseFun) (QSpyRecord *const me)

Definition at line 111 of file qspy.h.

◆ QSPY_resetFun

typedef void(* QSPY_resetFun) (void)

Definition at line 112 of file qspy.h.

Enumeration Type Documentation

◆ QSpyStatus

enum QSpyStatus

low-level facilities for configuring QSpy and parsing QS records ...

Enumerator
QSPY_ERROR 
QSPY_SUCCESS 

Definition at line 50 of file qspy.h.

◆ QSpyCommands

commands to QSPY;

See also
"packet IDs" in qspy.tcl script
Enumerator
QSPY_ATTACH 

attach to the QSPY Back-End

QSPY_DETACH 

detach from the QSPY Back-End

QSPY_SAVE_DICT 

save dictionaries to a file in QSPY

QSPY_SCREEN_OUT 

toggle screen output to a file in QSPY

QSPY_BIN_OUT 

toggle binary output to a file in QSPY

QSPY_MATLAB_OUT 

toggle Matlab output to a file in QSPY

QSPY_SEQUENCE_OUT 

toggle Sequence output to a file in QSPY

QSPY_SEND_EVENT 

send event (QSPY supplying signal)

QSPY_SEND_AO_FILTER 

send Local Filter (QSPY supplying addr)

QSPY_SEND_CURR_OBJ 

send current Object (QSPY supplying addr)

QSPY_SEND_COMMAND 

send command (QSPY supplying cmdId)

QSPY_SEND_TEST_PROBE 

send Test-Probe (QSPY supplying apiId)

Definition at line 56 of file qspy.h.

◆ anonymous enum

anonymous enum
Enumerator
QS_RECORD_SIZE_MAX 
QS_LINE_LEN_MAX 
QS_FNAME_LEN_MAX 
QS_SEQ_LIST_LEN_MAX 
QS_DNAME_LEN_MAX 

Definition at line 102 of file qspy.h.

◆ QSPY_LastOutputType

Enumerator
REG_OUT 
INF_OUT 
ERR_OUT 

Definition at line 169 of file qspy.h.

Function Documentation

◆ QSpyRecord_init()

void QSpyRecord_init ( QSpyRecord *const  me,
uint8_t const *  start,
size_t  tot_len 
)

◆ QSpyRecord_OK()

QSpyStatus QSpyRecord_OK ( QSpyRecord *const  me)

◆ QSpyRecord_getUint32()

uint32_t QSpyRecord_getUint32 ( QSpyRecord *const  me,
uint8_t  size 
)

◆ QSpyRecord_getInt32()

int32_t QSpyRecord_getInt32 ( QSpyRecord *const  me,
uint8_t  size 
)

◆ QSpyRecord_getUint64()

uint64_t QSpyRecord_getUint64 ( QSpyRecord *const  me,
uint8_t  size 
)

◆ QSpyRecord_getInt64()

int64_t QSpyRecord_getInt64 ( QSpyRecord *const  me,
uint8_t  size 
)

◆ QSpyRecord_getStr()

char const* QSpyRecord_getStr ( QSpyRecord *const  me)

◆ QSpyRecord_getMem()

uint8_t const* QSpyRecord_getMem ( QSpyRecord *const  me,
uint8_t  size,
uint32_t *  pNum 
)

◆ QSPY_config()

void QSPY_config ( QSpyConfig const *  config,
void *  matFile,
void *  seqFile,
char const *  seqList,
QSPY_CustParseFun  custParseFun 
)

◆ QSPY_getConfig()

QSpyConfig const* QSPY_getConfig ( void  )

◆ QSPY_configTxReset()

void QSPY_configTxReset ( QSPY_resetFun  txResetFun)

◆ QSPY_configMatFile()

void QSPY_configMatFile ( void *  matFile)

◆ QSPY_configSeqFile()

void QSPY_configSeqFile ( void *  seqFile)

◆ QSPY_reset()

void QSPY_reset ( void  )

◆ QSPY_parse()

void QSPY_parse ( uint8_t const *  buf,
uint32_t  nBytes 
)

◆ QSPY_txReset()

void QSPY_txReset ( void  )

◆ QSPY_setExternDict()

void QSPY_setExternDict ( char const *  dictName)

◆ QSPY_readDict()

QSpyStatus QSPY_readDict ( void  )

◆ QSPY_writeDict()

QSpyStatus QSPY_writeDict ( void  )

◆ QSPY_command()

bool QSPY_command ( uint8_t  cmdId)

◆ QSPY_sendEvt()

void QSPY_sendEvt ( QSpyRecord const *const  qrec)

◆ QSPY_sendObj()

void QSPY_sendObj ( QSpyRecord const *const  qrec)

◆ QSPY_sendCmd()

void QSPY_sendCmd ( QSpyRecord const *const  qrec)

◆ QSPY_sendTP()

void QSPY_sendTP ( QSpyRecord const *const  qrec)

◆ QSPY_encode()

size_t QSPY_encode ( uint8_t *  dstBuf,
size_t  dstSize,
uint8_t const *  srcBuf,
size_t  srcBytes 
)

◆ QSPY_encodeResetCmd()

size_t QSPY_encodeResetCmd ( uint8_t *  dstBuf,
size_t  dstSize 
)

◆ QSPY_encodeInfoCmd()

size_t QSPY_encodeInfoCmd ( uint8_t *  dstBuf,
size_t  dstSize 
)

◆ QSPY_encodeTickCmd()

size_t QSPY_encodeTickCmd ( uint8_t *  dstBuf,
size_t  dstSize,
uint8_t  rate 
)

◆ QSPY_findSig()

SigType QSPY_findSig ( char const *  name,
ObjType  obj 
)

◆ QSPY_findObj()

KeyType QSPY_findObj ( char const *  name)

◆ QSPY_findFun()

KeyType QSPY_findFun ( char const *  name)

◆ QSPY_findUsr()

KeyType QSPY_findUsr ( char const *  name)

◆ QSPY_stop()

void QSPY_stop ( void  )

◆ QSPY_cleanup()

void QSPY_cleanup ( void  )

◆ QSPY_tstampStr()

char const* QSPY_tstampStr ( void  )

◆ QSPY_onPrintLn()

void QSPY_onPrintLn ( void  )

◆ QSPY_printInfo()

void QSPY_printInfo ( void  )

◆ QSPY_printError()

void QSPY_printError ( void  )

Variable Documentation

◆ QSPY_output

QSPY_LastOutput QSPY_output
extern