(Page 6 of 14 in this chapter)


agmFormatAGMessage

Description

Formats an AG message received from the board into a character string for printing.

Prototype

DWORD agmFormatAGMessage ( AGM_AGMSG *msg,
char *buffer,
int buffersize)

msg Pointer to an AGM_AGMSG structure that contains a valid AG message. AGM_AGMSG is defined as:


typedef struct
{
WORD message ;
WORD channel ;
WORD object ;
BYTE stream ;
BYTE instance ;
DWORD time ;
WORD reserved ;
BYTE bufcnt ;
BYTE parmcnt ;
WORD parms[16] ;
} AGM_AGMSG ;
See agmGetAGMessage for a description of these fields.

buffer Pointer to a buffer to receive the character string.

buffersize Size of the character buffer passed in.

Return Values

Details

This function receives an AG message from the board and formats the message as a character string suitable for printing or logging. This string, or as much of it as will fit, is placed in the provided buffer.

See Also

agmGetAGMessage

Example


for (;;)
{
AGM_AGMSG agmsg;
DWORD ret;

/* Wait for muxhd to be signaled */
if (wait_event (muxhd) != SUCCESS)
break;

ret = agmGetAGMessage (agmhd, &agmsg);
if (ret == AGMERR_SIGNALLED)
/* muxhd was signaled via agmSignalMuxHandle */
break;
if (ret == AGMERR_FAILURE)
printf ("agmGetAGMessage failed");
else
{
char tmpstr[256];

agmFormatAGMessage (agmsg, tmpstr, sizeof tmpstr);
printf (tmpstr);
}
}


(Page 6 of 14 in this chapter)


tech_support@nmss.com
Copyright © 1998, Natural MicroSystems, Inc. All rights reserved.