Using the µVision Socket Interface: Advanced Client Functions

| Using the µVision Socket Interface Application Note 198 Control and monitor µVision via the built-in TCP/IP interface

- Main Page
- Usage and Description
- Reference

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
Advanced Client Functions
Client Functions

## Functions
_UVSC_FUNC_ UVSC_STATUS | UVSC_TxRxRaw (int iConnHandle, UVSOCK_CMD *buf)
_UVSC_FUNC_ UVSOCK_CMD * | UVSC_CreateMsg (UVSOCK_CMD *buf, UV_OPERATION eCmd, int nLen, const void *pData)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_EVAL_EXPRESSION_TO_STR (int iConnHandle, VSET *pVSet, int vSetLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_FILELINE_TO_ADR (int iConnHandle, AFLMAP *pAflMap, int nAflMapLen, VSET *pVSet, int vSetLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENUM_REGISTER_GROUPS (int iConnHandle, SSTR *pGroups, int *pGroupCount)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_ENUM_REGISTERS (int iConnHandle, REGENUM *pRegisters, int *pRegisterCount)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_READ_REGISTERS (int iConnHandle, char *pBuf, int *pBufLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_REGISTER_SET (int iConnHandle, VSET *pVSet, int vSetLen)
_UVSC_FUNC_ UVSC_STATUS | UVSC_DBG_DSM_READ (int iConnHandle, AMEM *pMem, int memLen)

## Description

## Function Documentation

_UVSC_FUNC_ UVSOCK_CMD * UVSC_CreateMsg | ( | UVSOCK_CMD * | buf,
|  | UV_OPERATION | eCmd,
|  | int | nLen,
|  | const void * | pData
| ) |  |

Create a UVSOCK message

Parameters

  buf | Pointer to a structure to hold the UVSOCK message data
  eCmd | Mssage command to add to the message
  nLen | Length of the data in pData
  pData | Pointer to the data to add to the message

Returns
  Equal to the input parameter buf

Use this function to create a correctly formatted UVSOCK message. This function is useful only in conjunction with the UVSC_TxRxRaw function. This is an advanced feature, and normally is not required.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_DSM_READ | ( | int | iConnHandle,
|  | AMEM * | pMem,
|  | int | memLen
| ) |  |

Get block of disassembly lines for given address

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pMem | Pointer to a structure containing the information about the address of disassembly to read. This variable will be updated with block of disassembly lines. This is a variable length structure, and must be large enough to contain the returned data, otherwise an error code will be returned from the function
  memLen | Size of the pMem data (bytes)

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  A valid project is loaded, and uVision is debugging

Use this function to get a block of disassembly lines starting with given address current project.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_REGISTER_GROUPS | ( | int | iConnHandle,
|  | SSTR * | pGroups,
|  | int * | pGroupCount
| ) |  |

Enumerate register groups

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pGroups | Pointer to a structure to contain the group(s)
  pGroupCount | Pointer to a variable to containing the number of items it is possible to fit into the pGroups structures. This variable will be updated with the actual number of groups returned.

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  A valid project is loaded, and uVision is debugging

Use this function to get a list of all register groups that exist within the current project.

The pointer pGroups must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pGroupCount. The multiple must make the pGroups memory space large enough to contain the maximum number of groups that may be returned. If the memory area is not large enough for the returned data, the function will return an error. A recommended value is 256.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_REGISTERS | ( | int | iConnHandle,
|  | REGENUM * | pRegisters,
|  | int * | pRegisterCount
| ) |  |

Enumerate registers

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pRegisters | Pointer to a structure to contain the registers
  pRegisterCount | Pointer to a variable containing the number of items it is possible to fit into the pRegisters. This variable will be updated with the actual number of registers returned.

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  A valid project is loaded, and uVision is debugging

Use this function to get a list of all register groups that exist within the current project.

The pointer pRegisters must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pRegisterCount. The multiple must make the pRegisters memory space large enough to contain the maximum number of registers that may be returned. If the memory area is not large enough for the returned data, the function will return an error. A recommended value is 256.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EVAL_EXPRESSION_TO_STR | ( | int | iConnHandle,
|  | VSET * | pVSet,
|  | int | vSetLen
| ) |  |

Evaluate expession and retur result as string

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pVSet | Pointer to a structure containing the expression to calculate. This variable will be updated with the result of the expression calculation. input : pVSet->val : stack frame address (VTT_uint64) pVSet-str : expression to avaluate
  vSetLen | Size of the pVSet data (bytes)

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode

Use this function to get stack frame based expression evaluation, for example to display a variable value in a tooltip

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_FILELINE_TO_ADR | ( | int | iConnHandle,
|  | AFLMAP * | pAflMap,
|  | int | nAflMapLen,
|  | VSET * | pVSet,
|  | int | vSetLen
| ) |  |

Convert High Level Language (HLL) file and line to an address

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pAflMap | Pointer to a structure to contain the HLL code information about file and line
  nAflMapLen | size of the pAflMap data (bytes).
  pVSet | Pointer to a structure containing calculated address. This variable will be updated with the result of the calculation.
  vSetLen | Size of the pVSet data (bytes)

Note
  The input parameter pAflMap cannot consume the output parameter pAflMap from function UVSC_DBG_ADR_TOFILELINE

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  uVision is in debug mode

Use this function to convert a code address to a High Level Language (HLL) file, line and function.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_READ_REGISTERS | ( | int | iConnHandle,
|  | char * | pBuf,
|  | int * | pBufLen
| ) |  |

Read all register values

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pBuf | pointer to a string buffer to contain the register values
  pBufLen | pointer to a variable containing the size of pBuf in bytes This variable will be updated with the actual number of bytes returned.

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  A valid project is loaded, and uVision is debugging

Use this function to get a list of all register groups that exist within the current project.

The pointer pBuf must point to memory which is a multiple of the 32 bytes (32*register_count). The length of this buffer be passed in the variable pBufLen. The multiple must make the pBuf memory space large enough to contain the maximum number of register values that may be returned. If the memory area is not large enough for the returned data, the function will return an error. A recommended value is 4096.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_REGISTER_SET | ( | int | iConnHandle,
|  | VSET * | pVSet,
|  | int | vSetLen
| ) |  |

Set register value

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  pVSet | pointer to a VSET structure that contains: TVAL member contains register index as integer SSTR contains register value as string expression
  vSetLen | size of VSET stucture

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully
  A valid project is loaded, and uVision is debugging

Use this function to set a new value to a register

_UVSC_FUNC_ UVSC_STATUS UVSC_TxRxRaw | ( | int | iConnHandle,
|  | UVSOCK_CMD * | buf
| ) |  |

Send a raw UVSOCK message, and retreive the response

Parameters

  iConnHandle | Handle for the connection, as returned by UVSC_OpenConnection
  buf | Pointer to a structure containing the UVSOCK request message data. This will be replaced by the response message data

Returns
  UVSC_STATUS_SUCCESS on success, or an error code

Precondition
  UVSC_OpenConnection must have been called successfully

Use this function to send a raw UVSOCK message, and retreive the response. This is useful when implementing UVSOCK features that are not yet fully supported in UVSC. This is an advanced feature, and normally is not required.