UVSC_C.h File Reference

UVSOCK Client DLL Interface. More...

#include "UVSOCK.h"

Go to the source code of this file.

Data Structures

union  UVSC_CB_DATA
 UVSC callback data. More...

Defines

#define UVSC_MAX_CLIENTS   10
 Maximum number of clients UVSC can support.
#define UVSC_MAX_API_STR_SIZE   1024
 Maximum string size.
#define UVSC_PORT_AUTO   0
 Auto port.
#define UVSC_MIN_AUTO_PORT   1
 Minimum auto port value.
#define UVSC_MAX_AUTO_PORT   65535
 Maximum auto port value.

Typedefs

typedef void(* uvsc_cb )(void *cb_custom, UVSC_CB_TYPE type, UVSC_CB_DATA *data)
 UVSC callback function pointer definition.
typedef void(* log_cb )(const char *msg, int msgLen)
 UVSC logging callback function pointer definition.

Enumerations

enum  UVSC_STATUS {
  UVSC_STATUS_SUCCESS = 0, UVSC_STATUS_FAILED = 1, UVSC_STATUS_NOT_SUPPORTED = 2, UVSC_STATUS_NOT_INIT = 3,
  UVSC_STATUS_TIMEOUT = 4, UVSC_STATUS_INVALID_CONTEXT = 5, UVSC_STATUS_INVALID_PARAM = 6, UVSC_STATUS_BUFFER_TOO_SMALL = 7,
  UVSC_STATUS_CALLBACK_IN_USE = 8, UVSC_STATUS_COMMAND_ERROR = 9, UVSC_STATUS_END
}
 UVSC status codes. More...
enum  UVSC_RUNMODE { UVSC_RUNMODE_NORMAL = 0, UVSC_RUNMODE_LABVIEW = 1, UVSC_RUNMODE_END = 2 }
 uVision Runmode More...
enum  UVSC_PBAR { UVSC_PBAR_INIT = 0, UVSC_PBAR_TEXT = 1, UVSC_PBAR_POS = 2, UVSC_PBAR_STOP = 3 }
 Progress bar operations. More...
enum  UVSC_CB_TYPE {
  UVSC_CB_ERROR = 0, UVSC_CB_ASYNC_MSG = 1, UVSC_CB_DISCONNECTED = 2, UVSC_CB_BUILD_OUTPUT_MSG = 3,
  UVSC_CB_PROGRESS_BAR_MSG = 4
}
 UVSC callback type. More...

Functions

_UVSC_FUNC_ void UVSC_Version (UINT *pUVSCVersion, UINT *pUVSOCKVersion)
 Get the library and interface versions.
_UVSC_FUNC_ UVSC_STATUS UVSC_Init (int uvMinPort, int uvMaxPort)
 Initialise UVSC.
_UVSC_FUNC_ UVSC_STATUS UVSC_UnInit (void)
 Uninitialise UVSC.
_UVSC_FUNC_ UVSC_STATUS UVSC_OpenConnection (char *name, int *iConnHandle, int *pPort, char *uvCmd, UVSC_RUNMODE uvRunmode, uvsc_cb callback, void *cb_custom, char *logFileName, xBOOL logFileAppend, log_cb logCallback)
 Open a connection to uVision session.
_UVSC_FUNC_ UVSC_STATUS UVSC_CloseConnection (int iConnHandle, xBOOL terminate)
 Close a connection to a uVision session.
_UVSC_FUNC_ UVSC_STATUS UVSC_ConnHandleFromConnName (char *name, int *iConnHandle)
 Get a connection handle (iConnHandle) from a connection name.
_UVSC_FUNC_ UVSC_STATUS UVSC_GetLastError (int iConnHandle, UV_OPERATION *msgType, UV_STATUS *status, char *str, int maxStrLen)
 Retreive detailed information on the last UVSOCK error.
_UVSC_FUNC_ UVSC_STATUS UVSC_LogControl (int iConnHandle, xBOOL enableRaw, xBOOL enableTrace)
 Control message logging.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_UVSOCK_VERSION (int iConnHandle, UINT *pMajor, UINT *pMinor)
 Get the uVision UVSOCK interface version.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_EXT_VERSION (int iConnHandle, EXTVERS *pVersions, UINT *pVersionsLen)
 Get extended uVision versions.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_HIDE (int iConnHandle)
 Hide the uVision window.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_SHOW (int iConnHandle)
 Show the uVision window.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_MAXIMIZE (int iConnHandle)
 Maximize the uVision window.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_MINIMIZE (int iConnHandle)
 Minimize the uVision window.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_RESTORE (int iConnHandle)
 Restore the uVision window.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_UI_LOCK (int iConnHandle)
 Lock the uVision window.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_UI_UNLOCK (int iConnHandle)
 Unlock the uVision window.
_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_CHECK_LICENSE (int iConnHandle, UVLICINFO *pLicInfo)
 Get uVision license status.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_LOAD (int iConnHandle, PRJDATA *pProjectFile, int projectFileLen)
 Load a project into uVision.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_CLOSE (int iConnHandle)
 Close the current uVision project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ADD_FILE (int iConnHandle, PRJDATA *pGroupFiles, int groupFilesLen)
 Add a file to a group within the current uVision project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_DEL_FILE (int iConnHandle, PRJDATA *pGroupFiles, int groupFilesLen)
 Remove a file from a group within the current uVision project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ENUM_FILES (int iConnHandle, SSTR *pGroup, int groupLen, SSTR *pFiles, int *pFileIndexes, int *pFileCount)
 Enumerate the files within a project group.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ADD_GROUP (int iConnHandle, PRJDATA *pGroups, int groupsLen)
 Add a group to the current uVision project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_DEL_GROUP (int iConnHandle, PRJDATA *pGroups, int groupsLen)
 Remove a group from the current uVision project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ENUM_GROUPS (int iConnHandle, SSTR *pGroups, int *pGroupIndexes, int *pGroupCount)
 Enumerate the groups within the current project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ACTIVE_FILES (int iConnHandle, UINT *pActiveFileCount)
 Get the number of active files in the current project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_BUILD (int iConnHandle, xBOOL rebuild)
 Build the current uVision project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_BUILD_CANCEL (int iConnHandle)
 Cancel a build that is currently in progress.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_CLEAN (int iConnHandle)
 Clean the current uVision project.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_FLASH_DOWNLOAD (int iConnHandle)
 Download the currently built executable to FLASH.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_GET_OPTITEM (int iConnHandle, TRNOPT *pTrnOpt, int trnOptLen)
 Get a uVision project option.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_SET_OPTITEM (int iConnHandle, TRNOPT *pTrnOpt, int trnOptLen)
 Set a uVision project option.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_GET_DEBUG_TARGET (int iConnHandle, DBGTGTOPT *pDbgTgtOpt)
 Set the debug uVision target configuration.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_SET_DEBUG_TARGET (int iConnHandle, DBGTGTOPT *pDbgTgtOpt)
 Get the debug uVision target configuration.
