ProSoft Technology MVI69-ADM User Manual

Page 130

Advertising
background image

Application Development Function Library - ADM API

MVI-ADM ♦ 'C' Programmable

Developer's Guide

'C' Programmable Application Development Module

Page 130 of 342

ProSoft Technology, Inc.

February 20, 2013

ADM_ConPrint

Syntax

int ADM_ConPrint(ADMHANDLE adm_handle, ADM_INTERFACE *adm_interface_ptr);

Parameters

adm_handle

Handle returned by previous call to ADM_Open

adm_interface_ptr

Pointer to ADM_INTERFACE structure to allow API access to
structures

Description
This function outputs characters to the debug port. This function will buffer the
output and allow other functions to run. The buffer is serviced with each call to
ADM_ProcessDebug and can be serviced by the user's program. When sending
data to the debug port, if printf statements are used, other processes will be held
up until the printf function completes execution. Two variables in the interface
structure must be set when data is loaded. The first, buff_ch is the offset of the
next character to print. This should be set to 0. The second is buff_len. This
should be set to the length of the string placed in the buffer.

adm_handle must be a valid handle returned from ADM_Open.

Return Value

ADM_ERR_NOACCESS

adm_handle does not have access

Number of characters left in the buffer

Example

ADMHANDLE adm_handle;
ADM_INTERFACE *interface_ptr;
ADM_INTERFACE interface;
interface_ptr = &interface;
sprintf(interface.buff,"MVI ADM\n");
interface.buff_ch = 0;
interface.buff_len = strlen(interface.buff);
/* write buffer to console */
while(interface.buff_len)
{
interface.buff_len = ADM_ConPrint(adm_handle, interface_ptr);
}

Advertising