QTools  6.4.0
qspy.h File Reference

Host API. More...

Go to the source code of this file.

Data Structures

struct  QSpyRecord
 QSPY record being processed. More...
 
struct  QSpyConfig
 QSPY configuration parameters. More...
 
struct  QSPY_LastOutput
 

Macros

#define QSPY_VER   "6.4.0"
 
#define QS_MAX_RECORD_SIZE   512
 
#define QS_MAX_LINE_LENGTH   1000
 
#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 }
 low-level facilities for configuring QSpy and parsing QS records ... More...
 
enum  QSpyCommands {
  QSPY_ATTACH = 128, QSPY_DETACH, QSPY_SAVE_DICT, QSPY_SCREEN_OUT,
  QSPY_BIN_OUT, QSPY_MATLAB_OUT, QSPY_MSCGEN_OUT, QSPY_SEND_EVENT,
  QSPY_SEND_LOC_FILTER, QSPY_SEND_CURR_OBJ, QSPY_SEND_COMMAND, QSPY_SEND_TEST_PROBE
}
 commands to QSPY; More...
 
enum  QSPY_LastOutputType { REG_OUT, INF_OUT, ERR_OUT }
 

Functions

void QSpyRecord_init (QSpyRecord *const me, uint8_t const *start, uint32_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 (uint16_t version, 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, void *matFile, void *mscFile, QSPY_CustParseFun custParseFun)
 
QSpyConfig const * QSPY_getConfig (void)
 
void QSPY_configTxReset (QSPY_resetFun txResetFun)
 
void QSPY_configMatFile (void *matFile)
 
void QSPY_configMscFile (void *mscFile)
 
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)
 
uint32_t QSPY_encode (uint8_t *dstBuf, uint32_t dstSize, uint8_t const *srcBuf, uint32_t srcBytes)
 
uint32_t QSPY_encodeResetCmd (uint8_t *dstBuf, uint32_t dstSize)
 
uint32_t QSPY_encodeInfoCmd (uint8_t *dstBuf, uint32_t dstSize)
 
uint32_t QSPY_encodeTickCmd (uint8_t *dstBuf, uint32_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_onPrintLn (void)
 
void QSPY_printInfo (void)
 
void QSPY_printError (void)
 

Variables

QSPY_LastOutput QSPY_output
 

Detailed Description

Host API.

Definition in file qspy.h.


Data Structure Documentation

◆ QSpyRecord

struct QSpyRecord

QSPY record being processed.

Definition at line 73 of file qspy.h.

Data Fields
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.

Data Fields
uint16_t version
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 173 of file qspy.h.

Data Fields
char buf[QS_LINE_OFFSET+QS_MAX_LINE_LENGTH]
int len
int rec
int type

Macro Definition Documentation

◆ QSPY_VER

#define QSPY_VER   "6.4.0"

Definition at line 43 of file qspy.h.

◆ QS_MAX_RECORD_SIZE

#define QS_MAX_RECORD_SIZE   512

Definition at line 101 of file qspy.h.

◆ QS_MAX_LINE_LENGTH

#define QS_MAX_LINE_LENGTH   1000

Definition at line 104 of file qspy.h.

◆ QS_LINE_OFFSET

#define QS_LINE_OFFSET   8

Definition at line 171 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_MAX_LINE_LENGTH - QS_LINE_OFFSET)) { \
QSPY_output.len = n; \
} \
else { \
QSPY_output.len = QS_MAX_LINE_LENGTH - QS_LINE_OFFSET; \
} \
} while (0)
#define QS_MAX_LINE_LENGTH
Definition: qspy.h:104
QSPY_LastOutput QSPY_output
char buf[QS_LINE_OFFSET+QS_MAX_LINE_LENGTH]
Definition: qspy.h:174
#define QS_LINE_OFFSET
Definition: qspy.h:171

Definition at line 184 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_MAX_LINE_LENGTH - QS_LINE_OFFSET; \
} \
} while (0)
#define QS_MAX_LINE_LENGTH
Definition: qspy.h:104
QSPY_LastOutput QSPY_output
char buf[QS_LINE_OFFSET+QS_MAX_LINE_LENGTH]
Definition: qspy.h:174
#define QS_LINE_OFFSET
Definition: qspy.h:171

Definition at line 196 of file qspy.h.

◆ QSPY_line

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

Definition at line 216 of file qspy.h.

Typedef Documentation

◆ KeyType

typedef uint64_t KeyType

Definition at line 96 of file qspy.h.

◆ SigType

typedef uint32_t SigType

Definition at line 97 of file qspy.h.

◆ ObjType

typedef uint64_t ObjType

Definition at line 98 of file qspy.h.

◆ QSPY_CustParseFun

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

Definition at line 107 of file qspy.h.

◆ QSPY_resetFun

typedef void(* QSPY_resetFun) (void)

Definition at line 108 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_MSCGEN_OUT 

toggle MscGen output to a file in QSPY

QSPY_SEND_EVENT 

send event (QSPY supplying signal)

QSPY_SEND_LOC_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.

◆ QSPY_LastOutputType

Enumerator
REG_OUT 
INF_OUT 
ERR_OUT 

Definition at line 172 of file qspy.h.

Function Documentation

◆ QSpyRecord_init()

void QSpyRecord_init ( QSpyRecord *const  me,
uint8_t const *  start,
uint32_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 ( uint16_t  version,
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,
void *  matFile,
void *  mscFile,
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_configMscFile()

void QSPY_configMscFile ( void *  mscFile)

◆ 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()

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

◆ QSPY_encodeResetCmd()

uint32_t QSPY_encodeResetCmd ( uint8_t *  dstBuf,
uint32_t  dstSize 
)

◆ QSPY_encodeInfoCmd()

uint32_t QSPY_encodeInfoCmd ( uint8_t *  dstBuf,
uint32_t  dstSize 
)

◆ QSPY_encodeTickCmd()

uint32_t QSPY_encodeTickCmd ( uint8_t *  dstBuf,
uint32_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_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