_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_CMD_PROGRESS (int iConnHandle, PGRESS *pPgress, int pgressLen)
 Control the uVision UI progress bar.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENTER (int iConnHandle)
 Enter debug mode.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EXIT (int iConnHandle)
 Exit debug mode.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_START_EXECUTION (int iConnHandle)
 Start execution.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STOP_EXECUTION (int iConnHandle)
 Stop execution.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STATUS (int iConnHandle, int *pStatus)
 Get execution status.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_HLL (int iConnHandle)
 Step one High Level Language (HLL) code line.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_INSTRUCTION (int iConnHandle)
 Step one ASM instruction.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_INTO (int iConnHandle)
 Step into the current High Level Language (HLL) function.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_OUT (int iConnHandle)
 Step out of the current High Level Language (HLL) function.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_RESET (int iConnHandle)
 Reset the target.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MEM_READ (int iConnHandle, AMEM *pMem, int memLen)
 Read memory.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MEM_WRITE (int iConnHandle, AMEM *pMem, int memLen)
 Write memory.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_CREATE_BP (int iConnHandle, BKPARM *pBkptSet, int bkptSetLen, BKRSP *pBkptRsp, int *pBkptRspLen)
 Create a breakpoint.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_CHANGE_BP (int iConnHandle, BKCHG *pBkptChg, int bkptChgLen, BKRSP *pBkptRsp, int *pBkptRspLen)
 Modify an existing breakpoint.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUMERATE_BP (int iConnHandle, BKRSP *pBkptRsp, int *pBkptIndexes, int *pBkptCount)
 Enumerate all breakpoints.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SERIAL_GET (int iConnHandle, SERIO *pSerIO, int serIOLen)
 Get terminal data from a uVision terminal window.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SERIAL_PUT (int iConnHandle, SERIO *pSerIO, int serIOLen)
 Send terminal data to a uVision terminal window.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_CALC_EXPRESSION (int iConnHandle, VSET *pVSet, int vSetLen)
 Calculate the value of an expression.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_VTR (int iConnHandle, iVTRENUM *piVtrEnum, AVTR *paVTR, int *pVtrIndexes, int *pVtrCount)
 Enumerate the device Virtual Registers (VTRs).
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_VTR_GET (int iConnHandle, VSET *pVSet, int vSetLen)
 Get the value of a virtual register (VTR).
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_VTR_SET (int iConnHandle, VSET *pVSet, int vSetLen)
 Set the value of a virtual register (VTR).
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_STACK (int iConnHandle, iSTKENUM *piStkEnum, STACKENUM *pStackEnum, int *pStackCount)
 Enumerate stack frames.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ADR_TOFILELINE (int iConnHandle, ADRMTFL *pAdrMtfl, AFLMAP *pAflMap, int *pAflMapLen)
 Convert a code address to a High Level Language (HLL) file, line and function.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ADR_SHOWCODE (int iConnHandle, iSHOWSYNC *piShowSync)
 Show code at a specific address within uVision.
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_WAKE (int iConnHandle, iINTERVAL *piInterval)
 Wake the simulation [SIMULATOR ONLY].
_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SLEEP (int iConnHandle)
 Sleep the simulation [SIMULATOR ONLY].
_UVSC_FUNC_ UVSC_STATUS UVSC_GetBuildOutputSize (int iConnHandle, int *pBuildOutputSize)
 Get the size (bytes) of the latest build output text.
_UVSC_FUNC_ UVSC_STATUS UVSC_GetBuildOutput (int iConnHandle, char *pBuildOutput, int buildOutputLen)
 Get the latest build output text.
_UVSC_FUNC_ UVSC_STATUS UVSC_ReadBuildQ (int iConnHandle, char *pOutputLine, int timeout)
 Read build messages from the build queue.
_UVSC_FUNC_ UVSC_STATUS UVSC_ReadPBarQ (int iConnHandle, UVSC_PBAR *pBar, char *pStr, int timeout)
 Read progress bar messages from the progress bar queue.
_UVSC_FUNC_ UVSC_STATUS UVSC_ReadAsyncQ (int iConnHandle, int iQueueNo, UVSOCK_CMD *buf, int timeout)
 Read a message from the UVSOCK asynchronous message queue.
_UVSC_FUNC_ UVSC_STATUS UVSC_FlushAsyncQ (int iConnHandle, int iQueueNo)
 Flush the UVSOCK asynchronous message queue.
_UVSC_FUNC_ UVSC_STATUS UVSC_TxRxRaw (int iConnHandle, UVSOCK_CMD *buf)
 Send a raw UVSOCK message, and retreive the response.
_UVSC_FUNC_ UVSOCK_CMDUVSC_CreateMsg (UVSOCK_CMD *buf, UV_OPERATION eCmd, int nLen, const void *pData)
 Create a UVSOCK message.


Detailed Description

UVSOCK Client DLL Interface.

Version:
V2.07
API for the UVSC DLL, to facilitate 3rd party application communication with uVision.

General API Rules

Version History

Author, Date, Version

Change Log

Version 2.02:

Version 2.03: Version 2.04: Version 2.05: Version 2.06: Version 2.07:

Definition in file UVSC_C.h.


Define Documentation

#define UVSC_MAX_API_STR_SIZE   1024

Maximum string size.

Maximum string size where strings are passed to or returned from API functions such as UVSC_OpenConnection.

Definition at line 103 of file UVSC_C.h.

#define UVSC_MAX_AUTO_PORT   65535

Maximum auto port value.

The maximum port passed to UVSC_Init must not be more than this.

Definition at line 122 of file UVSC_C.h.

#define UVSC_MAX_CLIENTS   10

Maximum number of clients UVSC can support.

UVSC can support this many clients.

Definition at line 96 of file UVSC_C.h.

#define UVSC_MIN_AUTO_PORT   1

Minimum auto port value.

The minimum port passed to UVSC_Init must not be less than this.

Definition at line 116 of file UVSC_C.h.

#define UVSC_PORT_AUTO   0

Auto port.

This define is used to indicate that automatic port selection is wanted.

Definition at line 110 of file UVSC_C.h.


Typedef Documentation

typedef void(* log_cb)(const char *msg, int msgLen)

UVSC logging callback function pointer definition.

Defines the format to which the UVSC logging callback function configured through UVSC_OpenConnection must correspond.

Definition at line 201 of file UVSC_C.h.

typedef void(* uvsc_cb)(void *cb_custom, UVSC_CB_TYPE type, UVSC_CB_DATA *data)

UVSC callback function pointer definition.

Defines the format to which the UVSC callback function configured through UVSC_OpenConnection must correspond.

Definition at line 194 of file UVSC_C.h.


Enumeration Type Documentation

UVSC callback type.

Indicates the type of message retuned in the UVSC callback function uvsc_cb configured through UVSC_OpenConnection.

Enumerator:
UVSC_CB_ERROR  Error notification (not used).
UVSC_CB_ASYNC_MSG  Asynchronous message received (called from UVSC internal thread).
UVSC_CB_DISCONNECTED  uVision has disconnected (called from UVSC internal thread)
UVSC_CB_BUILD_OUTPUT_MSG  Called from the UVSC_PRJ_BUILD function - indicates a line of build output (called from API function callers own thread).
UVSC_CB_PROGRESS_BAR_MSG  Called from function that cause a progress bar in uVision - indicates the progress bar state (called from API function callers own thread).

Definition at line 170 of file UVSC_C.h.

enum UVSC_PBAR

Progress bar operations.

Progress bar operations as returned by UVSC_ReadPBarQ.

Enumerator:
UVSC_PBAR_INIT  Initialise progress bar.
UVSC_PBAR_TEXT  Set progress bar text.
UVSC_PBAR_POS  Set progress bar position.
UVSC_PBAR_STOP  Stop progress bar.

Definition at line 158 of file UVSC_C.h.

uVision Runmode

Indicates the mode uVision will be started in if it is auto-started.

Enumerator:
UVSC_RUNMODE_NORMAL  Normal uVision operation.
UVSC_RUNMODE_LABVIEW  LabVIEW operation.
UVSC_RUNMODE_END  Always at end.

Definition at line 148 of file UVSC_C.h.

UVSC status codes.

UVSC status codes are returned by UVSC API functions, and indicate the success or failure of the called API function.

Enumerator:
UVSC_STATUS_SUCCESS  Success.
UVSC_STATUS_FAILED  General failure.
UVSC_STATUS_NOT_SUPPORTED  Request for an unsupported operation.
UVSC_STATUS_NOT_INIT  UVSC not initialised.
UVSC_STATUS_TIMEOUT  Operation timed-out.
UVSC_STATUS_INVALID_CONTEXT  Function called from an invalid context (most likely the callback function).
UVSC_STATUS_INVALID_PARAM  Function called with one or more invalid parameters.
UVSC_STATUS_BUFFER_TOO_SMALL  Function called with a buffer that was not big enough to hold the result from uVision.
UVSC_STATUS_CALLBACK_IN_USE  Function cannot be used when the callback is in use.
UVSC_STATUS_COMMAND_ERROR  The command failed - call UVSC_GetLastError to get more information on how the command failed.
UVSC_STATUS_END  Always at end.

Definition at line 130 of file UVSC_C.h.


Function Documentation

_UVSC_FUNC_ UVSC_STATUS UVSC_CloseConnection ( int  iConnHandle,
xBOOL  terminate 
)

Close a connection to a uVision session.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
terminate Pass 'xTRUE' to terminate uVision. This parameter is ignored and the session is automatically terminated if it was auto-started
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
This function closes a connection to a uVision session. If the session was auto-started it is automatically terminated. If it was not auto-started, it can be terminated, or left running.

_UVSC_FUNC_ UVSC_STATUS UVSC_ConnHandleFromConnName ( char *  name,
int *  iConnHandle 
)

Get a connection handle (iConnHandle) from a connection name.

Parameters:
name Pointer to a zero terminated string containing a unique connection name. The name should correspond to a name that was previously passed to UVSC_OpenConnection. This pointer must not be NULL
iConnHandle Pointer to a variable to contain the handle assigned to this connection. The value assigned will be invalid if the function returns an error. This pointer must not be NULL
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to convert a connection name to a connection handle (iConnHandle) to be used with other UVSC API functions.

_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_ADR_SHOWCODE ( int  iConnHandle,
iSHOWSYNC piShowSync 
)

Show code at a specific address within uVision.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
piShowSync Pointer to a structure containing the type of code to show
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 show code at a specific address within uVision. Either ASM code, HLL code, or both can shown.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ADR_TOFILELINE ( int  iConnHandle,
ADRMTFL pAdrMtfl,
AFLMAP pAflMap,
int *  pAflMapLen 
)

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

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pAdrMtfl Pointer to a structure containing the type of HLL information to retreive
pAflMap Pointer to a structure to contain the HLL code information. 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
pAflMapLen Pointer to a variable containing the size of the pAflMap data (bytes). This variable will be updated with the length of the pAflMap data returned
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_CALC_EXPRESSION ( int  iConnHandle,
VSET pVSet,
int  vSetLen 
)

Calculate the value of an expression.

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. This is a variable length structure.
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 calculate the value of an expression, in the same way an expression would be calculated via the uVision command window. This function can also be used to read and write real and virtual registers.

Example 1: Evaluate the address of the function 'main()'

 Set pVSet->str to "&main" 

Example 2: Read the value of R0

 Set pVSet->str to "R0" 

Example 3: Modify the value of PC to 0x99

 Set pVSet->str to "PC = 0x99" 

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_CHANGE_BP ( int  iConnHandle,
BKCHG pBkptChg,
int  bkptChgLen,
BKRSP pBkptRsp,
int *  pBkptRspLen 
)

Modify an existing breakpoint.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pBkptChg Pointer to a structure containing the breakpoint to change. This is a variable length structure.
bkptChgLen Size of the pBkptChg data (bytes)
pBkptRsp Pointer to a structure to contain the new breakpoint information. 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.
pBkptRspLen Size of the pBkptRsp data (bytes). This variable will be updated with the actual length of data written to the pBkptRsp structure
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 modify an exisiting breakpoint in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_CREATE_BP ( int  iConnHandle,
BKPARM pBkptSet,
int  bkptSetLen,
BKRSP pBkptRsp,
int *  pBkptRspLen 
)

Create a breakpoint.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pBkptSet Pointer to a structure containing the new breakpoint data. This is a variable length structure.
bkptSetLen Size of the pBkptSet data (bytes)
pBkptRsp Pointer to a structure to contain the new breakpoint information. 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.
pBkptRspLen Size of the pBkptRsp data (bytes). This variable will be updated with the actual length of data written to the pBkptRsp structure
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 create a new breakpoint in uVision. The information returned in the pBkptRsp structure contains nTickMark which can be used to identify this breakpoint in the future to other UVSC command functions.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENTER ( int  iConnHandle  ) 

Enter debug mode.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid project is loaded, a binary has been built, and uVision is not building, downloading, or debugging

Use this function to put uVision into debug mode.

This is the equivalent of clicking the 'Debug-->Start/Stop Debug Session' menu item in uVision (when not in debug mode).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_STACK ( int  iConnHandle,
iSTKENUM piStkEnum,
STACKENUM pStackEnum,
int *  pStackCount 
)

Enumerate stack frames.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
piStkEnum Pointer to a structure containing the type of stack enumeration to perform
pStackEnum Pointer to a structure to contain the stack frame(s)
pStackCount Pointer to a variable to containing the number of items it is possible to fit into the pStackEnum structure. This variable will be updated with the actual number of stack frames returned
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and not executing

Use this function to get a list of the current stack frames.

The pointer pStackEnum must point to memory which is a multiple of the size of the STACKENUM structure. This multiple must be passed in the variable pStackCount. The multiple must be at least equal to the maximum number of stack frames that may be returned. A recommended value is 256.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUM_VTR ( int  iConnHandle,
iVTRENUM piVtrEnum,
AVTR paVTR,
int *  pVtrIndexes,
int *  pVtrCount 
)

Enumerate the device Virtual Registers (VTRs).

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
piVtrEnum Pointer to a structure containing the type of VTR enumeration to perform
paVTR Pointer to a structure to contain the VTR(s)
pVtrIndexes Pointer to a variable to contain the VTR index(es) within the paVTR data.
pVtrCount Pointer to a variable to containing the number of items it is possible to fit into the paVTR and pVtrIndexes structures. This variable will be updated with the actual number of VTRs returned
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and not executing

Use this function to get a list of all the VTRs that exist within the target device. Optionally their values can also be retreived

The pointers paVTR and pVtrIndexes must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pVtrCount. The multiple must make the paVTR memory space large enough to contain the maximum number of VTRs 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.

The AVTR structure is designed to contain variable length data, therefore it may be the case that one record within paVTR actually takes up more than 1 index. Because of this, the returned data should be interpreted in the following way:

  
    for (i=0; i<*pVtrCount; i++) {
      pointer_to_ith_VTR = paVTR[pVtrIndexes[i]];
    }
 

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_ENUMERATE_BP ( int  iConnHandle,
BKRSP pBkptRsp,
int *  pBkptIndexes,
int *  pBkptCount 
)

Enumerate all breakpoints.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pBkptRsp Pointer to a structure to contain the breakpoint(s) information
pBkptIndexes Pointer to a variable to contain the breakpoint index(es) within the pBkptRsp data.
pBkptCount Pointer to a variable to containing the number of items it is possible to fit into the pBkptRsp and pBkptIndexes structures. This variable will be updated with the actual number of breakpoints returned.
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 a list of all the breakpoints that exist in uVision, and their current status.

The pointers pBkptRsp and pBkptIndexes must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pBkptCount. The multiple must make the pBkptRsp memory space large enough to contain the maximum number of breakpoints 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.

The BKRSP structure is designed to contain variable length data, therefore it may be the case that one record within pBkptRsp actually takes up more than 1 index. Because of this, the returned data should be interpreted in the following way:

  
    for (i=0; i<*pBkptCount; i++) {
      pointer_to_ith_Breakpoint = pBkptRsp[pBkptIndexes[i]];
    }
 

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_EXIT ( int  iConnHandle  ) 

Exit debug mode.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
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 exit debug mode.

This is the equivalent of clicking the 'Debug-->Start/Stop Debug Session' menu item in uVision (when in debug mode).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MEM_READ ( int  iConnHandle,
AMEM pMem,
int  memLen 
)

Read memory.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pMem Pointer to a structure containing the information about the memory to read. This variable will be updated with the data read from memory. 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

uVision is in debug mode

Use this function to read target memory.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_MEM_WRITE ( int  iConnHandle,
AMEM pMem,
int  memLen 
)

Write memory.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pMem Pointer to a structure containing the information about the memory to write, including the data to write. This is a variable length structure
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

uVision is in debug mode

Use this function to write target memory.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_RESET ( int  iConnHandle  ) 

Reset the target.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
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 reset the target processor or simulation.

This is the equivalent of clicking the 'Peripherals-->Reset CPU' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SERIAL_GET ( int  iConnHandle,
SERIO pSerIO,
int  serIOLen 
)

Get terminal data from a uVision terminal window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pSerIO Pointer to a structure containing the information about the terminal window to get data from. This variable will be updated with the data read from the terminal window. 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.
serIOLen Size of the pSerIO 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 terminal data from a uVision terminal window.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SERIAL_PUT ( int  iConnHandle,
SERIO pSerIO,
int  serIOLen 
)

Send terminal data to a uVision terminal window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pSerIO Pointer to a structure containing the information about the terminal window to write data to, including the data to write. This is a variable length structure
serIOLen Size of the pSerIO 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 send terminal data to a uVision terminal window.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_SLEEP ( int  iConnHandle  ) 

Sleep the simulation [SIMULATOR ONLY].

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and is targetting the simulator

Use this function to put the simulation to sleep. When the simulator is asleep, simulation is paused, but uVision still shows the simulation as running.

NOTE: The simulator will automatically wake up after 500ms if it is not told to wake up by a UVSC_DBG_WAKE command.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_START_EXECUTION ( int  iConnHandle  ) 

Start execution.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and not executing

Use this function to start the target or simulation execution.

This is the equivalent of clicking the 'Debug-->Run' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STATUS ( int  iConnHandle,
int *  pStatus 
)

Get execution status.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pStatus Pointer to a variable to contain the execution status. 1:= the target is executing, 0:= the target is stopped.
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 find out if the target or simulator is executing, or is stopped.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_HLL ( int  iConnHandle  ) 

Step one High Level Language (HLL) code line.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and not executing

Use this function to step one High Level Language (HLL) code line.

This is the equivalent of clicking the 'Debug-->Step Over' menu item in uVision (when viewing HLL code).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_INSTRUCTION ( int  iConnHandle  ) 

Step one ASM instruction.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and not executing

Use this function to step one ASM instruction.

This is the equivalent of clicking the 'Debug-->Step' menu item in uVision (when viewing ASM code).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_INTO ( int  iConnHandle  ) 

Step into the current High Level Language (HLL) function.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and not executing

Use this function to step into the current High Level Language (HLL) function.

This is the equivalent of clicking the 'Debug-->Step' menu item in uVision (when viewing HLL code).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STEP_OUT ( int  iConnHandle  ) 

Step out of the current High Level Language (HLL) function.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and not executing

Use this function to step out of the current High Level Language (HLL) function.

This is the equivalent of clicking the 'Debug-->Step out of current function' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_STOP_EXECUTION ( int  iConnHandle  ) 

Stop execution.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and executing

Use this function to stop the target or simulation execution.

This is the equivalent of clicking the 'Debug-->Stop Running' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_VTR_GET ( int  iConnHandle,
VSET pVSet,
int  vSetLen 
)

Get the value of a virtual register (VTR).

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pVSet Pointer to a structure containing the VTR to get. This structure will be updated with the VTR value. This is a variable length structure
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 the value of a virtual register (VTR).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_VTR_SET ( int  iConnHandle,
VSET pVSet,
int  vSetLen 
)

Set the value of a virtual register (VTR).

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pVSet Pointer to a structure containing the VTR to set, and the value to set it to. This is a variable length structure
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 set the value of a virtual register (VTR).

_UVSC_FUNC_ UVSC_STATUS UVSC_DBG_WAKE ( int  iConnHandle,
iINTERVAL piInterval 
)

Wake the simulation [SIMULATOR ONLY].

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
piInterval Pointer to a structure containing the information on how long the simulation should wake for.
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is in debug mode, and is targetting the simulator

Use this function to simulate I/O to and from the uVision simulator in a synchronous manner.

The function call can run the simulation for a specified time, after which the simulation is put to sleep and a notification generated. At this point, simulation virtual registers (ie device IO) can be read and written, and then this message can be sent again to wake the simulation again. This sequence can be used to simulate I/O to and from the simulator in a synchronous manner.

When the simulator is asleep, simulation is paused, but uVision still shows the simulation as running.

NOTE: The simulator will automatically wake up after 500ms if it is not told to wake up by another UVSC_DBG_WAKE command.

_UVSC_FUNC_ UVSC_STATUS UVSC_FlushAsyncQ ( int  iConnHandle,
int  iQueueNo 
)

Flush the UVSOCK asynchronous message queue.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
iQueueNo The asynchronous queue number to flush
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

NULL was passed as the callback parameter to UVSC_OpenConnection.

Use this function to flush the UVSOCK asynchronous message queue.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_CHECK_LICENSE ( int  iConnHandle,
UVLICINFO pLicInfo 
)

Get uVision license status.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pLicInfo Pointer to a structure to contain the uVision license information
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 not building, downloading, or debugging

Use this function to get the uVision license status.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_EXT_VERSION ( int  iConnHandle,
EXTVERS pVersions,
UINT *  pVersionsLen 
)

Get extended uVision versions.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pVersions Pointer to a structure to contain the extended version information. 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
pVersionsLen Pointer to a variable containing the size of the pVersions data (bytes). This variable will be updated with the actual length of pVersions returned.
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to get uVision version information as strings.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_HIDE ( int  iConnHandle  ) 

Hide the uVision window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to completely hide the uVision window. uVision continues to run as normal, but the uVision window is no longer visible.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_MAXIMIZE ( int  iConnHandle  ) 

Maximize the uVision window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to maximize the uVision window. This command performs the same operation as clicking the window [MAXIMIZE] button. If the uVision window is hidden it will be shown.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_MINIMIZE ( int  iConnHandle  ) 

Minimize the uVision window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to minimize the uVision window. This command performs the same operation as clicking the window [_] button. If the uVision window is hidden it will be shown.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_RESTORE ( int  iConnHandle  ) 

Restore the uVision window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to restore the uVision window. This command performs the same operation as clicking the window [RESTORE] button. If the uVision window is hidden it will be shown.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_SHOW ( int  iConnHandle  ) 

Show the uVision window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to show the uVision window. The uVision window will be brought to the front of the windows Z-order.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_UI_LOCK ( int  iConnHandle  ) 

Lock the uVision window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to completely lock the uVision window. uVision continues to run as normal, but the uVision window cannot be interacted with. All message boxes that would normally be shown to the user are also supressed. In the case where a message box has multiple options, the default option will be automatically selected.

UI locking is performed automatically for all UVSC functions where it is required.

NOTE: UI locking is reference counted within uVision, therefore calls to UVSC_GEN_UI_LOCK and UVSC_GEN_UI_UNLOCK must be balanced.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_UI_UNLOCK ( int  iConnHandle  ) 

Unlock the uVision window.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to unlock the uVision window after it has been locked with UVSC_GEN_UI_LOCK.

NOTE: UI locking is reference counted within uVision, therefore calls to UVSC_GEN_UI_LOCK and UVSC_GEN_UI_UNLOCK must be balanced.

_UVSC_FUNC_ UVSC_STATUS UVSC_GEN_UVSOCK_VERSION ( int  iConnHandle,
UINT *  pMajor,
UINT *  pMinor 
)

Get the uVision UVSOCK interface version.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pMajor Pointer to a variable to contain the major version number
pMinor Pointer to a variable to contain the minor version number
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to get the uVision UVSOCK interface version. The version number is of the format:

 UVSOCK Version = V*pMajor.*pMinor

_UVSC_FUNC_ UVSC_STATUS UVSC_GetBuildOutput ( int  iConnHandle,
char *  pBuildOutput,
int  buildOutputLen 
)

Get the latest build output text.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pBuildOutput Pointer to a buffer to contain the build output text
buildOutputLen Size of the pBuildOutput buffer (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A build must have been performed, otherwise no data will be returned

UVSC_GetBuildOutputSize must have been called successfully

Use this function to get the latest build output text. First call UVSC_GetBuildOutputSize so that a correctly sized buffer can be passed to this function.

_UVSC_FUNC_ UVSC_STATUS UVSC_GetBuildOutputSize ( int  iConnHandle,
int *  pBuildOutputSize 
)

Get the size (bytes) of the latest build output text.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pBuildOutputSize Pointer to a variable to contain the build output text size (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to get the size (bytes) of the latest build output text that will be returned by the UVSC_GetBuildOutput function.

_UVSC_FUNC_ UVSC_STATUS UVSC_GetLastError ( int  iConnHandle,
UV_OPERATION msgType,
UV_STATUS status,
char *  str,
int  maxStrLen 
)

Retreive detailed information on the last UVSOCK error.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
msgType Pointer to a variable to contain the UVSOCK message that caused the error
status Pointer to a variable to contain status code of the UVSOCK message that caused the error
str Pointer to a buffer to contain the zero terminated error string of the UVSOCK message that caused the error
maxStrLen Size of the buffer pointer to by str (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

The last call to UVSC_XXXX should have returned an error

Use this function to get extended error information when a UVSC command function (eg UVSC_DBG_CALC_EXPRESSION) fails. It is thread-safe and returns the last error for the calling thread, not the last error for the entire connection, so should be called from the same thread as the UVSC command function that caused the error.

_UVSC_FUNC_ UVSC_STATUS UVSC_Init ( int  uvMinPort,
int  uvMaxPort 
)

Initialise UVSC.

Parameters:
uvMinPort Minimum port avialable to the automatic port allocator. This must not be smaller than UVSC_MIN_AUTO_PORT
uvMaxPort Maximum port avialable to the automatic port allocator. This must not be larger than UVSC_MAX_AUTO_PORT
Call this function to initialise UVSC. This function must be called before any other UVSC function except UVSC_Version.

_UVSC_FUNC_ UVSC_STATUS UVSC_LogControl ( int  iConnHandle,
xBOOL  enableRaw,
xBOOL  enableTrace 
)

Control message logging.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
enableRaw Pass 'xTRUE' to enable logging of raw UVSOCK data, or 'xFALSE' to disable it. The default option on connection is 'xFALSE'
enableTrace Pass 'xTRUE' to enable logging of UVSC function trace, or 'xFALSE' to disable it. The default option on connection is 'xTRUE'
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

Logging should be enabled for this connection handle (ie one or both of logFileName and logCallback passed to UVSC_OpenConnection should not be NULL)

Use this function to control what information is logged via the log file or logging callback.

_UVSC_FUNC_ UVSC_STATUS UVSC_OpenConnection ( char *  name,
int *  iConnHandle,
int *  pPort,
char *  uvCmd,
UVSC_RUNMODE  uvRunmode,
uvsc_cb  callback,
void *  cb_custom,
char *  logFileName,
xBOOL  logFileAppend,
log_cb  logCallback 
)

Open a connection to uVision session.

Parameters:
name Pointer to a zero terminated string containing a unique connection name. This name can be used later to retrieve the connection handle (iConnHandle) via the UVSC_ConnHandleFromConnName function. If a connection name is not required this parameter should be NULL
iConnHandle Pointer to a variable to contain the handle assigned to this connection. The value assigned will be invalid if the function returns an error. This pointer must not be NULL
pPort Pointer to a variable containing the port of an existing uVision session to connect, or the value UVSC_PORT_AUTO to auto-start a uVision session for this connection. If the function returns successfully, this variable will contain the port that was used for the connection. This pointer must not be NULL.
uvCmd Pointer to a zero terminated string containing the path to a uVision executable to be started automatically for this connection. If uVision is not being auto-started this parameter is ignored and should be NULL
uvRunmode Indicates the mode uVision should be started in when auto-started. If uVision is not being auto-started this parameter is ignored
callback Pointer to a function to receive callbacks from UVSC. The callbacks provide notification of asynchronous UVSOCK messages, connection events, and errors relating to the connection. NOTE: UVSC_xxx API functions must not be called from the callback. To call a UVSC_xxx function in response to the callback, a notification must be passed another thread, which can then call the UVSC_xxx function.
cb_custom This pointer will be returned in the calls to the callback function. It may be used for any purpose, but a common usage is for keeping track of the 'this' pointer of a C++ object relating to the connection
logFileName Pointer to a zero terminated string containing the path to a file to use for logging UVSOCK messages for this connection for debug purposes. If a debugging log file is not required, this parameter should be NULL
logFileAppend Pass 'xTRUE' to append to the log file specified in logFileName, or 'xFALSE' to overwrite the file. If logFileName is NULL, this parameter is ignored
logCallback Pointer to a function to receive logging callbacks. These callbacks contain the same information that is entered into the log file. If this callback is not required, this parameter should be NULL
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_Init must have been called successfully
This function opens a connection to a uVision session. The session can be either an existing session, or UVSC can automatically start a new session.

To auto-start a new uVision session (recommended):

  • pPort must be UVSC_PORT_AUTO
  • uvCmd must be the path to a valid uVision executable that supports UVSOCK
Auto-starting uVision has the following advantages:

  • uVision is in a known state from the beginning of the connection
  • uVision can be started in a special mode, that restricts how a user can interact with the remotely controlled session
  • If the uVision session is terminated by an application other than UVSC, UVSC automatically restarts the uVision session
  • uVision starts hidden from the user, and can remain that way for the whole session, operating silently in the background, if necessary
  • The uVision session is a sub-process of UVSC, and can therefore be reliably terminated by UVSC when the connection is closed
To connect to an exisiting uVision session (not recommended):

  • pPort must be the UVSOCK port number of the existing uVision session
  • uvCmd must be NULL

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ACTIVE_FILES ( int  iConnHandle,
UINT *  pActiveFileCount 
)

Get the number of active files in the current project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pActiveFileCount Pointer to a variable to contain the active file count
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 not building, downloading, or debugging

Use this function to get the number of active files in the current project. This is the number of files that will be compiled or assembled when a rebuild is performed.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ADD_FILE ( int  iConnHandle,
PRJDATA pGroupFiles,
int  groupFilesLen 
)

Add a file to a group within the current uVision project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pGroupFiles Pointer to a structure containing the group name, and filename(s) for the files to add to the group. This is a variable length structure
groupFilesLen Size of the pGroupFiles data (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid, writable project is loaded, and uVision is not building, downloading, or debugging

Use this function to add a file to a group within the current uVision project.

This is the equivalent of clicking the 'Add Files to Group 'x'' group context menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ADD_GROUP ( int  iConnHandle,
PRJDATA pGroups,
int  groupsLen 
)

Add a group to the current uVision project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pGroups Pointer to a structure containing the group name(s) for the groups to add to the uVision project. This is a variable length structure
groupsLen Size of the pGroupFiles data (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid, writable project is loaded, and uVision is not building, downloading, or debugging

Use this function to add a group to the current uVision project.

This is the equivalent of clicking the 'New Group' Project context menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_BUILD ( int  iConnHandle,
xBOOL  rebuild 
)

Build the current uVision project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
rebuild 'xTRUE':= a rebuild is performed, 'xFALSE':= a build is performed
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 not building, downloading, or debugging

Use this function to build or rebuild the current uVision project.

This is the equivalent of clicking the 'Project-->Build', or 'Project-->Rebuild all target files' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_BUILD_CANCEL ( int  iConnHandle  ) 

Cancel a build that is currently in progress.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A project build is in progress

Use this function to cancel a build that is currently in progress. In the case of cancelling a UVSC initiated build, it must be called from a different thread than the UVSC_PRJ_BUILD function, because the build function will not return until the build is complete.

This is the equivalent of clicking the 'Project-->Stop Build' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_CLEAN ( int  iConnHandle  ) 

Clean the current uVision project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
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 not building, downloading, or debugging

Use this function to clean the current uVision project.

This is the equivalent of clicking the 'Project-->Clean target' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_CLOSE ( int  iConnHandle  ) 

Close the current uVision project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
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 not building, downloading, or debugging

Use this function to close the current uVision project, saving all the project and files.

This is the equivalent of clicking the 'Project-->Close Project' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_CMD_PROGRESS ( int  iConnHandle,
PGRESS pPgress,
int  pgressLen 
)

Control the uVision UI progress bar.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pPgress Pointer to a structure containing the progress bar data set. This is a variable length structure
pgressLen Size of the pPgress data (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to control the uVision UI progress bar. This can be useful to display a progress bar relating to time consuming client operations via the uVision progress bar.

This is the equivalent of reading settings in the 'Options for XYZ' dialogs in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_DEL_FILE ( int  iConnHandle,
PRJDATA pGroupFiles,
int  groupFilesLen 
)

Remove a file from a group within the current uVision project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pGroupFiles Pointer to a structure containing the group name, and filename(s) for the files to remove from the group. This is a variable length structure
groupFilesLen Size of the pGroupFiles data (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid, writable project is loaded, and uVision is not building, downloading, or debugging

Use this function to remove a file from a group within the current uVision project.

This is the equivalent of clicking the 'Remove File 'x'' file context menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_DEL_GROUP ( int  iConnHandle,
PRJDATA pGroups,
int  groupsLen 
)

Remove a group from the current uVision project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pGroups Pointer to a structure containing the group name(s) for the groups to remove from the uVision project. This is a variable length structure
groupsLen Size of the pGroupFiles data (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid, writable project is loaded, and uVision is not building, downloading, or debugging

Use this function to remove a group from the current uVision project.

This is the equivalent of clicking the 'Remove Group 'x' and its Files' group context menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ENUM_FILES ( int  iConnHandle,
SSTR pGroup,
int  groupLen,
SSTR pFiles,
int *  pFileIndexes,
int *  pFileCount 
)

Enumerate the files within a project group.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pGroup Pointer to a structure containing the group for which to enumerate the files
groupLen Length of the pGroup data
pFiles Pointer to a structure to contain the file(s)
pFileIndexes Pointer to a variable to contain the file index(es) within the pFiles data.
pFileCount Pointer to a variable to containing the number of items it is possible to fit into the pFiles and pFileIndexes structures. This variable will be updated with the actual number of files 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 not building, downloading, or debugging

Use this function to get a list of all the files that exist within the specified group.

The pointers pFiles and pFileIndexes must point to memory which is a multiple of the size of these structures. This multiple must be passed in the variable pFileCount. The multiple must make the pFiles memory space large enough to contain the maximum number of files 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.

The SSTR structure is designed to contain variable length data, therefore it may be the case that one record within pFiles actually takes up more than 1 index. Because of this, the returned data should be interpreted in the following way:

  
    for (i=0; i<*pFileCount; i++) {
      pointer_to_ith_file = pFiles[pFileIndexes[i]];
    }
 

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_ENUM_GROUPS ( int  iConnHandle,
SSTR pGroups,
int *  pGroupIndexes,
int *  pGroupCount 
)

Enumerate the groups within the current project.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pGroups Pointer to a structure to contain the group(s)
pGroupIndexes Pointer to a variable to contain the group index(es) within the pGroups data.
pGroupCount Pointer to a variable to containing the number of items it is possible to fit into the pGroups and pGroupIndexes 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 not building, downloading, or debugging

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

The pointers pGroups and pGroupIndexes 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.

The SSTR structure is designed to contain variable length data, therefore it may be the case that one record within pGroups actually takes up more than 1 index. Because of this, the returned data should be interpreted in the following way:

  
    for (i=0; i<*pGroupCount; i++) {
      pointer_to_ith_group = pGroups[pGroupIndexes[i]];
    }
 

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_FLASH_DOWNLOAD ( int  iConnHandle  ) 

Download the currently built executable to FLASH.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid project is loaded, has been built successfully, and uVision is not building, downloading, or debugging

Use this function to download the currently built executable to FLASH.

This is the equivalent of clicking the 'Flash-->Download' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_GET_DEBUG_TARGET ( int  iConnHandle,
DBGTGTOPT pDbgTgtOpt 
)

Set the debug uVision target configuration.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pDbgTgtOpt Pointer to a structure to contain the debug target configuration
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid project is loaded

Use this function to get the debug uVision target configuration

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_GET_OPTITEM ( int  iConnHandle,
TRNOPT pTrnOpt,
int  trnOptLen 
)

Get a uVision project option.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pTrnOpt Pointer to a structure containing the option item to get. The structure will be updated with the option item value. 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
trnOptLen Size of the pTrnOpt 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 not building, downloading, or debugging

Use this function to get the value of a uVision project option.

This is the equivalent of modifying settings in the 'Options for XYZ' dialogs in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_LOAD ( int  iConnHandle,
PRJDATA pProjectFile,
int  projectFileLen 
)

Load a project into uVision.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pProjectFile Pointer to a structure containing the path and filename of the project to load. This is a variable length structure
projectFileLen Size of the pProjectFile data (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

uVision is not building, downloading, or debugging

Use this function to load a project into uVision. The current project (if any) will be saved and closed.

This is the equivalent of clicking the 'Project-->Open Project...' menu item in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_SET_DEBUG_TARGET ( int  iConnHandle,
DBGTGTOPT pDbgTgtOpt 
)

Get the debug uVision target configuration.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pDbgTgtOpt Pointer to a structure containing the debug target configuration to set
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid, writable project is loaded, and uVision is not building, downloading, or debugging

Use this function to set the debug uVision target configuration

_UVSC_FUNC_ UVSC_STATUS UVSC_PRJ_SET_OPTITEM ( int  iConnHandle,
TRNOPT pTrnOpt,
int  trnOptLen 
)

Set a uVision project option.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pTrnOpt Pointer to a structure containing the option item to set, and the value to set it to. This is a variable length structure
trnOptLen Size of the pTrnOpt data (bytes)
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

A valid, writable project is loaded, and uVision is not building, downloading, or debugging

Use this function to set the value of a uVision project option.

This is the equivalent of reading settings in the 'Options for XYZ' dialogs in uVision.

_UVSC_FUNC_ UVSC_STATUS UVSC_ReadAsyncQ ( int  iConnHandle,
int  iQueueNo,
UVSOCK_CMD buf,
int  timeout 
)

Read a message from the UVSOCK asynchronous message queue.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
iQueueNo The asynchronous queue number to read
buf Pointer to a structure to hold the asynchronous UVSOCK message data
timeout Time to wait for a message on the queue before giving up
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully

NULL was passed as the callback parameter to UVSC_OpenConnection.

Use this function to read a message from the UVSOCK asynchronous message queue. Asynchronous UVSOCK messages received will be available via this queue, if (and only if) NULL is passed as the callback parameter to UVSC_OpenConnection.

If the queues are available, there are 3 queues (0, 1 and 2). This is to provide access to the aysnchronous messages for up to 3 tasks within the client application. Queues 1 and 2 will contain all UVSOCK asynchronous messages. Queue 0 ignores UV_DBG_WAKE and UV_DBG_SLEEP messages.

_UVSC_FUNC_ UVSC_STATUS UVSC_ReadBuildQ ( int  iConnHandle,
char *  pOutputLine,
int  timeout 
)

Read build messages from the build queue.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pOutputLine Pointer to a buffer to hold the build output line. The buffer should be at least UVSC_MAX_API_STR_SIZE bytes
timeout Time to wait for a message on the queue before giving up
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to read build messages from the build queue. Build messages are build output lines that contain 'compiling' or 'assembling' or 'linking' or build conclusion information. The messages on this queue can be used by the client to indicate build progress to the user, without the obtrusive warning and error messages. This is especially useful when uVision is being operated in the background. This queue is flushed automatically at the start of a build.

_UVSC_FUNC_ UVSC_STATUS UVSC_ReadPBarQ ( int  iConnHandle,
UVSC_PBAR pBar,
char *  pStr,
int  timeout 
)

Read progress bar messages from the progress bar queue.

Parameters:
iConnHandle Handle for the connection, as returned by UVSC_OpenConnection
pBar Pointer to an enumeration variable to hold the progress bar info type
pStr Pointer to a buffer to hold the progress bar information. The buffer should be at least UVSC_MAX_API_STR_SIZE bytes
timeout Time to wait for a message on the queue before giving up
Returns:
UVSC_STATUS_SUCCESS on success, or an error code
Precondition:
UVSC_OpenConnection must have been called successfully
Use this function to read progress bar messages from the progress bar queue. Progress bar messages reflect the progress bar situated at the bottom left corner of the uVision window. They can be used by the client to indicate operation progress. This is especially useful when uVision is being operated in the background. This function could be combined with the UVSC_PRJ_ACTIVE_FILES and UVSC_GetBuildOutput functions to provide the user with a build progress bar. This queue is flushed automatically automatically at the start of a build.

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

_UVSC_FUNC_ UVSC_STATUS UVSC_UnInit ( void   ) 

Uninitialise UVSC.

Precondition:
UVSC_Init should have been called successfully
Call this function to uninitialise UVSC. This function should be called before the UVSC library is unloaded from memory. All connected sessions will be automatically disconnected.

_UVSC_FUNC_ void UVSC_Version ( UINT *  pUVSCVersion,
UINT *  pUVSOCKVersion 
)

Get the library and interface versions.

Parameters:
pUVSCVersion Pointer to a variable to contain the UVSC library version
pUVSOCKVersion Pointer to a variable to contain the UVSOCK interface version
Returns the UVSC library and UVSOCK interface versions for this library.

The UINT version is converted to an X.YY version number by the following formula:

 X.YY = UV3_SOCKIF_VERS / 100 

For example:

 *pUVSOCKVersion = 201 ==> V2.01 


Copyright (c) KEIL - An ARM Company.
All rights reserved.
Visit our web site at www.keil.com.

Generated with doxygen.